[Spice-commits] gtk/channel-usbredir.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue Apr 3 05:14:45 PDT 2012


 gtk/channel-usbredir.c |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit bda31fdf08b1d3818d923116f86b49e41ad9e554
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Apr 3 14:13:37 2012 +0200

    fix build with glib < 2.32
    
    Reported and verified by Nicolas Prochazka

diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c
index 5ce5118..8b2d2f4 100644
--- a/gtk/channel-usbredir.c
+++ b/gtk/channel-usbredir.c
@@ -505,12 +505,16 @@ static int usbredir_write_callback(void *user_data, uint8_t *data, int count)
 }
 
 static void *usbredir_alloc_lock(void) {
+#if GLIB_CHECK_VERSION(2,32,0)
     GMutex *mutex;
 
     mutex = g_new0(GMutex, 1);
     g_mutex_init(mutex);
 
     return mutex;
+#else
+    return g_mutex_new();
+#endif
 }
 
 static void usbredir_lock_lock(void *user_data) {
@@ -528,8 +532,12 @@ static void usbredir_unlock_lock(void *user_data) {
 static void usbredir_free_lock(void *user_data) {
     GMutex *mutex = user_data;
 
+#if GLIB_CHECK_VERSION(2,32,0)
     g_mutex_clear(mutex);
     g_free(mutex);
+#else
+    g_mutex_free(mutex);
+#endif
 }
 
 /* --------------------------------------------------------------------- */


More information about the Spice-commits mailing list