This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Initialization of __WCHAR_TYPE__ in cppinit.c



David Edelsohn <dje@watson.ibm.com> writes:

> 	I've got some good news and some bad news.
> 
> 	The good news: AIX V5 addresses wchar_t previously having been
> defined as 16-bit "unsigned short int" in earlier versions of AIX when
> 32-bit "unsigned int" now is the norm.

Oh good!

> 	The bad news: AIX V5 only defines wchar_t as 32-bits in 64-bit
> mode; it remains 16-bits in 32-bit mode for backward compatibility.  This
> means the type is now runtime-dependent.
> 
> 	The tm.h definition of WCHAR_TYPE_SIZE can handle this
> variability, but one of the uses of the WCHAR_TYPE definition cannot.  I
> need to define WCHAR_TYPE as:
> 
> #define WCHAR_TYPE (!TARGET_64BIT ? "short unsigned int" : "unsigned int")
> 
> The following patch makes the definition dynamic, but I am not sure if
> this is how you want to handle it.

A better way to do this is to define NO_BUILTIN_WCHAR_TYPE, and then
define __WCHAR_TYPE__ in CPP_PREDEFINES based on whether -maix64 was
supplied or not (and presumably also keyed off -fshort-wchar, so that
users can override it).

-- 
- Geoffrey Keating <geoffk@geoffk.org>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]