aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-10-13 14:38:13 -0700
committerBen Pfaff <blp@nicira.com>2011-10-13 14:52:55 -0700
commit4ca66bfaeb49e6fe85ccd8d8f4f11dbb96213636 (patch)
tree1b773371586ee64e73bb488eb5b54211a6522e56 /include
parentb6bff4e9abaf2d9a53136854a733b7c4c5d4384e (diff)
Fix broken build in XenServer DDK 5.6.100-39265p.
Avoids errors like the following: In file included from ./include/openvswitch/types.h:21, from ./lib/vconn.h:21, from tests/test-vconn.c:18: /usr/include/sys/types.h:52: error: conflicting types for 'ino_t' /usr/include/linux/types.h:14: error: previous declaration of 'ino_t' was here /usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:13: error: previous declaration of 'dev_t' was here /usr/include/sys/types.h:67: error: conflicting types for 'gid_t' /usr/include/linux/types.h:27: error: previous declaration of 'gid_t' was here /usr/include/sys/types.h:72: error: conflicting types for 'mode_t' /usr/include/linux/types.h:15: error: previous declaration of 'mode_t' was here /usr/include/sys/types.h:77: error: conflicting types for 'nlink_t' /usr/include/linux/types.h:16: error: previous declaration of 'nlink_t' was here /usr/include/sys/types.h:82: error: conflicting types for 'uid_t' /usr/include/linux/types.h:26: error: previous declaration of 'uid_t' was here /usr/include/sys/types.h:90: error: conflicting types for 'off_t' /usr/include/linux/types.h:17: error: previous declaration of 'off_t' was here
Diffstat (limited to 'include')
-rw-r--r--include/linux/types.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/types.h b/include/linux/types.h
index 4579add2..13112e8f 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -23,7 +23,13 @@
* <linux/types.h> to allow <linux/openvswitch.h> to work, that is, it defines
* the __u<N> and __be<N> types. */
-#if __KERNEL__ || HAVE_LINUX_TYPES_H
+#ifdef __KERNEL__
+#include_next <linux/types.h>
+#elif defined(HAVE_LINUX_TYPES_H)
+/* With some combinations of kernel and userspace headers, including both
+ * <sys/types.h> and <linux/types.h> only works if you do so in that order, so
+ * force it. */
+#include <sys/types.h>
#include_next <linux/types.h>
#else /* no <linux/types.h> */
#include <stdint.h>