From 302fa5ca5f30252095289ca73ed8f7d8b7cfe08f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 May 2014 13:14:17 +0000 Subject: [PATCH] Define __WIN64__ for 64 bit wxMSW builds with gcc too. Previously __WIN64__ was only defined for 64 bit builds with MSVC, which resulted in many problems when using 64 bit Cygwin compiler. Also don't use MSVC-specific __int64 but our wxInt64 for WX{L,W}PARAM and WXLRESULT definitions in 64 bit builds. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 6 +++--- include/wx/platform.h | 24 +++++++++--------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index b3f79f8759..89bd409f3d 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -3250,9 +3250,9 @@ typedef WXHWND WXWidget; #endif #ifdef __WIN64__ -typedef unsigned __int64 WXWPARAM; -typedef __int64 WXLPARAM; -typedef __int64 WXLRESULT; +typedef wxUint64 WXWPARAM; +typedef wxInt64 WXLPARAM; +typedef wxInt64 WXLRESULT; #else typedef wxW64 unsigned int WXWPARAM; typedef wxW64 long WXLPARAM; diff --git a/include/wx/platform.h b/include/wx/platform.h index 22fe9d9983..d1c18f320d 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -57,21 +57,6 @@ # endif /* !__WINDOWS__ */ #endif /* Any standard symbol indicating Windows */ -#if defined(_WIN64) -# ifndef _WIN32 - /* - a lot of code (mistakenly) uses #ifdef _WIN32 to either test for - Windows or to test for !__WIN16__, so we must define _WIN32 for - Win64 as well to ensure that the existing code continues to work. - */ -# define _WIN32 -# endif /* !_WIN32 */ - -# ifndef __WIN64__ -# define __WIN64__ -# endif /* !__WIN64__ */ -#endif /* _WIN64 */ - #if defined(__WINDOWS__) /* Select wxMSW under Windows if no other port is specified. */ # if !defined(__WXMSW__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) @@ -93,6 +78,15 @@ # ifndef __WIN32__ # define __WIN32__ # endif + + /* MSVC predefines _WIN64 for 64 bit builds, for gcc we use generic + architecture definitions. */ +# if defined(_WIN64) || defined(__x86_64__) +# ifndef __WIN64__ +# define __WIN64__ +# endif /* !__WIN64__ */ +# endif /* _WIN64 */ + #endif /* __WINDOWS__ */ /*