Reorder macro to be more consistent
This commit is contained in:
@@ -8,17 +8,18 @@
|
|||||||
|
|
||||||
#ifdef __GNUC__
|
#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
|
* Atomically add val to *ptr
|
||||||
* @return *ptr before the addition
|
* @return *ptr before the addition
|
||||||
*/
|
*/
|
||||||
#define UC_ATOMIC_ADD(ptr, val) __sync_fetch_and_add((ptr), (val))
|
#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
|
* Atomically decrement *ptr
|
||||||
|
|||||||
Reference in New Issue
Block a user