This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Handle cygwin wchar_t specifics
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Sat, 16 Apr 2011 15:24:06 -0600
- Subject: Re: [RFA] Handle cygwin wchar_t specifics
- References: <5928.31498147479$1302882967@news.gmane.org> <m3ei53cres.fsf@fleche.redhat.com> <005101cbfc50$193136b0$4b93a410$@muller@ics-cnrs.unistra.fr>
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> Yes, but the problem is that it is not possible to use sizeof
Pierre> inside a #if conditions :(
Pierre> Do you know of any way to get the size of wchar_t?
Pierre> I suspect we will need to add this to the configure scripts...
Pierre> But I am still very bad on that part.
In this case you don't need to know the size during preprocessing.
You can do something like:
extern const char *intermediate_encoding;
#define INTERMEDIATE_ENCODING intermediate_encoding
... and then initialize the string in _initialize_charset, under the
appropriate conditions. The only caveat is to check the case where the
size is neither 2 nor 4.
Tom