From 2d37ca3cb0c5877f9a34173580958d17e1818c96 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 Sep 2014 16:02:01 +0000 Subject: [PATCH] Move __MINGW64_TOOLCHAIN__ definition to wx/msw/gccpriv.h. __MINGW64_VERSION_MAJOR is defined only in _mingw.h, so it was never defined in wx/compiler.h, included before any other headers and we can't include _mingw.h for the same reason we must define wxCHECK_MINGW32_VERSION() in wx/msw/gccpriv.h: this has to be done after defining UNICODE/_UNICODE, but wx/compiler.h is included before this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/compiler.h | 32 ++------------------------------ include/wx/msw/gccpriv.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/include/wx/compiler.h b/include/wx/compiler.h index 655c3be740..4d334d74d9 100644 --- a/include/wx/compiler.h +++ b/include/wx/compiler.h @@ -106,36 +106,8 @@ #endif /* - This macro can be used to check that the version of mingw32 CRT is at least - maj.min + wxCHECK_MINGW32_VERSION() is defined in wx/msw/gccpriv.h which is included + later, see comments there. */ -/* - Define Mingw identification symbols, wxCHECK_MINGW32_VERSION() is defined in - wx/msw/gccpriv.h which is included later, see comments there. - */ -#ifdef __MINGW32__ -/* - MinGW-w64 project provides compilers for both Win32 and Win64 but only - defines the same __MINGW32__ symbol for the former as MinGW32 toolchain - which is quite different (notably doesn't provide many SDK headers that - MinGW-w64 does include). So we define a separate symbol which, unlike the - predefined __MINGW64__, can be used to detect this toolchain in both 32 and - 64 bit builds. - - And define __MINGW32_TOOLCHAIN__ for consistency and also because it's - convenient as we often want to have some workarounds only for the (old) - MinGW32 but not (newer) MinGW-w64, which still predefines __MINGW32__. - */ -# ifdef __MINGW64_VERSION_MAJOR -# ifndef __MINGW64_TOOLCHAIN__ -# define __MINGW64_TOOLCHAIN__ -# endif -# else -# ifndef __MINGW32_TOOLCHAIN__ -# define __MINGW32_TOOLCHAIN__ -# endif -# endif -#endif - #endif // _WX_COMPILER_H_ diff --git a/include/wx/msw/gccpriv.h b/include/wx/msw/gccpriv.h index 265c9048d5..4f1bc4f299 100644 --- a/include/wx/msw/gccpriv.h +++ b/include/wx/msw/gccpriv.h @@ -35,6 +35,28 @@ #include <_mingw.h> + /* + MinGW-w64 project provides compilers for both Win32 and Win64 but only + defines the same __MINGW32__ symbol for the former as MinGW32 toolchain + which is quite different (notably doesn't provide many SDK headers that + MinGW-w64 does include). So we define a separate symbol which, unlike + the predefined __MINGW64__, can be used to detect this toolchain in + both 32 and 64 bit builds. + + And define __MINGW32_TOOLCHAIN__ for consistency and also because it's + convenient as we often want to have some workarounds only for the (old) + MinGW32 but not (newer) MinGW-w64, which still predefines __MINGW32__. + */ + #ifdef __MINGW64_VERSION_MAJOR + #ifndef __MINGW64_TOOLCHAIN__ + #define __MINGW64_TOOLCHAIN__ + #endif + #else + #ifndef __MINGW32_TOOLCHAIN__ + #define __MINGW32_TOOLCHAIN__ + #endif + #endif + #define wxCHECK_MINGW32_VERSION( major, minor ) \ ( ( ( __MINGW32_MAJOR_VERSION > (major) ) \ || ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) )