From d0daa886a070f15c0325963af278f3f815390fca Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Mon, 3 Feb 2025 01:31:57 +0800 Subject: [PATCH] atomic: fix ordering on gcc (#32) --- atomic/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic/atomic.h b/atomic/atomic.h index d487dfe..b0d6b0d 100644 --- a/atomic/atomic.h +++ b/atomic/atomic.h @@ -192,9 +192,9 @@ typedef psnip_int32_t psnip_atomic_int32; #define psnip_atomic_int64_compare_exchange(object, expected, desired) \ __atomic_compare_exchange_n(object, expected, desired, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) #define psnip_atomic_int64_add(object, operand) \ - __atomic_add_fetch(object, operand, __ATOMIC_SEQ_CST) + __atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST) #define psnip_atomic_int64_sub(object, operand) \ - __atomic_sub_fetch(object, operand, __ATOMIC_SEQ_CST) + __atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST) #define psnip_atomic_fence() \ __atomic_thread_fence(__ATOMIC_SEQ_CST)