datapath: Compatibility code for __packed macro.
authorJesse Gross <jesse@nicira.com>
Sun, 12 Dec 2010 07:28:33 +0000 (23:28 -0800)
committerJesse Gross <jesse@nicira.com>
Mon, 13 Dec 2010 21:26:08 +0000 (13:26 -0800)
The __packed macro for structure packing wasn't introduced until 2.6.24,
so define it ourselves.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/linux-2.6/Modules.mk
datapath/linux-2.6/compat-2.6/include/linux/compiler-gcc.h [new file with mode: 0644]

index e1e33347bb0dbfd0f16aa8f83dbdd02568b0b357..29379a499ea5f8dbbea44acac09d826a5f2c4526 100644 (file)
@@ -11,6 +11,7 @@ openvswitch_headers += \
        linux-2.6/compat-2.6/compat26.h \
        linux-2.6/compat-2.6/include/asm-generic/bug.h \
        linux-2.6/compat-2.6/include/linux/bottom_half.h \
+       linux-2.6/compat-2.6/include/linux/compiler-gcc.h \
        linux-2.6/compat-2.6/include/linux/cpumask.h \
        linux-2.6/compat-2.6/include/linux/dmi.h \
        linux-2.6/compat-2.6/include/linux/err.h \
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/compiler-gcc.h b/datapath/linux-2.6/compat-2.6/include/linux/compiler-gcc.h
new file mode 100644 (file)
index 0000000..1ee8d6f
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
+#endif
+
+#include_next <linux/compiler-gcc.h>
+
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif