X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..1f0acb435592470b421b80df854fbbb08cd2853f:/include/wx/chartype.h diff --git a/include/wx/chartype.h b/include/wx/chartype.h index a284e4de8c..3c3944a360 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -1,7 +1,7 @@ /* * Name: wx/chartype.h * Purpose: Declarations of wxChar and related types - * Author: Joel Farley, Ove Kåven + * Author: Joel Farley, Ove KÃ¥ven * Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee * Created: 1998/06/12 * RCS-ID: $Id$ @@ -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,11 +238,24 @@ #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) */ +/* + wxT_2 exists only for compatibility with wx 2.x and is the same as wxT() in + that version but nothing in the newer ones. + */ +#define wxT_2(x) x + /* wxS ("wx string") macro can be used to create literals using the same representation as wxString does internally, i.e. wchar_t in Unicode build @@ -252,7 +263,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