Fix check for Intel atomic ops
This commit is contained in:
parent
6932a41fb6
commit
12f5c0a222
@ -182,11 +182,12 @@ dnl ===========================================================================
|
|||||||
|
|
||||||
AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [
|
AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [
|
||||||
hb_cv_have_intel_atomic_primitives=false
|
hb_cv_have_intel_atomic_primitives=false
|
||||||
AC_TRY_LINK([], [
|
AC_TRY_LINK([
|
||||||
void memory_barrier (void) { __sync_synchronize (); }
|
void memory_barrier (void) { __sync_synchronize (); }
|
||||||
int atomic_add (int i) { return __sync_fetch_and_add (&i, 1); }
|
int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); }
|
||||||
int atomic_cmpxchg (int *i, int *j, int *k) { return __sync_bool_compare_and_swap (&i, j, k); }
|
int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); }
|
||||||
], hb_cv_have_intel_atomic_primitives=true
|
void mutex_unlock (int *m) { __sync_lock_release (m); }
|
||||||
|
], [], hb_cv_have_intel_atomic_primitives=true
|
||||||
)
|
)
|
||||||
])
|
])
|
||||||
if $hb_cv_have_intel_atomic_primitives; then
|
if $hb_cv_have_intel_atomic_primitives; then
|
||||||
|
@ -65,7 +65,7 @@ typedef int32_t hb_atomic_int_t;
|
|||||||
#define hb_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
|
#define hb_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
|
||||||
|
|
||||||
|
|
||||||
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) && !defined(__MINGW32__)
|
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
|
||||||
|
|
||||||
typedef int hb_atomic_int_t;
|
typedef int hb_atomic_int_t;
|
||||||
#define hb_atomic_int_add(AI, V) __sync_fetch_and_add (&(AI), (V))
|
#define hb_atomic_int_add(AI, V) __sync_fetch_and_add (&(AI), (V))
|
||||||
|
Loading…
Reference in New Issue
Block a user