From 1da8e6e40088a93a64a6b95323e911474d77fac5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Oct 2011 21:10:45 +0000 Subject: [PATCH] Make GTK callbacks passed to GTKConnectWidget() extern "C". This fixes (harmless but annoying) warnings about mixing C++ and C linkage function pointers from Sun compiler. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 9 ++++++++- src/gtk/window.cpp | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 5af2602..c8a7729 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -18,6 +18,13 @@ struct wxGtkIMData; WX_DEFINE_EXPORTED_ARRAY_PTR(GdkWindow *, wxArrayGdkWindows); +extern "C" +{ + +typedef void (*wxGTKCallback)(); + +} + //----------------------------------------------------------------------------- // wxWindowGTK //----------------------------------------------------------------------------- @@ -374,7 +381,7 @@ protected: // // This is just a wrapper for g_signal_connect() and returns the handler id // just as it does. - unsigned long GTKConnectWidget(const char *signal, void (*callback)()); + unsigned long GTKConnectWidget(const char *signal, wxGTKCallback callback); // Return true from here if PostCreation() should connect to size_request // signal: this is done by default but doesn't work for some native diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 20ddddd..ec6db0f 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2444,7 +2444,8 @@ void wxWindowGTK::PostCreation() gtk_widget_show( m_widget ); } -unsigned long wxWindowGTK::GTKConnectWidget(const char *signal, void (*callback)()) +unsigned long +wxWindowGTK::GTKConnectWidget(const char *signal, wxGTKCallback callback) { return g_signal_connect(m_widget, signal, callback, this); } -- 2.7.4