Re: [Cppcms-users] feedback after testing cppcms svn trunk compiled with msvc2005
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2011-01-21 11:38:08
|
> From: Cristian Oneț <one...@gm...> > > I just find another small issue while trying to use #include > <cppcms/json.h> in my application. In the "wonderful world" of msvc > you can choose how wchar_t is interpreted by the compiler [1] so if > "/Zc:wchar_t-" is used wchar_t is defined as "unsigned short" and not > as a native type. In this case CPPCMS_JSON_SPECIALIZE_INT(wchar_t) and > CPPCMS_JSON_SPECIALIZE_INT(unsigned short) will be one and the same > and result in a compilation error which can be fixed by the attached > patch. > > [1] http://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.80%29.aspx > > Regards, > Cristian > C++ standard requires that wchar_t is distinct type, and defining it same type as unsigned short is not right and will not be supported. According to link, MSVC uses /Zc:wchar_t by default so it should be distinct type. If this is not default then it should be defined so in compilation options with this compiler. I'm not going to do ifdefs to support broken compiler especially if a simple flag can fix this and new versions of MSVC do this right. Artyom |