Received: from eggs.gnu.org ([2001:4830:134:3::10]:39860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byjE4-0002Fu-K7 for qemu-devel@nongnu.org; Mon, 24 Oct 2016 13:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byjE0-0005JW-OM for qemu-devel@nongnu.org; Mon, 24 Oct 2016 13:39:56 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byjE0-0005J3-Fg for qemu-devel@nongnu.org; Mon, 24 Oct 2016 13:39:52 -0400 Received: by mail-pf0-x242.google.com with SMTP id r16so17096988pfg.3 for ; Mon, 24 Oct 2016 10:39:52 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 24 Oct 2016 10:39:12 -0700 Message-Id: <1477330788-14996-2-git-send-email-rth@twiddle.net> In-Reply-To: <1477330788-14996-1-git-send-email-rth@twiddle.net> References: <1477330788-14996-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v8 01/37] atomics: Add parameters to macros List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, cota@braap.org, alex.bennee@linaro.org Making these functional rather than object macros will prevent later problems with complex macro expansion. Signed-off-by: Richard Henderson --- include/qemu/atomic.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index c09fce7..94be1d0 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -335,11 +335,11 @@ /* Provide shorter names for GCC atomic builtins. */ #define atomic_fetch_inc(ptr) __sync_fetch_and_add(ptr, 1) #define atomic_fetch_dec(ptr) __sync_fetch_and_add(ptr, -1) -#define atomic_fetch_add __sync_fetch_and_add -#define atomic_fetch_sub __sync_fetch_and_sub -#define atomic_fetch_and __sync_fetch_and_and -#define atomic_fetch_or __sync_fetch_and_or -#define atomic_cmpxchg __sync_val_compare_and_swap +#define atomic_fetch_add(ptr, n) __sync_fetch_and_add(ptr, n) +#define atomic_fetch_sub(ptr, n) __sync_fetch_and_sub(ptr, n) +#define atomic_fetch_and(ptr, n) __sync_fetch_and_and(ptr, n) +#define atomic_fetch_or(ptr, n) __sync_fetch_and_or(ptr, n) +#define atomic_cmpxchg(ptr, old, new) __sync_val_compare_and_swap(ptr, old, new) /* And even shorter names that return void. */ #define atomic_inc(ptr) ((void) __sync_fetch_and_add(ptr, 1)) -- 2.7.4