X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..eff869aad2585994c3a4b21b36cdf98245ab3f15:/include/wx/wxchar.h diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 83273ef07a..75396ac0b7 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -47,6 +47,7 @@ # define HAVE_WCSLEN 1 # include + # if wxUSE_UNICODE // temporary - preserve binary compatibility typedef _TCHAR wxChar; typedef _TSCHAR wxSChar; @@ -230,7 +231,7 @@ typedef __WCHAR_TYPE__ wxChar; typedef signed __WCHAR_TYPE__ wxSChar; typedef unsigned __WCHAR_TYPE__ wxUChar; -# define T(x) L##x +# define _T(x) L##x // ctype.h functions (wctype.h) # define wxIsalnum iswalnum @@ -300,9 +301,12 @@ typedef unsigned __WCHAR_TYPE__ wxUChar; # endif # ifdef __FreeBSD__ -# undef T +# undef _T +# endif + +# if !defined(__MINGW32__) || !defined(_T) +# define _T(x) x # endif -# define T(x) x // ctype.h functions # define wxIsalnum isalnum @@ -345,10 +349,13 @@ typedef unsigned __WCHAR_TYPE__ wxUChar; #if !defined(wxStricmp) && !wxUSE_UNICODE # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) # define wxStricmp stricmp +# define wxStrnicmp strnicmp # elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__)) # define wxStricmp _stricmp +# define wxStrnicmp _strnicmp # elif defined(__UNIX__) || defined(__GNUWIN32__) # define wxStricmp strcasecmp +# define wxStrnicmp strncasecmp # elif defined(__MWERKS__) && !defined(__INTEL__) // use wxWindows' implementation # else @@ -561,9 +568,14 @@ WXDLLEXPORT int wxSystem(const wxChar *psz); WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm); #endif +// although global macros with such names are really bad, we want to have +// another name for _T() which should be used to avoid confusion between _T() +// and _() in wxWindows sources +#define wxT(x) _T(x) + // a Unicode-friendly __FILE__ analog #ifndef __TFILE__ - #define __XFILE__(x) T(x) + #define __XFILE__(x) wxT(x) #define __TFILE__ __XFILE__(__FILE__) #endif