To port my code, I need to force "wide-characters" to be some kind of
unsigned integer ("unsigned long", "unsigned int", "unsigned long int").
Unfortunately, I cannot figure out how to make this happen in gcc.
I found a command line argument that makes regular 8-bit characters
be "unsigned char" by default, but apparently it doesn't change the
data-type of the "wchar_t" (wide character) data-type --- which is a
signed 32-bit integer ("signed int" or "signed long" or "signed long int").
I find this rather strange actually, since one of the standard include files
I need to include into my project ("/usr/include/X11/Xlib.h") contains the
following line:
typedef unsigned long wchar_t;
The 3D graphics engine I am trying to port to linux with gcc/eclipse
also typedefs its wide character data-type to "unsigned long".
That is perfect, since my code needs to call many functions in
the xlib/XWindows function library. What is not perfect is the
apparent contradiction (and fatal type mismatch) in the default
header files that appears to force wchar_t to be a signed integer,
without any obvious way to change it to an unsigned 32-bit integer.
Help! How can I escape this mess? How does XWindows/xlib
avoid this problem?
--
View this message in context:
http://www.nabble.com/unsigned-32-bit-characters-in-gcc-linux-C-C%2B%2B-tp15115198p15115198.html
Sent from the C-prog mailing list archive at Nabble.com.