|
|
|
@ -47,8 +47,6 @@ |
|
|
|
|
#include <intrin.h> |
|
|
|
|
typedef long hb_atomic_int_t; |
|
|
|
|
#define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V)) |
|
|
|
|
#define hb_atomic_int_set(AI, V) ((AI) = (V), MemoryBarrier ()) |
|
|
|
|
#define hb_atomic_int_get(AI) (MemoryBarrier (), (AI)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif !defined(HB_NO_MT) && defined(__APPLE__) |
|
|
|
@ -56,8 +54,6 @@ typedef long hb_atomic_int_t; |
|
|
|
|
#include <libkern/OSAtomic.h> |
|
|
|
|
typedef int32_t hb_atomic_int_t; |
|
|
|
|
#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V)) |
|
|
|
|
#define hb_atomic_int_set(AI, V) ((AI) = (V), OSMemoryBarrier ()) |
|
|
|
|
#define hb_atomic_int_get(AI) (OSMemoryBarrier (), (AI)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif !defined(HB_NO_MT) && defined(HAVE_GLIB) |
|
|
|
@ -69,8 +65,6 @@ typedef volatile int hb_atomic_int_t; |
|
|
|
|
#else |
|
|
|
|
#define hb_atomic_int_add(AI, V) g_atomic_int_exchange_and_add (&(AI), (V)) |
|
|
|
|
#endif |
|
|
|
|
#define hb_atomic_int_set(AI, V) g_atomic_int_set (&(AI), (V)) |
|
|
|
|
#define hb_atomic_int_get(AI) g_atomic_int_get (&(AI)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
@ -78,8 +72,6 @@ typedef volatile int hb_atomic_int_t; |
|
|
|
|
#define HB_ATOMIC_INT_NIL 1 |
|
|
|
|
typedef volatile int hb_atomic_int_t; |
|
|
|
|
#define hb_atomic_int_add(AI, V) (((AI) += (V)) - (V)) |
|
|
|
|
#define hb_atomic_int_set(AI, V) ((void) ((AI) = (V))) |
|
|
|
|
#define hb_atomic_int_get(AI) (AI) |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|