From 60ccbcf9cca65edac59bf374cc4af13eda91c791 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 30 Dec 2019 09:49:23 -0700 Subject: [PATCH] use a local version (copy) of the G_SOURCE_FUNC macro, since it is not available in the GTK+ version we use for the official build stack --- libs/pbd/crossthread.cc | 7 ++++++- libs/pbd/test/timer_test.cc | 4 ++++ libs/surfaces/mackie/mackie_control_protocol.cc | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libs/pbd/crossthread.cc b/libs/pbd/crossthread.cc index 11d3815b05..9f183651ee 100644 --- a/libs/pbd/crossthread.cc +++ b/libs/pbd/crossthread.cc @@ -41,6 +41,10 @@ using namespace Glib; #include "crossthread.win.cc" #endif +#ifndef G_SOURCE_FUNC +#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) +#endif + gboolean cross_thread_channel_call_receive_slot (GIOChannel*, GIOCondition condition, void *data) { @@ -58,6 +62,7 @@ void CrossThreadChannel::attach (Glib::RefPtr context) { receive_source = g_io_create_watch (receive_channel, GIOCondition(G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL)); - g_source_set_callback (receive_source, (GSourceFunc) cross_thread_channel_call_receive_slot, this, NULL); + + g_source_set_callback (receive_source, G_SOURCE_FUNC(cross_thread_channel_call_receive_slot), this, NULL); g_source_attach (receive_source, context->gobj()); } diff --git a/libs/pbd/test/timer_test.cc b/libs/pbd/test/timer_test.cc index 7c78b9c3c0..43001d824e 100644 --- a/libs/pbd/test/timer_test.cc +++ b/libs/pbd/test/timer_test.cc @@ -10,6 +10,10 @@ #include #endif +#ifndef G_SOURCE_FUNC +#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) +#endif + CPPUNIT_TEST_SUITE_REGISTRATION (TimerTest); using namespace std; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 665f58f02e..c558f27837 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -81,6 +81,10 @@ #include "fader.h" #include "pot.h" +#ifndef G_SOURCE_FUNC +#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) +#endif + using namespace ARDOUR; using namespace std; using namespace PBD; @@ -942,7 +946,7 @@ MackieControlProtocol::create_surfaces () ipm->mcp = this; ipm->port = &input_port; - g_source_set_callback (surface->input_source, (GSourceFunc) ipmidi_input_handler, ipm, NULL); + g_source_set_callback (surface->input_source, G_SOURCE_FUNC (ipmidi_input_handler), ipm, NULL); g_source_attach (surface->input_source, main_loop()->get_context()->gobj()); } }