Whamcloud - gitweb
b=18790 Add config check to avoid type conflict.
authoryangsheng <Sheng.Yang@Sun.COM>
Wed, 20 Jan 2010 18:41:39 +0000 (10:41 -0800)
committerRobert Read <rread@sun.com>
Wed, 20 Jan 2010 18:41:39 +0000 (10:41 -0800)
i=panda
i=yangsheng

libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/posix/posix-types.h

index 51a5889..467874c 100644 (file)
@@ -733,6 +733,36 @@ AC_CHECK_TYPE([umode_t],
        [],
        [#include <asm/types.h>])
 
+AC_CHECK_TYPE([__s8],
+       [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
+       [],
+       [#include <asm/types.h>])
+
+AC_CHECK_TYPE([__u8],
+       [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
+       [],
+       [#include <asm/types.h>])
+
+AC_CHECK_TYPE([__s16],
+       [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
+       [],
+       [#include <asm/types.h>])
+
+AC_CHECK_TYPE([__u16],
+       [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
+       [],
+       [#include <asm/types.h>])
+
+AC_CHECK_TYPE([__s32],
+       [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
+       [],
+       [#include <asm/types.h>])
+
+AC_CHECK_TYPE([__u32],
+       [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
+       [],
+       [#include <asm/types.h>])
+
 AC_CHECK_TYPE([__u64],
        [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
        [],
index b5c66aa..e43311f 100644 (file)
@@ -54,14 +54,26 @@ typedef umode_t cfs_umode_t;
  * header files exported to user space
  */
 
+#ifndef HAVE___S8
 typedef __signed__ char __s8;
+#endif
+#ifndef HAVE___U8
 typedef unsigned char __u8;
+#endif
 
+#ifndef HAVE___S16
 typedef __signed__ short __s16;
+#endif
+#ifndef HAVE___U16
 typedef unsigned short __u16;
+#endif
 
+#ifndef HAVE___S32
 typedef __signed__ int __s32;
+#endif
+#ifndef HAVE___U32
 typedef unsigned int __u32;
+#endif
 
 #ifndef HAVE___S64
 typedef __signed__ long long __s64;