From 41268e014d66a6af68d97df76f8483936d13270c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 26 Apr 2021 15:18:39 +0100 Subject: [PATCH] Remove MSVS 2003, a.k.a. MSVC 7, support from the code It was probably not supported since quite some time anyhow, because wx own code uses CallAfter() which wouldn't compile with it, but now we can can get rid of wxHAS_CALL_AFTER checks too. --- include/wx/compiler.h | 6 ++---- include/wx/event.h | 17 +++-------------- src/common/event.cpp | 2 -- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/include/wx/compiler.h b/include/wx/compiler.h index 416a902d3f..48bc4b6287 100644 --- a/include/wx/compiler.h +++ b/include/wx/compiler.h @@ -35,10 +35,8 @@ define special symbols for different VC version instead of writing tests for magic numbers such as 1200, 1300 &c repeatedly */ -#if __VISUALC__ < 1300 -# error "This Visual C++ version is not supported any longer (at least MSVC 2003 required)." -#elif __VISUALC__ < 1400 -# define __VISUALC7__ +#if __VISUALC__ < 1400 +# error "This Visual C++ version is not supported any longer (at least MSVC 2005 required)." #elif __VISUALC__ < 1500 # define __VISUALC8__ #elif __VISUALC__ < 1600 diff --git a/include/wx/event.h b/include/wx/event.h index c649d2fb8f..f5c32a3d77 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -31,14 +31,10 @@ #include "wx/vector.h" #include "wx/meta/convertible.h" +#include "wx/meta/removeref.h" -// Currently VC7 is known to not be able to compile CallAfter() code, so -// disable it for it (FIXME-VC7). -#if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(8) - #include "wx/meta/removeref.h" - - #define wxHAS_CALL_AFTER -#endif +// This is now always defined, but keep it for backwards compatibility. +#define wxHAS_CALL_AFTER // ---------------------------------------------------------------------------- // forward declarations @@ -1373,8 +1369,6 @@ private: // done asynchronously, i.e. at some later time, instead of immediately when // the event object is constructed. -#ifdef wxHAS_CALL_AFTER - // This is a base class used to process all method calls. class wxAsyncMethodCallEvent : public wxEvent { @@ -1555,9 +1549,6 @@ private: FunctorType m_fn; }; -#endif // wxHAS_CALL_AFTER - - #if wxUSE_GUI @@ -3705,7 +3696,6 @@ public: static void WXConsumeException(); #endif // wxUSE_EXCEPTIONS -#ifdef wxHAS_CALL_AFTER // Asynchronous method calls: these methods schedule the given method // pointer for a later call (during the next idle event loop iteration). // @@ -3749,7 +3739,6 @@ public: { QueueEvent(new wxAsyncMethodCallEventFunctor(this, fn)); } -#endif // wxHAS_CALL_AFTER // Connecting and disconnecting diff --git a/src/common/event.cpp b/src/common/event.cpp index a2c64b72a0..4b1409cb24 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1615,7 +1615,6 @@ bool wxEvtHandler::TryHereOnly(wxEvent& event) if ( GetEventHashTable().HandleEvent(event, this) ) return true; -#ifdef wxHAS_CALL_AFTER // There is an implicit entry for async method calls processing in every // event handler: if ( event.GetEventType() == wxEVT_ASYNC_METHOD_CALL && @@ -1624,7 +1623,6 @@ bool wxEvtHandler::TryHereOnly(wxEvent& event) static_cast(event).Execute(); return true; } -#endif // wxHAS_CALL_AFTER // We don't have a handler for this event. return false;