From 94f582f82a85a941678c80c60a3baa8187c74217 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Tue, 16 Oct 2007 23:26:11 -0700 Subject: [PATCH] Force erroneous inclusions of compiler-*.h files to be errors Replace worthless comments with actual preprocessor errors when including the wrong versions of the compiler.h files. [akpm@linux-foundation.org: make it work] Signed-off-by: Robert P. J. Day Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/compiler-gcc.h | 4 +++- include/linux/compiler-gcc3.h | 4 +++- include/linux/compiler-gcc4.h | 4 +++- include/linux/compiler-intel.h | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 03ec2311fb29..acd583384bd9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -1,4 +1,6 @@ -/* Never include this file directly. Include instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif /* * Common definitions for all gcc versions go here. diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index a9e2863c2dbf..2d8c0f48f55e 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h @@ -1,4 +1,6 @@ -/* Never include this file directly. Include instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif /* These definitions are for GCC v3.x. */ #include diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 14f7494280f0..ee7ca5de970c 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -1,4 +1,6 @@ -/* Never include this file directly. Include instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif /* These definitions are for GCC v4.x. */ #include diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index b769961e6f23..d8e636e5607d 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h @@ -1,4 +1,6 @@ -/* Never include this file directly. Include instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif #ifdef __ECC -- 2.20.1