X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dccce9eae10e099d791cc055dd02d3dda731778e..a3f2769e09849b3da8bbae84e015610bf3069740:/src/common/strconv.cpp diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 33b934ef9f..dd2c71cab1 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -44,9 +44,6 @@ #ifdef HAVE_ICONV_H #include #endif -#ifdef HAVE_LANGINFO_H - #include -#endif #ifdef __WXMSW__ #include @@ -68,13 +65,22 @@ #define BSWAP_UTF32(str, len) BSWAP_UCS4(str, len) #define BSWAP_UTF16(str, len) BSWAP_UCS2(str, len) +// under Unix SIZEOF_WCHAR_T is defined by configure, but under other platforms +// it might be not defined - assume the most common value +#ifndef SIZEOF_WCHAR_T + #define SIZEOF_WCHAR_T 2 +#endif // !defined(SIZEOF_WCHAR_T) + #if SIZEOF_WCHAR_T == 4 -#define WC_NAME "UCS4" -#define WC_BSWAP BSWAP_UCS4 + #define WC_NAME "UCS4" + #define WC_BSWAP BSWAP_UCS4 #elif SIZEOF_WCHAR_T == 2 -#define WC_NAME "UTF16" -#define WC_BSWAP BSWAP_UTF16 -#define WC_UTF16 + #define WC_NAME "UTF16" + #define WC_BSWAP BSWAP_UTF16 + #define WC_UTF16 +#else // sizeof(wchar_t) != 2 nor 4 + // I don't know what to do about this + #error "Weird sizeof(wchar_t): please report your platform details to wx-users mailing list" #endif // ---------------------------------------------------------------------------- @@ -727,6 +733,8 @@ wxCSConv::wxCSConv(const wxChar *charset) { m_name = (wxChar *)NULL; m_cset = (wxCharacterSet *) NULL; + m_deferred = TRUE; + SetName(charset); }