Hi,
We had the same problem at my company recently. wchar_t size varies according to the platform and event the compiler on a platform.
What we did is that :
- we suppresed all wchar_t and wsprintf, etc... stuff
- we developed an in-house C++ class handling 2 bytes long characters (we typedef it with #ifdef VISUALC, #ifdef GCCLINUX, etc...). We can convert an XMLCh* to that object or from that object to a 2 bytes char array and assign it to an XMLCh*.
It does not handle local page problem yet, we rely on XMLCh* for that.
 
HTH
 
Nikko
 
 
 
 

 -----Message d'origine-----
De : Endre Magyari [mailto:[EMAIL PROTECTED]]
Envoy� : mardi 10 septembre 2002 17:12
� : [EMAIL PROTECTED]
Objet : GCC vs. typedef unsigned short XMLCh

Dear list,
 
 
    I'm porting an application using Xerces from WIN32 to Linux/gcc.
 
    I have this piece of code:(a is a DOMString)
    -------8><--------------
    const wchar_t *buf = a.rawBuffer();
    wchar_t * endptr;
    unsigned long retval = wcstoul(buf+2, &endptr, 16);
    -------8><---------------
 
Under win32, it seems appropiate because both wchar_t and XMLCh are typedef-ed to unsigned short.
However, this is not the case under Linux/G++. wchar_t and wcstoul are defined there as well, but wchar_t becomes typedef-ed to unsigned long.
Now you probaly can guess my question... How to convert a from a 16bits long wide char array to a 32 or 64 bits long wide char array, assuming that I would like to use the wcstoul function.
 
Thank you,
Endre Magyari

  

Reply via email to