From: yangsheng Date: Wed, 20 Jan 2010 18:41:39 +0000 (-0800) Subject: b=18790 Add config check to avoid type conflict. X-Git-Tag: 1.10.0.35~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2606b783041ef0d126f2a7377378e434d2df5436 b=18790 Add config check to avoid type conflict. i=panda i=yangsheng --- diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index 51a5889..467874c 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -733,6 +733,36 @@ AC_CHECK_TYPE([umode_t], [], [#include ]) +AC_CHECK_TYPE([__s8], + [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])], + [], + [#include ]) + +AC_CHECK_TYPE([__u8], + [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])], + [], + [#include ]) + +AC_CHECK_TYPE([__s16], + [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])], + [], + [#include ]) + +AC_CHECK_TYPE([__u16], + [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])], + [], + [#include ]) + +AC_CHECK_TYPE([__s32], + [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])], + [], + [#include ]) + +AC_CHECK_TYPE([__u32], + [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])], + [], + [#include ]) + AC_CHECK_TYPE([__u64], [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])], [], diff --git a/libcfs/include/libcfs/posix/posix-types.h b/libcfs/include/libcfs/posix/posix-types.h index b5c66aa..e43311f 100644 --- a/libcfs/include/libcfs/posix/posix-types.h +++ b/libcfs/include/libcfs/posix/posix-types.h @@ -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;