From 2ff7b588ae4eda9fc62401861bfdaefe510a8555 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 3 Jan 2014 01:18:47 +0000 Subject: [PATCH] Move UNICODE section of wx/platform.h before wx/compiler.h inclusion. This fixes the build with some versions of MinGW which depend on UNICODE being defined correctly in _mingw.h which is included from wx/compiler.h, so that before this change the build was broken as inconsistent definitions of UNICODE were used there and in windows.h included later. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/platform.h | 59 +++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/include/wx/platform.h b/include/wx/platform.h index 97c669f7a4..a919b9bba6 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -176,6 +176,38 @@ # include "wx/android/config_android.h" #endif + +/* + adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1 + and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by + the system headers so bring these settings in sync + + Notice that this must be done before wx/compiler.h inclusion as some + compiler-specific headers (_mingw.h) included from there depend on UNICODE + being defined correctly. + */ + +/* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */ +#if defined(_UNICODE) || defined(UNICODE) +# undef wxUSE_UNICODE +# define wxUSE_UNICODE 1 +#else /* !UNICODE */ +# ifndef wxUSE_UNICODE +# define wxUSE_UNICODE 0 +# endif +#endif /* UNICODE/!UNICODE */ + +/* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */ +#if wxUSE_UNICODE +# ifndef _UNICODE +# define _UNICODE +# endif +# ifndef UNICODE +# define UNICODE +# endif +#endif /* wxUSE_UNICODE */ + + #include "wx/compiler.h" /* @@ -226,33 +258,6 @@ #endif /* alpha */ -/* - adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1 - and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by - the system headers so bring these settings in sync - */ - -/* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */ -#if defined(_UNICODE) || defined(UNICODE) -# undef wxUSE_UNICODE -# define wxUSE_UNICODE 1 -#else /* !UNICODE */ -# ifndef wxUSE_UNICODE -# define wxUSE_UNICODE 0 -# endif -#endif /* UNICODE/!UNICODE */ - -/* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */ -#if wxUSE_UNICODE -# ifndef _UNICODE -# define _UNICODE -# endif -# ifndef UNICODE -# define UNICODE -# endif -#endif /* wxUSE_UNICODE */ - - /* test for old versions of Borland C, normally need at least 5.82, Turbo explorer, available for free at http://www.turboexplorer.com/downloads