diff mbox

[U-Boot,2/2] standalone: use GCC_VERSION defined in compiler-gcc.h

Message ID 1409766059-7337-3-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada Sept. 3, 2014, 5:40 p.m. UTC
Now GCC_VERSION is defined in include/linux/compiler-gcc.h
(with a little different definition).
Use it and delete the one in examples/standlone/stub.c.

This should work on Clang too because __GNUC__, __GNUC_MINOR__,
__GNUC_PATCHLEVEL__ are also defined on Clang.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
---

 examples/standalone/stubs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Tom Rini Sept. 17, 2014, 12:45 a.m. UTC | #1
On Thu, Sep 04, 2014 at 02:40:59AM +0900, Masahiro Yamada wrote:

> Now GCC_VERSION is defined in include/linux/compiler-gcc.h
> (with a little different definition).
> Use it and delete the one in examples/standlone/stub.c.
> 
> This should work on Clang too because __GNUC__, __GNUC_MINOR__,
> __GNUC_PATCHLEVEL__ are also defined on Clang.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Jeroen Hofstee <jeroen@myspectrum.nl>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index c5c025d..0bf690e 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -1,9 +1,6 @@ 
 #include <common.h>
 #include <exports.h>
-
-#ifndef GCC_VERSION
-#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
+#include <linux/compiler.h>
 
 #if defined(CONFIG_X86)
 /*
@@ -237,7 +234,7 @@  gd_t *global_data;
  * implementation. On the other hand, asm() statements with
  * arguments can be used only inside the functions (gcc limitation)
  */
-#if GCC_VERSION < 3004
+#if GCC_VERSION < 30400
 static
 #endif /* GCC_VERSION */
 void __attribute__((unused)) dummy(void)