From c7808714c9cc71cf5ec9671e8dbc386d994206af Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 8 Aug 2002 09:35:25 +0000 Subject: [PATCH] Applied patch [ 587454 ] CW-related wx/wxchar.h fix This fixes the problem in include/wx/wxchar.h with including for CW reported by Andreas Simanowski. The current version does not work with CW Win32 builds. The fix suggested by Andreas is incorrect, because it will break the wxMAC CW builds. The purpose of conditionals starting at line 77 is to correctly handle the various compilers. The fundamental problem with the existing code is that it begins by conditioning on __WIN32__. This is wrong, and makes it hard to handle compilers that work on more than one OS (such as CW). Instead the conditionals should be done purely on compilers. Each compiler can then set things appropriately. If a particular compiler works on more than one OS but has different needs on each OS, then this can be handled within the code for that compiler. The attached patch removes the top level conditional on __WIN32__ and restructures the remainder as a series of conditionals on individual compilers. Igor Mikolic-Torreira igormt@alumni.caltech.edu git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wxchar.h | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 68d1a6a1ba..eecb6b5a4e 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -57,24 +57,22 @@ // wide-character functions // ---------------------------------------------------------------------------- -#ifdef __WIN32__ - // VC++ and BC++ starting with 5.2 have TCHAR support - #ifdef __VISUALC__ - #define wxHAVE_TCHAR_FUNCTIONS - #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) - #define wxHAVE_TCHAR_FUNCTIONS - #elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) - #define wxHAVE_TCHAR_FUNCTIONS - #include - #include - #include - #elif defined(__CYGWIN__) - #ifndef HAVE_WCSLEN - #define HAVE_WCSLEN - #endif // !HAVE_WCSLEN - #include - #include - #endif +// VC++ and BC++ starting with 5.2 have TCHAR support +#ifdef __VISUALC__ + #define wxHAVE_TCHAR_FUNCTIONS +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) + #define wxHAVE_TCHAR_FUNCTIONS +#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) + #define wxHAVE_TCHAR_FUNCTIONS + #include + #include + #include +#elif defined(__CYGWIN__) + #ifndef HAVE_WCSLEN + #define HAVE_WCSLEN + #endif // !HAVE_WCSLEN + #include + #include #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400) // VisualAge 4.0+ supports TCHAR #define wxHAVE_TCHAR_FUNCTIONS -- 2.45.2