1 #include <android/api-level.h> 2 3 #if !__LP64__ && !defined(__arm__) || __ANDROID_API__ == 3 4 5 // This checks that simply including <wchar.h> with 6 // _WCHAR_IS_8BIT defined will provice an 8-bit wchar_t 7 // and 8-bit WCHAR_MIN/WCHAR_MAX. 8 9 // Force wchar_t to be 8 bits. 10 #define _WCHAR_IS_8BIT 11 #include <wchar.h> 12 13 #define CONCAT(x,y) CONCAT_(x,y) 14 #define CONCAT_(x,y) x ## y 15 16 #define STATIC_ASSERT(condition) \ 17 static char CONCAT(dummy_,__LINE__)[1 - 2*(!(condition))]; 18 19 #if defined(__arm__) || __ANDROID_API__ < 9 20 STATIC_ASSERT(sizeof(__WCHAR_TYPE__) == 1); 21 STATIC_ASSERT(sizeof(wchar_t) == 1); 22 #else 23 STATIC_ASSERT(sizeof(__WCHAR_TYPE__) == 4); 24 STATIC_ASSERT(sizeof(wchar_t) == 4); 25 #endif 26 27 // Since this is C code, the old behaviour was to always define 28 // these constants as signed 32 bit values. 29 STATIC_ASSERT(WCHAR_MIN == 0x80000000); 30 STATIC_ASSERT(WCHAR_MAX == 0x7fffffff); 31 32 #endif