From a7df23d43c4f5c321e1ccd5b59ca260c547e3d03 Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 19 Oct 2020 19:38:53 +0200 Subject: [PATCH 1/4] Remove checks for outdated GCC versions wxWidgets now supports only GCC 4 and newer, so there is no reason to keep code specific for older GCC versions. --- include/wx/cpp.h | 14 -------------- include/wx/msw/gccpriv.h | 4 +--- include/wx/platform.h | 4 ---- include/wx/testing.h | 5 ----- tests/archive/archivetest.cpp | 3 +-- tests/testprec.h | 3 +-- 6 files changed, 3 insertions(+), 30 deletions(-) diff --git a/include/wx/cpp.h b/include/wx/cpp.h index 60bcd92a7e..2f2b277647 100644 --- a/include/wx/cpp.h +++ b/include/wx/cpp.h @@ -140,20 +140,6 @@ #ifdef HAVE_VARIADIC_MACROS -/* - This is a hack to make it possible to use variadic macros with g++ 3.x even - when using -pedantic[-errors] option: without this, it would complain that - - "anonymous variadic macros were introduced in C99" - - and the option disabling this warning (-Wno-variadic-macros) is only - available in gcc 4.0 and later, so until then this hack is the only thing we - can do. - */ -#if defined(__GNUC__) && __GNUC__ == 3 - #pragma GCC system_header -#endif /* gcc-3.x */ - /* wxCALL_FOR_EACH(what, ...) calls the macro from its first argument, what(pos, x), for every remaining argument 'x', with 'pos' being its 1-based index in diff --git a/include/wx/msw/gccpriv.h b/include/wx/msw/gccpriv.h index d0b47e4183..b90ee223d8 100644 --- a/include/wx/msw/gccpriv.h +++ b/include/wx/msw/gccpriv.h @@ -77,9 +77,7 @@ #define HAVE_W32API_H #endif #elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H ) - #if ( __GNUC__ > 2 ) - #define HAVE_W32API_H - #endif + #define HAVE_W32API_H #endif /* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */ diff --git a/include/wx/platform.h b/include/wx/platform.h index eee73324ef..34968a0306 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -332,10 +332,6 @@ # include "wx/msw/libraries.h" #endif -#if (defined(__GNUC__) && __GNUC__ < 3) -#define wxNEEDS_CHARPP -#endif - /* Note that wx/msw/gccpriv.h must be included after defining UNICODE and _UNICODE macros as it includes _mingw.h which relies on them being set. diff --git a/include/wx/testing.h b/include/wx/testing.h index f97ed66793..317040130b 100644 --- a/include/wx/testing.h +++ b/include/wx/testing.h @@ -503,11 +503,6 @@ private: */ #ifdef HAVE_VARIADIC_MACROS -// See wx/cpp.h for the explanations of this hack. -#if defined(__GNUC__) && __GNUC__ == 3 - #pragma GCC system_header -#endif /* gcc-3.x */ - #define wxTEST_DIALOG(codeToRun, ...) \ { \ wxTEST_DIALOG_HOOK_CLASS wx_hook(__FILE__, __LINE__, __WXFUNCTION__); \ diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index 50dfec53c3..3da66cb0ae 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -26,8 +26,7 @@ using std::string; // Check whether member templates can be used // -#if defined __GNUC__ && \ - (__GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +#if defined __GNUC__ # define WXARC_MEMBER_TEMPLATES #endif #if defined _MSC_VER && _MSC_VER >= 1310 && !defined __WIN64__ diff --git a/tests/testprec.h b/tests/testprec.h index 57dfe5d17e..4467b7ee36 100644 --- a/tests/testprec.h +++ b/tests/testprec.h @@ -24,8 +24,7 @@ #endif // define wxHAVE_U_ESCAPE if the compiler supports \uxxxx character constants -#if defined(__VISUALC__) || \ - (defined(__GNUC__) && (__GNUC__ >= 3)) +#if defined(__VISUALC__) || defined(__GNUC__) #define wxHAVE_U_ESCAPE // and disable warning that using them results in with MSVC 8+ From 6fbacb20d805b5d0f1e0d3bcd16b0eb318a4c005 Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 19 Oct 2020 20:07:16 +0200 Subject: [PATCH 2/4] Remove checks for wxNEEDS_CHARPP wxNEEDS_CHARPP was needed only for now unsupported GCC versions. --- include/wx/generic/icon.h | 3 --- include/wx/gtk/bitmap.h | 5 ----- include/wx/gtk1/bitmap.h | 7 ------- include/wx/motif/icon.h | 3 --- include/wx/msw/bitmap.h | 6 ------ include/wx/msw/icon.h | 3 --- include/wx/x11/bitmap.h | 7 ------- src/generic/icon.cpp | 7 ------- src/motif/icon.cpp | 8 -------- 9 files changed, 49 deletions(-) diff --git a/include/wx/generic/icon.h b/include/wx/generic/icon.h index 0b98032a73..df215e21f7 100644 --- a/include/wx/generic/icon.h +++ b/include/wx/generic/icon.h @@ -23,9 +23,6 @@ public: wxIcon(); wxIcon(const char* const* bits); -#ifdef wxNEEDS_CHARPP - wxIcon(char **bits); -#endif // For compatibility with wxMSW where desired size is sometimes required to // distinguish between multiple icons in a resource. diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 3d1f249e46..2f17a24e5c 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -72,11 +72,6 @@ public: { Create(sz, depth); } wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char* const* bits ); -#ifdef wxNEEDS_CHARPP - // needed for old GCC - wxBitmap(char** data) - { *this = wxBitmap(const_cast(data)); } -#endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); #if wxUSE_IMAGE wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0); diff --git a/include/wx/gtk1/bitmap.h b/include/wx/gtk1/bitmap.h index 49fe05908c..176792f189 100644 --- a/include/wx/gtk1/bitmap.h +++ b/include/wx/gtk1/bitmap.h @@ -70,13 +70,6 @@ public: wxBitmap( const wxSize& sz, int depth = -1 ) { Create( sz, depth ); } wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char* const* bits ); -#ifdef wxNEEDS_CHARPP - // needed for old GCC - wxBitmap(char** data) - { - *this = wxBitmap(const_cast(data)); - } -#endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); wxBitmap( const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0 ) { (void)CreateFromImage(image, depth); } virtual ~wxBitmap(); diff --git a/include/wx/motif/icon.h b/include/wx/motif/icon.h index f09b9c8a8f..898da902a4 100644 --- a/include/wx/motif/icon.h +++ b/include/wx/motif/icon.h @@ -24,9 +24,6 @@ public: // Initialize with XPM data wxIcon(const char* const* data); -#ifdef wxNEEDS_CHARPP - wxIcon(char **data); -#endif wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE, int desiredWidth = -1, int desiredHeight = -1) diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 61707d8866..4d661ff13c 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -55,12 +55,6 @@ public: // Initialize with XPM data wxBitmap(const char* const* data); -#ifdef wxNEEDS_CHARPP - wxBitmap(char** data) - { - *this = wxBitmap(const_cast(data)); - } -#endif // Load a file or resource wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); diff --git a/include/wx/msw/icon.h b/include/wx/msw/icon.h index 60c698ed36..2c89f2597a 100644 --- a/include/wx/msw/icon.h +++ b/include/wx/msw/icon.h @@ -48,9 +48,6 @@ public: // from XPM data wxIcon(const char* const* data) { CreateIconFromXpm(data); } -#ifdef wxNEEDS_CHARPP - wxIcon(char **data) { CreateIconFromXpm(const_cast(data)); } -#endif // from resource/file wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE, diff --git a/include/wx/x11/bitmap.h b/include/wx/x11/bitmap.h index 4e7c418b7c..25808e4e80 100644 --- a/include/wx/x11/bitmap.h +++ b/include/wx/x11/bitmap.h @@ -72,13 +72,6 @@ public: wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char* const* bits ); -#ifdef wxNEEDS_CHARPP - // needed for old GCC - wxBitmap(char** data) - { - *this = wxBitmap(const_cast(data)); - } -#endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); virtual ~wxBitmap(); diff --git a/src/generic/icon.cpp b/src/generic/icon.cpp index 1bec907106..2155b34740 100644 --- a/src/generic/icon.cpp +++ b/src/generic/icon.cpp @@ -25,13 +25,6 @@ wxIcon::wxIcon(const char* const* bits) : { } -#ifdef wxNEEDS_CHARPP -wxIcon::wxIcon(char **bits) : - wxBitmap( bits ) -{ -} -#endif - wxIcon::wxIcon() : wxBitmap() { } diff --git a/src/motif/icon.cpp b/src/motif/icon.cpp index fb642c5c58..3c19525811 100644 --- a/src/motif/icon.cpp +++ b/src/motif/icon.cpp @@ -29,14 +29,6 @@ wxIcon::wxIcon(const char bits[], int width, int height) (void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, 1); } -#ifdef wxNEEDS_CHARPP -// Create from XPM data -wxIcon::wxIcon(char **data) -{ - (void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); -} -#endif - wxIcon::wxIcon(const char* const* data) { (void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); From 426a0ed527af6e8e6f16cf598794e9d0a8ddf4a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Oct 2020 01:47:47 +0200 Subject: [PATCH 3/4] Remove HAVE_W32API_H definition and checks All still supported versions of MinGW/Cygwin provide w32api.h file, so there is no need to test for it. This allows to simplify the code, but also remove the definition of HAVE_W32API_H from bake- and makefiles and this, in turn, allows to get rid of extra flags in MinGW format entirely, as we don't support gcc 2.95 for which they were originally needed neither. --- build/bakefiles/config.bkl | 13 - .../bakefiles/wxpresets/presets/wx_win32.bkl | 1 - build/cmake/setup.cmake | 1 - build/cmake/setup.h.in | 3 - build/msw/config.gcc | 5 - build/msw/makefile.gcc | 329 +++++++++--------- build/msw/makefile.vc | 4 +- configure | 39 ++- configure.in | 1 - demos/bombs/makefile.gcc | 15 +- demos/forty/makefile.gcc | 15 +- demos/fractal/makefile.gcc | 15 +- demos/life/makefile.gcc | 11 +- demos/makefile.gcc | 3 +- demos/poem/makefile.gcc | 15 +- include/wx/msw/gccpriv.h | 10 - samples/access/makefile.gcc | 15 +- samples/animate/makefile.gcc | 15 +- samples/archive/makefile.gcc | 15 +- samples/artprov/makefile.gcc | 15 +- samples/aui/makefile.gcc | 15 +- samples/calendar/makefile.gcc | 15 +- samples/caret/makefile.gcc | 15 +- samples/clipboard/makefile.gcc | 15 +- samples/collpane/makefile.gcc | 15 +- samples/combo/makefile.gcc | 15 +- samples/config/makefile.gcc | 15 +- samples/console/makefile.gcc | 15 +- samples/dataview/makefile.gcc | 15 +- samples/debugrpt/makefile.gcc | 15 +- samples/dialogs/makefile.gcc | 15 +- samples/dialup/makefile.gcc | 15 +- samples/display/makefile.gcc | 15 +- samples/dll/makefile.gcc | 22 +- samples/dnd/makefile.gcc | 11 +- samples/docview/makefile.gcc | 15 +- samples/dragimag/makefile.gcc | 15 +- samples/drawing/makefile.gcc | 15 +- samples/erase/makefile.gcc | 15 +- samples/event/makefile.gcc | 15 +- samples/except/makefile.gcc | 15 +- samples/exec/makefile.gcc | 11 +- samples/font/makefile.gcc | 11 +- samples/fswatcher/makefile.gcc | 15 +- samples/grid/makefile.gcc | 11 +- samples/help/makefile.gcc | 11 +- samples/htlbox/makefile.gcc | 15 +- samples/html/about/makefile.gcc | 15 +- samples/html/help/makefile.gcc | 15 +- samples/html/helpview/makefile.gcc | 15 +- samples/html/makefile.gcc | 3 +- samples/html/printing/makefile.gcc | 15 +- samples/html/test/makefile.gcc | 17 +- samples/html/virtual/makefile.gcc | 15 +- samples/html/widget/makefile.gcc | 15 +- samples/html/zip/makefile.gcc | 17 +- samples/image/makefile.gcc | 15 +- samples/internat/makefile.gcc | 15 +- samples/ipc/makefile.gcc | 51 ++- samples/joytest/makefile.gcc | 15 +- samples/keyboard/makefile.gcc | 15 +- samples/layout/makefile.gcc | 15 +- samples/listctrl/makefile.gcc | 15 +- samples/makefile.gcc | 3 +- samples/mdi/makefile.gcc | 11 +- samples/mediaplayer/makefile.gcc | 15 +- samples/memcheck/makefile.gcc | 15 +- samples/menu/makefile.gcc | 11 +- samples/minimal/makefile.gcc | 15 +- samples/nativdlg/makefile.gcc | 15 +- samples/notebook/makefile.gcc | 15 +- samples/oleauto/makefile.gcc | 15 +- samples/opengl/cube/makefile.gcc | 17 +- samples/opengl/isosurf/makefile.gcc | 15 +- samples/opengl/makefile.gcc | 3 +- samples/opengl/penguin/makefile.gcc | 25 +- samples/opengl/pyramid/makefile.gcc | 15 +- samples/ownerdrw/makefile.gcc | 15 +- samples/popup/makefile.gcc | 15 +- samples/power/makefile.gcc | 15 +- samples/preferences/makefile.gcc | 15 +- samples/printing/makefile.gcc | 15 +- samples/propgrid/makefile.gcc | 15 +- samples/regtest/makefile.gcc | 15 +- samples/render/makefile.gcc | 22 +- samples/ribbon/makefile.gcc | 15 +- samples/richtext/makefile.gcc | 15 +- samples/sashtest/makefile.gcc | 15 +- samples/scroll/makefile.gcc | 15 +- samples/secretstore/makefile.gcc | 15 +- samples/shaped/makefile.gcc | 15 +- samples/sockets/makefile.gcc | 43 ++- samples/sound/makefile.gcc | 15 +- samples/splash/makefile.gcc | 15 +- samples/splitter/makefile.gcc | 15 +- samples/statbar/makefile.gcc | 15 +- samples/stc/makefile.gcc | 15 +- samples/svg/makefile.gcc | 15 +- samples/taborder/makefile.gcc | 15 +- samples/taskbar/makefile.gcc | 15 +- samples/taskbarbutton/makefile.gcc | 15 +- samples/text/makefile.gcc | 11 +- samples/thread/makefile.gcc | 15 +- samples/toolbar/makefile.gcc | 15 +- samples/treectrl/makefile.gcc | 15 +- samples/treelist/makefile.gcc | 15 +- samples/typetest/makefile.gcc | 15 +- samples/uiaction/makefile.gcc | 15 +- samples/validate/makefile.gcc | 15 +- samples/vscroll/makefile.gcc | 15 +- samples/webview/makefile.gcc | 15 +- samples/widgets/makefile.gcc | 15 +- samples/wizard/makefile.gcc | 15 +- samples/wrapsizer/makefile.gcc | 15 +- samples/xrc/makefile.gcc | 15 +- samples/xti/makefile.gcc | 11 +- setup.h.in | 3 - setup.h_vms | 3 - tests/benchmarks/makefile.gcc | 35 +- tests/makefile.gcc | 56 ++- utils/emulator/src/makefile.gcc | 15 +- utils/execmon/makefile.gcc | 15 +- utils/helpview/src/makefile.gcc | 15 +- utils/hhp2cached/makefile.gcc | 15 +- utils/ifacecheck/src/makefile.gcc | 15 +- utils/makefile.gcc | 3 +- utils/screenshotgen/src/makefile.gcc | 15 +- utils/wxrc/makefile.gcc | 11 +- 128 files changed, 901 insertions(+), 1302 deletions(-) diff --git a/build/bakefiles/config.bkl b/build/bakefiles/config.bkl index bf295d7ec2..587f2b35b6 100644 --- a/build/bakefiles/config.bkl +++ b/build/bakefiles/config.bkl @@ -509,15 +509,6 @@ it if SHARED=1 unless you know what you are doing. - - - -fvtable-thunks - - $(GCCFLAGS) -DHAVE_W32API_H diff --git a/build/bakefiles/wxpresets/presets/wx_win32.bkl b/build/bakefiles/wxpresets/presets/wx_win32.bkl index 97e6416064..45ba5c5167 100644 --- a/build/bakefiles/wxpresets/presets/wx_win32.bkl +++ b/build/bakefiles/wxpresets/presets/wx_win32.bkl @@ -241,7 +241,6 @@