]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/strconv.cpp
wxDbGrid additions contributed by Paul and Roger Gammans with additions/corrections...
[wxWidgets.git] / src / common / strconv.cpp
index b8982301a6a50b40fe6c0972870e63eba3bd20b1..dd2c71cab1ddb4156c6d56f59795aeb73759635e 100644 (file)
 #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
 
 // ----------------------------------------------------------------------------