axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <stev...@iseran.com>
Subject Re: Axis C++ problem--FYI
Date Wed, 03 Sep 2003 15:51:06 GMT
damitha@opensource.lk wrote:

> Hi all,
> 
> The code in Axis c++ cvs compiles both for windows and linux. But it works
> only for windows. 
> We have identified the problem as is clear from the following xerces mailing
> archive. wchar_t is 32bit in linux and is 16 bit in Windows. We made the
> mistake of assuming that the wchar_t is 16 bit in every platform.
> We hope to solve this problem immediately and apologise for any inconvenience
> caused.
> This problem is describe in Xerces mailing list as follows.
> ========================================================================
> List:     xerces-c-dev
> Subject:  RE: wchar_t and XMLCh
> From:     "Nikko" <nikko () gmx ! fr>
> Date:     2003-03-04 20:58:28
> [Download message RAW]
> 
> 
> Believe me, wchar_t is evil. Redefine your own 16 bits string or use a
> string<unsigned short> instead, which you can convert to/from XMLCh* easily.
> Even if theoretically unsigned short is not necessarily two bytes long, it
> is far more reliable than wchar_t being 2 bytes long.
> 
> Best

Interesting. I never knew that.

Given you are building on VS6.0, you dont have the 'wchar_t is a unique 
type' switch which is the real benefit of using the type over a typedef. 
Flip it and you can override
foo(unsigned short); foo(unsigned long) and foo(wchar_t) without the 
compiler complaining.







Mime
View raw message