summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-04-03 14:13:37 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-04-03 14:14:10 +0200
commitbda31fdf08b1d3818d923116f86b49e41ad9e554 (patch)
tree54d852cf6210720662701dfe93c71b6260771061
parent215065514cf220a1e945e29a6f74c92eacfb761e (diff)
fix build with glib < 2.32
Reported and verified by Nicolas Prochazka
-rw-r--r--gtk/channel-usbredir.c8
1 files changed, 8 insertions, 0 deletions
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
}
/* --------------------------------------------------------------------- */