Hi

----- Mensaje original -----
> hello
> patch from Marc-André Lureau :
>
> [Spice-devel] [PATCH spice-gtk 1/2] build: fix build with glib < 2.32
>
> does not cover
> channel-usbredir.c  file
>
> compilation is not possible.


Can you try the attached patch?

thanks
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
 }
 
 /* --------------------------------------------------------------------- */
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to