changeset 1901:6923871d0048

Makefile fix from Mark Hessling...also conditionally use the old static recursive mutexes if GLib is less than 2.32 so we don't break older GTK2 versions.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 26 Mar 2014 15:10:50 +0000
parents 969f7bbc0ff5
children 74f50459c530
files Makefile.in gtk/dw.c
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Fri Mar 21 11:12:46 2014 +0000
+++ b/Makefile.in	Wed Mar 26 15:10:50 2014 +0000
@@ -3,7 +3,7 @@
 CC	=	@CC@
 PLATCCFLAGS = @PLATCCFLAGS@
 MLFLAGS	=	-L.
-include Version
+include $(srcdir)/Version
 CCFLAGS = @CFLAGS@ $(PLATCCFLAGS) @ARCH@ -D@DW_DEFINE@ -DBUILD_DLL -DDW_RESOURCES -DVER_REV=$(VER_REV)
 LFLAGS	=	@LIBS@ @ARCH@
 ARFLAGS = @ARFLAGS@
--- a/gtk/dw.c	Fri Mar 21 11:12:46 2014 +0000
+++ b/gtk/dw.c	Wed Mar 26 15:10:50 2014 +0000
@@ -2075,6 +2075,7 @@
 }
 #endif
 
+#if GLIB_CHECK_VERSION(2,32,0)
 static GRecMutex _dw_gdk_lock;
 
 static void _dw_gdk_lock_enter(void)
@@ -2086,6 +2087,19 @@
 {
     g_rec_mutex_unlock(&_dw_gdk_lock);
 }
+#else
+static GStaticRecMutex _dw_gdk_lock;
+
+static void _dw_gdk_lock_enter(void)
+{
+    g_static_rec_mutex_lock(&_dw_gdk_lock);
+}
+
+static void _dw_gdk_lock_leave(void)
+{
+    g_static_rec_mutex_unlock(&_dw_gdk_lock);
+}
+#endif
 
 /*
  * Initializes the Dynamic Windows engine.
@@ -2148,7 +2162,11 @@
    g_thread_init(NULL);
 #endif
 #if GTK_MAJOR_VERSION > 1
+#if GLIB_CHECK_VERSION(2,32,0)
    g_rec_mutex_init(&_dw_gdk_lock);
+#else
+   g_static_rec_mutex_init(&_dw_gdk_lock);
+#endif
 
    gdk_threads_set_lock_functions(G_CALLBACK(_dw_gdk_lock_enter), G_CALLBACK(_dw_gdk_lock_leave));