From dc423daa41fbf7ba00908b8ed7719e16caeeeb6b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 4 Aug 2024 09:08:27 +1000 Subject: [PATCH] Silence some GCC warnings. This is from c89atomic which has been fixed upstream. --- miniaudio.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index e1257e68..2cbeb68e 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -14878,14 +14878,18 @@ typedef int ma_atomic_memory_order; __atomic_compare_exchange_n(dst, &expected, desired, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); return expected; } - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Watomic-alignment" + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Watomic-alignment" + #endif static MA_INLINE ma_uint64 ma_atomic_compare_and_swap_64(volatile ma_uint64* dst, ma_uint64 expected, ma_uint64 desired) { __atomic_compare_exchange_n(dst, &expected, desired, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); return expected; } - #pragma clang diagnostic pop + #if defined(__clang__) + #pragma clang diagnostic pop + #endif typedef ma_uint8 ma_atomic_flag; #define ma_atomic_flag_test_and_set_explicit(dst, order) (ma_bool32)__atomic_test_and_set(dst, order) #define ma_atomic_flag_clear_explicit(dst, order) __atomic_clear(dst, order)