From 406608b31cb193bcf46a98e1eaed31e45322628d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Sep 2017 22:38:23 +0200 Subject: [PATCH] Remove obsolete wxCHECK_W32API_VERSION() checks The latest of those checks tested for w32 API 3.3, which is older than MinGW 3.4 released which is more than 13 years old, so we can safely drop them (let alone checks for prehistoric 0.5 w32 API). This incidentally fixes compilation errors due to the use of wxCHECK_W32API_VERSION() in wx/msw/winundef.h which was now (since the changes of 8c572c0a771cc46e9c98f10ae08bb83e9ed58acd) included before this macro was defined. --- include/wx/chartype.h | 2 +- include/wx/filefn.h | 3 +-- include/wx/msw/gccpriv.h | 40 --------------------------------------- include/wx/msw/missing.h | 21 -------------------- include/wx/msw/winundef.h | 9 --------- src/common/filename.cpp | 5 ----- src/msw/dialup.cpp | 1 - src/msw/listctrl.cpp | 2 -- 8 files changed, 2 insertions(+), 81 deletions(-) diff --git a/include/wx/chartype.h b/include/wx/chartype.h index 3ff445f602..cc65a8b3a8 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -108,7 +108,7 @@ #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) #define wxHAVE_TCHAR_SUPPORT #include -#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) +#elif defined(__MINGW32__) #define wxHAVE_TCHAR_SUPPORT #include #include diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 3eafe3e781..c75d309e36 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -127,8 +127,7 @@ enum wxPosixPermissions ( \ defined(__VISUALC__) || \ defined(__MINGW64_TOOLCHAIN__) || \ - (defined(__MINGW32__) && !defined(__WINE__) && \ - wxCHECK_W32API_VERSION(0, 5)) || \ + (defined(__MINGW32__) && !defined(__WINE__)) || \ defined(__BORLANDC__) \ ) diff --git a/include/wx/msw/gccpriv.h b/include/wx/msw/gccpriv.h index 319b98746b..d0b47e4183 100644 --- a/include/wx/msw/gccpriv.h +++ b/include/wx/msw/gccpriv.h @@ -100,46 +100,6 @@ #define __CYGWIN10__ #endif -/* Mingw runtime 1.0-20010604 has some missing _tXXXX functions, - so let's define them ourselves: */ -#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ - && !wxCHECK_W32API_VERSION( 1, 1 ) - #ifndef _tsetlocale - #if wxUSE_UNICODE - #define _tsetlocale _wsetlocale - #else - #define _tsetlocale setlocale - #endif - #endif - #ifndef _tgetenv - #if wxUSE_UNICODE - #define _tgetenv _wgetenv - #else - #define _tgetenv getenv - #endif - #endif - #ifndef _tfopen - #if wxUSE_UNICODE - #define _tfopen _wfopen - #else - #define _tfopen fopen - #endif - #endif -#endif - -/* current (= before mingw-runtime 3.3) mingw32 headers forget to - define _puttchar, this will probably be fixed in the next versions but - for now do it ourselves - */ -#if defined( __MINGW32__ ) && \ - !wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar ) - #ifdef wxUSE_UNICODE - #define _puttchar putwchar - #else - #define _puttchar puttchar - #endif -#endif - /* Traditional MinGW (but not MinGW-w64 nor TDM-GCC) omits many POSIX functions from their headers when compiled with __STRICT_ANSI__ defined. diff --git a/include/wx/msw/missing.h b/include/wx/msw/missing.h index f289deab16..1b09f730e9 100644 --- a/include/wx/msw/missing.h +++ b/include/wx/msw/missing.h @@ -246,27 +246,6 @@ #ifndef TVM_SETBKCOLOR #define TVM_SETBKCOLOR (TV_FIRST + 29) #define TVM_SETTEXTCOLOR (TV_FIRST + 30) -#endif - - /* - * The following are specifically required for MinGW. - */ - -#if defined (__MINGW32__) - -#if !wxCHECK_W32API_VERSION(3,1) - -#include -#include "wx/msw/winundef.h" - -typedef struct -{ - RECT rgrc[3]; - WINDOWPOS *lppos; -} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS; - -#endif - #endif // Various defines used by the webview library that are needed by mingw diff --git a/include/wx/msw/winundef.h b/include/wx/msw/winundef.h index 8d86f0cc7a..b363e7e94e 100644 --- a/include/wx/msw/winundef.h +++ b/include/wx/msw/winundef.h @@ -252,15 +252,6 @@ #ifdef StartDoc #undef StartDoc - // Work around a bug in very old MinGW headers that didn't define DOCINFOW - // and DOCINFOA but only DOCINFO in both ANSI and Unicode. - #if defined( __GNUG__ ) - #if !wxCHECK_W32API_VERSION( 0, 5 ) - #define DOCINFOW DOCINFO - #define DOCINFOA DOCINFO - #endif - #endif - #ifdef _UNICODE inline int StartDoc(HDC h, CONST DOCINFOW* info) { diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 7eda5ae42c..a733643d71 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -1650,12 +1650,7 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, if (SUCCEEDED(hres)) { wxChar buf[2048]; - // Wrong prototype in early versions -#if defined(__MINGW32__) && !wxCHECK_W32API_VERSION(2, 2) - psl->GetPath((CHAR*) buf, 2048, NULL, SLGP_UNCPRIORITY); -#else psl->GetPath(buf, 2048, NULL, SLGP_UNCPRIORITY); -#endif targetFilename = wxString(buf); success = (shortcutPath != targetFilename); diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 5ff78e7c7e..c38af22209 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -49,7 +49,6 @@ wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ); // Doesn't yet compile under BC++ // Wine: no wininet.h #if (!defined(__BORLANDC__) || (__BORLANDC__>=0x550)) && \ - (!defined(__GNUWIN32__) || wxCHECK_W32API_VERSION(0, 5)) && \ !defined(__WINE__) #include diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index ad7db78eba..ba30bd6e05 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -393,12 +393,10 @@ WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const else if ( style & wxLC_SORT_DESCENDING ) wstyle |= LVS_SORTDESCENDING; -#if !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) ) if ( style & wxLC_VIRTUAL ) { wstyle |= LVS_OWNERDATA; } -#endif // ancient cygwin return wstyle; }