changeset 640:91056492b156

Fix XS_MUTEX_DEBUG to work again.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 04 Sep 2007 20:45:02 +0000
parents 53f1775eabe4
children a5e42ce2988a
files src/xmms-sid.h
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmms-sid.h	Tue Sep 04 16:21:01 2007 +0000
+++ b/src/xmms-sid.h	Tue Sep 04 20:45:02 2007 +0000
@@ -24,7 +24,6 @@
 #define XMMS_SID_H
 
 #include "xs_support.h"
-#include <pthread.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -107,9 +106,12 @@
 #define XS_THREAD_EXIT(M)	pthread_exit(M)
 #define XS_THREAD_JOIN(M)	pthread_join(M, NULL)
 #define XS_MPP(M)		M ## _mutex
-#if XS_MUTEX_DEBUG
-#  define XS_MUTEX(M)		pthread_mutex_t	XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; int M ## _qq;
-#  define XS_MUTEX_H(M)		extern pthread_mutex_t XS_MPP(M); extern int M ## _qq
+#ifdef XS_MUTEX_DEBUG
+#  ifndef __USE_GNU
+#    define __USE_GNU
+#  endif
+#  define XS_MUTEX(M)		pthread_mutex_t	XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; gint M ## _qq
+#  define XS_MUTEX_H(M)		extern pthread_mutex_t XS_MPP(M); extern gint M ## _qq
 #  define XS_MUTEX_LOCK(M)	{ M ## _qq = pthread_mutex_lock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_LOCK(" #M ") == %i\n", M ## _qq); }
 #  define XS_MUTEX_UNLOCK(M)	{ M ## _qq = pthread_mutex_unlock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_UNLOCK(" #M ") == %i\n", M ## _qq); }
 #else
@@ -118,6 +120,7 @@
 #  define XS_MUTEX_LOCK(M)	pthread_mutex_lock(&XS_MPP(M))
 #  define XS_MUTEX_UNLOCK(M)	pthread_mutex_unlock(&XS_MPP(M))
 #endif
+#include <pthread.h>
 
 /* Character set conversion helper macros
  */