aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-gcc4.h
diff options
context:
space:
mode:
authorDaniel Santos <daniel.santos@pobox.com>2013-02-21 19:41:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:15 -0500
commit733ed6e43756b0aec25c9429b810ba74e24c980c (patch)
tree3d7a2704f4501729a0297803403b09d0b20508d3 /include/linux/compiler-gcc4.h
parent3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16 (diff)
compiler-gcc{3,4}.h: Use GCC_VERSION macro
Using GCC_VERSION reduces complexity, is easier to read and is GCC's recommended mechanism for doing version checks. (Just don't ask me why they didn't define it in the first place.) This also makes it easy to merge compiler-gcc{,3,4}.h should somebody want to. Signed-off-by: Daniel Santos <daniel.santos@pobox.com> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Borislav Petkov <bp@alien8.de> Cc: Andi Kleen <ak@linux.intel.com> Cc: Joe Perches <joe@perches.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compiler-gcc4.h')
-rw-r--r--include/linux/compiler-gcc4.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index c9785c22744e..a9ffdfe7713c 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -4,7 +4,7 @@
4 4
5/* GCC 4.1.[01] miscompiles __weak */ 5/* GCC 4.1.[01] miscompiles __weak */
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 7# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
8# error Your version of gcc miscompiles the __weak directive 8# error Your version of gcc miscompiles the __weak directive
9# endif 9# endif
10#endif 10#endif
@@ -13,11 +13,11 @@
13#define __must_check __attribute__((warn_unused_result)) 13#define __must_check __attribute__((warn_unused_result))
14#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) 14#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
15 15
16#if __GNUC_MINOR__ > 0 16#if GCC_VERSION >= 40100
17# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 17# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
18#endif 18#endif
19 19
20#if __GNUC_MINOR__ >= 3 20#if GCC_VERSION >= 40300
21/* Mark functions as cold. gcc will assume any path leading to a call 21/* Mark functions as cold. gcc will assume any path leading to a call
22 to them will be unlikely. This means a lot of manual unlikely()s 22 to them will be unlikely. This means a lot of manual unlikely()s
23 are unnecessary now for any paths leading to the usual suspects 23 are unnecessary now for any paths leading to the usual suspects
@@ -41,9 +41,9 @@
41# define __compiletime_warning(message) __attribute__((warning(message))) 41# define __compiletime_warning(message) __attribute__((warning(message)))
42# define __compiletime_error(message) __attribute__((error(message))) 42# define __compiletime_error(message) __attribute__((error(message)))
43#endif /* __CHECKER__ */ 43#endif /* __CHECKER__ */
44#endif /* __GNUC_MINOR__ >= 3 */ 44#endif /* GCC_VERSION >= 40300 */
45 45
46#if __GNUC_MINOR__ >= 5 46#if GCC_VERSION >= 40500
47/* 47/*
48 * Mark a position in code as unreachable. This can be used to 48 * Mark a position in code as unreachable. This can be used to
49 * suppress control flow warnings after asm blocks that transfer 49 * suppress control flow warnings after asm blocks that transfer
@@ -58,9 +58,9 @@
58/* Mark a function definition as prohibited from being cloned. */ 58/* Mark a function definition as prohibited from being cloned. */
59#define __noclone __attribute__((__noclone__)) 59#define __noclone __attribute__((__noclone__))
60 60
61#endif /* __GNUC_MINOR__ >= 5 */ 61#endif /* GCC_VERSION >= 40500 */
62 62
63#if __GNUC_MINOR__ >= 6 63#if GCC_VERSION >= 40600
64/* 64/*
65 * Tell the optimizer that something else uses this function or variable. 65 * Tell the optimizer that something else uses this function or variable.
66 */ 66 */
@@ -69,11 +69,11 @@
69 69
70 70
71#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP 71#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
72#if __GNUC_MINOR__ >= 4 72#if GCC_VERSION >= 40400
73#define __HAVE_BUILTIN_BSWAP32__ 73#define __HAVE_BUILTIN_BSWAP32__
74#define __HAVE_BUILTIN_BSWAP64__ 74#define __HAVE_BUILTIN_BSWAP64__
75#endif 75#endif
76#if __GNUC_MINOR__ >= 8 || (defined(__powerpc__) && __GNUC_MINOR__ >= 6) 76#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
77#define __HAVE_BUILTIN_BSWAP16__ 77#define __HAVE_BUILTIN_BSWAP16__
78#endif 78#endif
79#endif 79#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */