Reorder macro to be more consistent

This commit is contained in:
Nils O. Selåsdal
2013-11-05 15:04:58 +01:00
parent 410ae4ba81
commit 9f563c0c7e
+6 -5
View File
@@ -8,17 +8,18 @@
#ifdef __GNUC__
/**
* Atomically subtract val from *ptr
* @return *ptr before the subtraction
*/
#define UC_ATOMIC_SUB(ptr, val) __sync_fetch_and_add((ptr), -(val))
/**
* Atomically add val to *ptr
* @return *ptr before the addition
*/
#define UC_ATOMIC_ADD(ptr, val) __sync_fetch_and_add((ptr), (val))
/**
* Atomically subtract val from *ptr
* @return *ptr before the subtraction
*/
#define UC_ATOMIC_SUB(ptr, val) __sync_fetch_and_add((ptr), -(val))
/**
* Atomically decrement *ptr