Applied patch [ 587454 ] CW-related wx/wxchar.h fix

This fixes the problem in include/wx/wxchar.h with
including <wchar.h> 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
This commit is contained in:
Julian Smart 2002-08-08 09:35:25 +00:00
parent 91b167ddeb
commit c7808714c9

View File

@ -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 <stddef.h>
#include <string.h>
#include <ctype.h>
#elif defined(__CYGWIN__)
#ifndef HAVE_WCSLEN
#define HAVE_WCSLEN
#endif // !HAVE_WCSLEN
#include <stddef.h>
#include <wchar.h>
#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 <stddef.h>
#include <string.h>
#include <ctype.h>
#elif defined(__CYGWIN__)
#ifndef HAVE_WCSLEN
#define HAVE_WCSLEN
#endif // !HAVE_WCSLEN
#include <stddef.h>
#include <wchar.h>
#elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
// VisualAge 4.0+ supports TCHAR
#define wxHAVE_TCHAR_FUNCTIONS