Compiling on linux.

This commit is contained in:
Ben Vanik
2013-02-10 12:21:56 -08:00
parent 3cae7ed714
commit bfda368ab5
10 changed files with 39 additions and 7 deletions

View File

@@ -69,7 +69,16 @@ XEFORCEINLINE void* xe_atomic_stack_dequeue(xe_atomic_stack_t* stack,
#elif XE_LIKE(POSIX)
#error TODO(benvanik): POSIX atomic primitives
#define xe_atomic_inc_32(value) \
__sync_add_and_fetch(value, 1)
#define xe_atomic_dec_32(value) \
__sync_sub_and_fetch(value, 1)
#define xe_atomic_add_32(amount, value) \
__sync_fetch_and_add(value, amount)
#define xe_atomic_sub_32(amount, value) \
__sync_fetch_and_sub(value, amount)
#define xe_atomic_cas_32(oldValue, newValue, value) \
__sync_bool_compare_and_swap(value, oldValue, newValue)
#else