From fcbc9cf8838898bdf91bd281e316b21943a0b5fd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Jan 2014 21:54:23 +0100 Subject: [PATCH] Move the deprecated stuff to the end Signed-off-by: Sebastian Ramacher --- glib-compat.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/glib-compat.h b/glib-compat.h index c76ccca..3e98dae 100644 --- a/glib-compat.h +++ b/glib-compat.h @@ -5,19 +5,20 @@ #include -/* GStaticMutex is deprecated starting with glib 2.32 */ -#if !GLIB_CHECK_VERSION(2, 31, 0) -#define mutex GStaticMutex -#define mutex_init(m) g_static_mutex_init((m)) -#define mutex_lock(m) g_static_mutex_lock((m)) -#define mutex_unlock(m) g_static_mutex_unlock((m)) -#define mutex_free(m) g_static_mutex_free((m)) -#else +/* GStaticMutex is deprecated starting with glib 2.32 and got replaced with + * GMutex */ +#if GLIB_CHECK_VERSION(2, 32, 0) #define mutex GMutex #define mutex_init(m) g_mutex_init((m)) #define mutex_lock(m) g_mutex_lock((m)) #define mutex_unlock(m) g_mutex_unlock((m)) #define mutex_free(m) g_mutex_clear((m)) +#else +#define mutex GStaticMutex +#define mutex_init(m) g_static_mutex_init((m)) +#define mutex_lock(m) g_static_mutex_lock((m)) +#define mutex_unlock(m) g_static_mutex_unlock((m)) +#define mutex_free(m) g_static_mutex_free((m)) #endif #endif