Author: rleigh Date: Tue Jan 30 20:01:02 2018 New Revision: 1822689 URL: http://svn.apache.org/viewvc?rev=1822689&view=rev Log: Remove the XERCES_USE_CHAR16_T define
Does not work when XMLCh == uint16_t, so always use reinterpret_cast to wchar_t. Modified: xerces/c/trunk/config.h.cmake.in xerces/c/trunk/configure.ac xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp Modified: xerces/c/trunk/config.h.cmake.in URL: http://svn.apache.org/viewvc/xerces/c/trunk/config.h.cmake.in?rev=1822689&r1=1822688&r2=1822689&view=diff ============================================================================== --- xerces/c/trunk/config.h.cmake.in (original) +++ xerces/c/trunk/config.h.cmake.in Tue Jan 30 20:01:02 2018 @@ -481,9 +481,6 @@ /* Define to use the Windows transcoder */ #cmakedefine XERCES_USE_TRANSCODER_WINDOWS 1 -/* Define to use the Windows transcode */ -#cmakedefine XERCES_USE_CHAR16_T 1 - /* Define to the 16 bit type used to represent Xerces UTF-16 characters */ #define XERCES_XMLCH_T @XERCES_XMLCH_T@ Modified: xerces/c/trunk/configure.ac URL: http://svn.apache.org/viewvc/xerces/c/trunk/configure.ac?rev=1822689&r1=1822688&r2=1822689&view=diff ============================================================================== --- xerces/c/trunk/configure.ac (original) +++ xerces/c/trunk/configure.ac Tue Jan 30 20:01:02 2018 @@ -337,7 +337,6 @@ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[] [[const char16_t *unicode = u"Test ünÃcodè â ©";]])], [ xerces_cv_type_xmlch=char16_t - AC_DEFINE_UNQUOTED([XERCES_USE_CHAR16_T], [1], [Define if the C++11 char16_t type is to be used]) AC_MSG_RESULT([yes]) ], [ Modified: xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp?rev=1822689&r1=1822688&r2=1822689&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp (original) +++ xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp Tue Jan 30 20:01:02 2018 @@ -173,11 +173,7 @@ bool Win32MsgLoader::loadMsg(const XMLM const XMLSize_t actualChars = ((maxChars < (XMLSize_t)*pBlock) ? maxChars : (XMLSize_t)*pBlock); // Ok, finally now copy as much as we can into the caller's buffer -#if defined(XERCES_USE_CHAR16_T) wcsncpy(reinterpret_cast<wchar_t *>(toFill), reinterpret_cast<const wchar_t *>(pBlock + 1), actualChars); -#else - wcsncpy(toFill, pBlock + 1, actualChars); -#endif toFill[actualChars] = 0; return true; Modified: xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp?rev=1822689&r1=1822688&r2=1822689&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp (original) +++ xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp Tue Jan 30 20:01:02 2018 @@ -135,38 +135,22 @@ int _wcsicmp(LPCWSTR comp1, LPCWSTR comp static inline void xmlch_wcsupr(XMLCh* str) { -#ifdef XERCES_USE_CHAR16_T _wcsupr(reinterpret_cast<LPWSTR>(str)); -#else - _wcsupr(str); -#endif } static inline int xmlch_wcsicmp(const XMLCh* comp1, const XMLCh* comp2) { -#ifdef XERCES_USE_CHAR16_T return _wcsicmp(reinterpret_cast<LPCWSTR>(comp1), reinterpret_cast<LPCWSTR>(comp2)); -#else - return _wcsicmp(comp1, comp2); -#endif } static inline int xmlch_wcsnicmp(const XMLCh* comp1, const XMLCh* comp2, const XMLSize_t maxChars) { -#ifdef XERCES_USE_CHAR16_T return _wcsnicmp(reinterpret_cast<LPCWSTR>(comp1), reinterpret_cast<LPCWSTR>(comp2), maxChars); -#else - return _wcsnicmp(comp1, comp2, maxChars); -#endif } static inline void xmlch_wcslwr(XMLCh* str) { -#ifdef XERCES_USE_CHAR16_T _wcslwr(reinterpret_cast<LPWSTR>(str)); -#else - _wcslwr(str); -#endif } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org