From 9f563c0c7e1cca99e5bad216d7d881aaa559f81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 5 Nov 2013 15:04:58 +0100 Subject: [PATCH] Reorder macro to be more consistent --- include/ucore/atomic.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/ucore/atomic.h b/include/ucore/atomic.h index a3b4a67..7d7821e 100644 --- a/include/ucore/atomic.h +++ b/include/ucore/atomic.h @@ -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