From 52fd106724aa79ad57ecaa7ad9d340f8c89da06d Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 26 Oct 2011 11:38:13 +0200 Subject: [PATCH] gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case. Also initialize the unused member. This was correct before but was broken when the ifndef was moved inside the GStaticMutex struct: http://git.gnome.org/browse/glib/commit/glib/gthread.h?id=24652730a9faaedb19b9e90024077eb7f75a6907 This avoids a compiler warning. --- glib/deprecated/gthread.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h index 095ecc28e..987fc909e 100644 --- a/glib/deprecated/gthread.h +++ b/glib/deprecated/gthread.h @@ -124,7 +124,15 @@ void g_thread_foreach (GFunc thread_func, #endif #define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl + +#ifndef G_OS_WIN32 +/* The use of PTHREAD_MUTEX_INITIALIZER is arbitrary. + * but that struct field is unused anyway. */ +#define G_STATIC_MUTEX_INIT { NULL, PTHREAD_MUTEX_INITIALIZER } +#else #define G_STATIC_MUTEX_INIT { NULL } +#endif + typedef struct { GMutex *mutex;