From a3f2769e09849b3da8bbae84e015610bf3069740 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jun 2001 17:00:32 +0000 Subject: [PATCH] compilation fix for SIZEOF_WCHAR_T being undefined git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index c129faee32..dd2c71cab1 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -65,16 +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 "Please report your platform details to wx-users mailing list" + // 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 // ----------------------------------------------------------------------------