use a local version (copy) of the G_SOURCE_FUNC macro, since it is not available...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 16:49:23 +0000 (09:49 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 16:49:23 +0000 (09:49 -0700)
libs/pbd/crossthread.cc
libs/pbd/test/timer_test.cc
libs/surfaces/mackie/mackie_control_protocol.cc

index 11d3815b05081d30d643c04b4a08ac650f10261a..9f183651ee0457ceeda28870353b5337374ed039 100644 (file)
@@ -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<Glib::MainContext> 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());
 }
index 7c78b9c3c0e1ad6129e2ad6f9c40dd906b763730..43001d824e7ba3cc100dae7b1bc5acefc6248348 100644 (file)
 #include <windows.h>
 #endif
 
+#ifndef G_SOURCE_FUNC
+#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f))
+#endif
+
 CPPUNIT_TEST_SUITE_REGISTRATION (TimerTest);
 
 using namespace std;
index 665f58f02ee1d236d238d863051cec7abfd2da2c..c558f27837bbc49161cf785f1a5a7aafbd355ecd 100644 (file)
 #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());
                        }
                }