falcong / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

wcslen() still called when PUGI_WCHAR_MODE is not defined #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just used pugixml in a VxWorks project. VxWorks has no support for wide 
characters, so I made sure PUGI_WCHAR_MODE was undefined. When I built the 
program for the first time, the linker complained that wcslen was undefined.

It turns out that when PUGI_WCHAR_MODE is undefined, open_file_wide() calls 
wcslen(). 

To avoid this problem, I simply wrapped the entire definition of 
open_file_wide() with #ifdef PUGI_WCHAR_MODE. 

Of course, if you want open_file_wide() to function even if wide characters are 
disabled, a more elegant solution would be required.

Bill

Original issue reported on code.google.com by wrl...@gmail.com on 5 Dec 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Support for wchar_t is indeed a bit lacking for embedded platforms.
However, open_file_wide is useful even without PUGIXML_WCHAR_MODE (wchar mode 
changes the DOM representation, but opening Unicode paths is still needed for 
some applications - i.e. on Windows this is the only way to open files using 
Unicode paths, since it does not support UTF-8 in paths).

I'll change pugixml to not rely on wcslen if PUGIXML_WCHAR_MODE is not active 
(if it is then obviously the platform is expected to fully support wide 
characters).

Original comment by arseny.k...@gmail.com on 6 Dec 2012 at 7:05

GoogleCodeExporter commented 9 years ago
This should now be fixed in trunk.

Original comment by arseny.k...@gmail.com on 7 Dec 2012 at 8:26