On 17 November 2015 at 16:04, David Edelsohn wrote: > The testcase in the GCC testsuite assumes that wchar_t is 32 bits, > which is not correct on AIX. 32 bit AIX maintains 16 bit wchar_t for > backward compatibility (64 bit AIX uses 32 bit wchar_t). > > What is the preferred method to make the testcase safe for smaller wchar_t? > > The following patch works for me. I wasn't sure what header file and > what macro test would be considered portable. I could include > stdint.h and compare > > WCHAR_MAX == UINT16_MAX > > or > > WCHAR_MAX < UINT32_MAX
__SIZEOF_WCHAR_T__ is always pre-defined by the compiler, so that could be used.