[PATCH 2.6.4-rc2]: define __attribute_const__ for userspace includes

From: Ville Nuorvala
Date: Fri Mar 05 2004 - 02:46:47 EST


Hi,

since at least the __attribute_const__ macro leaks into userspace via
include/linux/if_tunnel.h, it causes a syntax error unless it is defined
outside the #ifdef __KERNEL__ block in include/linux/compiler.h.

The patch below fixes this (and possibly other similar cases).

Thanks,
Ville

===== include/linux/compiler.h 1.23 vs edited =====
--- 1.23/include/linux/compiler.h Thu Feb 19 08:54:05 2004
+++ edited/include/linux/compiler.h Fri Mar 5 09:22:08 2004
@@ -39,6 +39,20 @@
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)

+/* Optimization barrier */
+#ifndef barrier
+# define barrier() __memory_barrier()
+#endif
+
+#ifndef RELOC_HIDE
+# define RELOC_HIDE(ptr, off) \
+ ({ unsigned long __ptr; \
+ __ptr = (unsigned long) (ptr); \
+ (typeof(ptr)) (__ptr + (off)); })
+#endif
+
+#endif /* __KERNEL__ */
+
/*
* Allow us to mark functions as 'deprecated' and have gcc emit a nice
* warning for each use, in hopes of speeding the functions removal.
@@ -99,19 +113,5 @@
#ifndef noinline
#define noinline
#endif
-
-/* Optimization barrier */
-#ifndef barrier
-# define barrier() __memory_barrier()
-#endif
-
-#ifndef RELOC_HIDE
-# define RELOC_HIDE(ptr, off) \
- ({ unsigned long __ptr; \
- __ptr = (unsigned long) (ptr); \
- (typeof(ptr)) (__ptr + (off)); })
-#endif
-
-#endif /* __KERNEL__ */

#endif /* __LINUX_COMPILER_H */

--
Ville Nuorvala
Research Assistant, Institute of Digital Communications,
Helsinki University of Technology
email: vnuorval@xxxxxxxxxx, phone: +358 (0)9 451 5257
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/