diff --git a/lib/base/heimbase-atomics.h b/lib/base/heimbase-atomics.h index 6401f60de..271c39276 100644 --- a/lib/base/heimbase-atomics.h +++ b/lib/base/heimbase-atomics.h @@ -103,10 +103,10 @@ #define heim_base_atomic_barrier() __isync() -#define heim_base_atomic_inc(x) (fetch_and_add((atomic_p)(x), 1) + 1) -#define heim_base_atomic_dec(x) (fetch_and_add((atomic_p)(x), -1) - 1) -#define heim_base_atomic_integer_type int -#define heim_base_atomic_integer_max INT_MAX +#define heim_base_atomic_inc(x) (fetch_and_addlp((atomic_l)(x), 1) + 1) +#define heim_base_atomic_dec(x) (fetch_and_addlp((atomic_l)(x), -1) - 1) +#define heim_base_atomic_integer_type long +#define heim_base_atomic_integer_max LONG_MAX static inline void * heim_base_exchange_pointer(void *p, void *newval)