Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Robert P. J. Day and committed by
Linus Torvalds
94f582f8 a36a151e

+12 -4
+3 -1
include/linux/compiler-gcc.h
··· 1 - /* Never include this file directly. Include <linux/compiler.h> instead. */ 1 + #ifndef __LINUX_COMPILER_H 2 + #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead." 3 + #endif 2 4 3 5 /* 4 6 * Common definitions for all gcc versions go here.
+3 -1
include/linux/compiler-gcc3.h
··· 1 - /* Never include this file directly. Include <linux/compiler.h> instead. */ 1 + #ifndef __LINUX_COMPILER_H 2 + #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." 3 + #endif 2 4 3 5 /* These definitions are for GCC v3.x. */ 4 6 #include <linux/compiler-gcc.h>
+3 -1
include/linux/compiler-gcc4.h
··· 1 - /* Never include this file directly. Include <linux/compiler.h> instead. */ 1 + #ifndef __LINUX_COMPILER_H 2 + #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." 3 + #endif 2 4 3 5 /* These definitions are for GCC v4.x. */ 4 6 #include <linux/compiler-gcc.h>
+3 -1
include/linux/compiler-intel.h
··· 1 - /* Never include this file directly. Include <linux/compiler.h> instead. */ 1 + #ifndef __LINUX_COMPILER_H 2 + #error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead." 3 + #endif 2 4 3 5 #ifdef __ECC 4 6