From 8f6bb2602bfbd09e6fed1759bdc0211fd6a68473 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin <vadim@wxwidgets.org> Date: Wed, 24 Oct 2012 00:17:15 +0000 Subject: [PATCH] Disable wxEvtHandler::CallAfter() for VC6, it's too broken for it. There is no clear way to implement wxRemoveRef() for VC6 so just disable it, and CallAfter() as it relies on it, for this compiler. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 13 +++++++++++++ include/wx/meta/removeref.h | 10 +++++++++- interface/wx/event.h | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/wx/event.h b/include/wx/event.h index 3396eb2a88..99710b7d7c 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -35,6 +35,12 @@ #include "wx/meta/removeref.h" +#ifdef wxHAS_REMOVEREF + // CallAfter() implementation requires wxRemoveRef(), so just disable it + // for compilers too broken to not allow defining it. + #define wxHAS_CALL_AFTER +#endif + // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- @@ -1276,6 +1282,8 @@ 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 { @@ -1423,6 +1431,9 @@ private: const ParamType2 m_param2; }; +#endif // wxHAS_CALL_AFTER + + #if wxUSE_GUI @@ -3294,6 +3305,7 @@ public: // NOTE: uses AddPendingEvent(); call only from secondary threads #endif +#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). // @@ -3331,6 +3343,7 @@ public: static_cast<T*>(this), method, x1, x2) ); } +#endif // wxHAS_CALL_AFTER // Connecting and disconnecting diff --git a/include/wx/meta/removeref.h b/include/wx/meta/removeref.h index 5c32c3349e..1ab7fc14c8 100644 --- a/include/wx/meta/removeref.h +++ b/include/wx/meta/removeref.h @@ -11,9 +11,13 @@ #ifndef _WX_META_REMOVEREF_H_ #define _WX_META_REMOVEREF_H_ -// wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with any +// wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with all // compilers (but, to compensate for this, doesn't work with rvalue references). +// Except that it doesn't work with VC++ 6 as there doesn't seem to be any way +// to partially specialize a template for references with it. +#ifndef __VISUALC6__ + template <typename T> struct wxRemoveRef { @@ -26,4 +30,8 @@ struct wxRemoveRef<T&> typedef T type; }; +#define wxHAS_REMOVEREF + +#endif // !__VISUALC6__ + #endif // _WX_META_REMOVEREF_H_ diff --git a/interface/wx/event.h b/interface/wx/event.h index 3aae72f4a1..237e8480e8 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -519,6 +519,9 @@ public: Note that currently only up to 2 arguments can be passed. + @note This method is not available with Visual C++ 6 which doesn't + have the required support for C++ templates to implement it. + @since 2.9.5 */ template<typename T, typename T1, ...> -- 2.47.2