From: Andreas Schneider Date: Wed, 10 Oct 2012 07:13:41 +0000 (+0200) Subject: include: Correctly detect uintptr_t size on Linux. X-Git-Tag: cmocka-1.1.1~307 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fa96c5e5675ee929b11b2280e9ac0162cfea7ee;p=platform%2Fupstream%2Fcmocka.git include: Correctly detect uintptr_t size on Linux. This is needed to compile for i686 on a x86_64 system. --- diff --git a/src/include/cmocka.h b/src/include/cmocka.h index ae6802d..7aa31c8 100755 --- a/src/include/cmocka.h +++ b/src/include/cmocka.h @@ -81,14 +81,22 @@ int __stdcall IsDebuggerPresent(); /* WIN32 is an ILP32 platform */ typedef unsigned long uintptr_t; -#else /* _WIN32 */ - /* what about 64-bit windows? * what's the right preprocessor symbol? typedef unsigned long long uintptr_t */ +#else /* _WIN32 */ + /* ILP32 and LP64 platforms */ -typedef unsigned long uintptr_t; +#ifdef __WORDSIZE +# if __WORDSIZE == 64 +typedef unsigned long int uintptr_t; +# else +typedef unsigned int uintptr_t; +# endif /* __WORDSIZE == 64 */ +#else /* __WORDSIZE */ +typedef unsigned long int uintptr_t; +#endif /* __WORDSIZE */ #endif /* _WIN32 */ #endif /* _UINTPTR_T */