X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9670814f59ff30146eb4ea694a78a88bed014ae..58ce18f2fdadecffb21e27555115af708325cf18:/include/wx/chartype.h diff --git a/include/wx/chartype.h b/include/wx/chartype.h index 480d1b1e2d..c0658eaf97 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -59,37 +59,35 @@ #endif #endif -#if wxUSE_WCHAR_T - #ifdef HAVE_WCHAR_H - /* the current (as of Nov 2002) version of cygwin has a bug in its */ - /* wchar.h -- there is no extern "C" around the declarations in it */ - /* and this results in linking errors later; also, at least on some */ - /* Cygwin versions, wchar.h requires sys/types.h */ - #ifdef __CYGWIN__ - #include - #ifdef __cplusplus - extern "C" { - #endif - #endif /* Cygwin */ - - #include - - #if defined(__CYGWIN__) && defined(__cplusplus) - } - #endif /* Cygwin and C++ */ - - #elif defined(HAVE_WCSTR_H) - /* old compilers have relevant declarations here */ - #include - #elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__) - /* include stdlib.h for wchar_t */ - #include - #endif /* HAVE_WCHAR_H */ - - #ifdef HAVE_WIDEC_H - #include - #endif -#endif /* wxUSE_WCHAR_T */ +#ifdef HAVE_WCHAR_H + /* the current (as of Nov 2002) version of cygwin has a bug in its */ + /* wchar.h -- there is no extern "C" around the declarations in it */ + /* and this results in linking errors later; also, at least on some */ + /* Cygwin versions, wchar.h requires sys/types.h */ + #ifdef __CYGWIN__ + #include + #ifdef __cplusplus + extern "C" { + #endif + #endif /* Cygwin */ + + #include + + #if defined(__CYGWIN__) && defined(__cplusplus) + } + #endif /* Cygwin and C++ */ + +#elif defined(HAVE_WCSTR_H) + /* old compilers have relevant declarations here */ + #include +#elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__) + /* include stdlib.h for wchar_t */ + #include +#endif /* HAVE_WCHAR_H */ + +#ifdef HAVE_WIDEC_H + #include +#endif /* -------------------------------------------------------------------------- */ /* define wxHAVE_TCHAR_SUPPORT for the compilers which support the TCHAR type */ @@ -240,8 +238,15 @@ #if !wxUSE_UNICODE #define wxT(x) x #else /* Unicode */ - /* use wxCONCAT_HELPER so that x could be expanded if it's a macro */ - #define wxT(x) wxCONCAT_HELPER(L, x) + /* + Notice that we use an intermediate macro to allow x to be expanded + if it's a macro itself. + */ + #ifndef wxCOMPILER_BROKEN_CONCAT_OPER + #define wxT(x) wxCONCAT_HELPER(L, x) + #else + #define wxT(x) wxPREPEND_L(x) + #endif #endif /* ASCII/Unicode */ #endif /* !defined(wxT) */ @@ -252,7 +257,14 @@ builds everywhere (see wxStringCharType definition above). */ #if wxUSE_UNICODE_WCHAR - #define wxS(x) wxCONCAT_HELPER(L, x) + /* + As above with wxT(), wxS() argument is expanded if it's a macro. + */ + #ifndef wxCOMPILER_BROKEN_CONCAT_OPER + #define wxS(x) wxCONCAT_HELPER(L, x) + #else + #define wxS(x) wxPREPEND_L(x) + #endif #else /* wxUSE_UNICODE_UTF8 || ANSI */ #define wxS(x) x #endif