提交 8c7a100a 编写于 作者: B Behdad Esfahbod

Fix build without mutex

上级 19d3035c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册