From 8c7a100a4d0f3a257fb7563cb08ed4356c3af669 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 May 2011 19:21:07 -0400 Subject: [PATCH] Fix build without mutex --- src/hb-mutex-private.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-mutex-private.hh b/src/hb-mutex-private.hh index 5a74337..3cc47e9 100644 --- a/src/hb-mutex-private.hh +++ b/src/hb-mutex-private.hh @@ -71,13 +71,13 @@ typedef CRITICAL_SECTION hb_mutex_t; #warning "Could not find any system to define platform macros, library will NOT be thread-safe" -typedef volatile int hb_mutex_t; +typedef struct { volatile int m; } hb_mutex_t; #define HB_MUTEX_INIT 0 -#define hb_mutex_init(M) ((void) (*(M) = 0)) -#define hb_mutex_lock(M) ((void) (*(M) = 1)) -#define hb_mutex_trylock(M) (*(M) = 1, 1) -#define hb_mutex_unlock(M) ((void) (*(M) = 0)) -#define hb_mutex_free(M) ((void) (*(M) = 2)) +#define hb_mutex_init(M) ((void) ((M)->m = 0)) +#define hb_mutex_lock(M) ((void) ((M)->m = 1)) +#define hb_mutex_trylock(M) ((M)->m = 1, 1) +#define hb_mutex_unlock(M) ((void) ((M)->m = 0)) +#define hb_mutex_free(M) ((void) ((M)-M = 2)) #endif -- 2.7.4