Hi!
Take a look at The C Programming Language (2nd ed.) page 91. "The
expression defined(name) in a #if is 1 if the name has been defined, and 0
otherwise." So defined should be used with parenthesis, I think. At least
most of Linux kernel source code is doing so. Ok?
Petri
--- linux-2.5/include/asm-i386/module.h.~1.7.~ 2003-02-15 22:24:11.000000000 +0200
+++ linux-2.5/include/asm-i386/module.h 2003-08-30 17:16:06.000000000 +0300
@@ -12,41 +12,41 @@
#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
-#elif defined CONFIG_M486
+#elif defined(CONFIG_M486)
#define MODULE_PROC_FAMILY "486 "
-#elif defined CONFIG_M586
+#elif defined(CONFIG_M586)
#define MODULE_PROC_FAMILY "586 "
-#elif defined CONFIG_M586TSC
+#elif defined(CONFIG_M586TSC)
#define MODULE_PROC_FAMILY "586TSC "
-#elif defined CONFIG_M586MMX
+#elif defined(CONFIG_M586MMX)
#define MODULE_PROC_FAMILY "586MMX "
-#elif defined CONFIG_M686
+#elif defined(CONFIG_M686)
#define MODULE_PROC_FAMILY "686 "
-#elif defined CONFIG_MPENTIUMII
+#elif defined(CONFIG_MPENTIUMII)
#define MODULE_PROC_FAMILY "PENTIUMII "
-#elif defined CONFIG_MPENTIUMIII
+#elif defined(CONFIG_MPENTIUMIII)
#define MODULE_PROC_FAMILY "PENTIUMIII "
-#elif defined CONFIG_MPENTIUM4
+#elif defined(CONFIG_MPENTIUM4)
#define MODULE_PROC_FAMILY "PENTIUM4 "
-#elif defined CONFIG_MK6
+#elif defined(CONFIG_MK6)
#define MODULE_PROC_FAMILY "K6 "
-#elif defined CONFIG_MK7
+#elif defined(CONFIG_MK7)
#define MODULE_PROC_FAMILY "K7 "
-#elif defined CONFIG_MK8
+#elif defined(CONFIG_MK8)
#define MODULE_PROC_FAMILY "K8 "
-#elif defined CONFIG_MELAN
+#elif defined(CONFIG_MELAN)
#define MODULE_PROC_FAMILY "ELAN "
-#elif defined CONFIG_MCRUSOE
+#elif defined(CONFIG_MCRUSOE)
#define MODULE_PROC_FAMILY "CRUSOE "
-#elif defined CONFIG_MWINCHIPC6
+#elif defined(CONFIG_MWINCHIPC6)
#define MODULE_PROC_FAMILY "WINCHIPC6 "
-#elif defined CONFIG_MWINCHIP2
+#elif defined(CONFIG_MWINCHIP2)
#define MODULE_PROC_FAMILY "WINCHIP2 "
-#elif defined CONFIG_MWINCHIP3D
+#elif defined(CONFIG_MWINCHIP3D)
#define MODULE_PROC_FAMILY "WINCHIP3D "
-#elif defined CONFIG_MCYRIXIII
+#elif defined(CONFIG_MCYRIXIII)
#define MODULE_PROC_FAMILY "CYRIXIII "
-#elif CONFIG_MVIAC3_2
+#elif defined(CONFIG_MVIAC3_2)
#define MODULE_PROC_FAMILY "VIAC3-2 "
#else
#error unknown processor family
In message <[email protected]> you w
rite:
> Hi!
>
> Take a look at The C Programming Language (2nd ed.) page 91. "The
> expression defined(name) in a #if is 1 if the name has been defined, and 0
> otherwise." So defined should be used with parenthesis, I think. At least
> most of Linux kernel source code is doing so. Ok?
And page 232 indicates that the brackets are not required (hey, I had
to check, too).
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.