diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2009-02-26 00:22:19 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-26 18:14:23 +0100 |
commit | 8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee (patch) | |
tree | 93e289fae6ee92c29c45f74cdafc6a6a11fdc4b7 /include | |
parent | remove __KERNEL_STRICT_NAMES (diff) | |
download | linux-8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee.tar.xz linux-8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee.zip |
compiler-gcc4: conditionalize #error on __KERNEL__
Impact: Fix for exported headers
We only want to error out on specific gcc versions if we are actually
building the kernel, so conditionalize the #if...#error on __KERNEL__.
Based on a patchset by Arnd Bergmann <arnd@arndb.de>.
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/compiler-gcc4.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 09992718f9e8..450fa597c94d 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -3,8 +3,10 @@ #endif /* GCC 4.1.[01] miscompiles __weak */ -#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 -# error Your version of gcc miscompiles the __weak directive +#ifdef __KERNEL__ +# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 +# error Your version of gcc miscompiles the __weak directive +# endif #endif #define __used __attribute__((__used__)) |