This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Initialization of __WCHAR_TYPE__ in cppinit.c
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Re: Initialization of __WCHAR_TYPE__ in cppinit.c
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 04 Jan 2001 13:17:59 -0800
- CC: gcc-patches at gcc dot gnu dot org
- References: <200101042105.QAA38988@mal-ach.watson.ibm.com>
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>