]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wx/event.h compilation with Sun CC compiler.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 27 Sep 2010 12:55:22 +0000 (12:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 27 Sep 2010 12:55:22 +0000 (12:55 +0000)
Move wxObjectEventFunctor::operator() definition after wxEvtHandler
declaration as it uses call through a pointer to member of this class and Sun
CC refuses to compile this without having the full class declaration.

Closes #12452.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/event.h

index c0629e53e66825c595da709cba65494b8014b065..4aa6e97a94dd08ed57bfa93256fc9f1bcd491a1b 100644 (file)
@@ -215,12 +215,7 @@ public:
         : m_handler( handler ), m_method( method )
         { }
 
-    virtual void operator()(wxEvtHandler *handler, wxEvent& event)
-    {
-        wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
-
-        (realHandler->*m_method)(event);
-    }
+    virtual void operator()(wxEvtHandler *handler, wxEvent& event);
 
     virtual bool IsMatching(const wxEventFunctor& functor) const
     {
@@ -3339,6 +3334,17 @@ private:
 
 WX_DEFINE_ARRAY_WITH_DECL_PTR(wxEvtHandler *, wxEvtHandlerArray, class WXDLLIMPEXP_BASE);
 
+
+// Define an inline method of wxObjectEventFunctor which couldn't be defined
+// before wxEvtHandler declaration: at least Sun CC refuses to compile function
+// calls through pointer to member for forward-declared classes (see #12452).
+inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event)
+{
+    wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
+
+    (realHandler->*m_method)(event);
+}
+
 // ----------------------------------------------------------------------------
 // wxEventConnectionRef represents all connections between two event handlers
 // and enables automatic disconnect when an event handler sink goes out of