From cbd0cf595518f1b78e1f9a11f12b9c9192d8bc62 Mon Sep 17 00:00:00 2001 From: nimetu Date: Thu, 6 Jan 2022 15:36:59 +0200 Subject: [PATCH] Silence warning on deprecated QSAtomicCompareAndSwap32 on macOS --- nel/include/nel/misc/mutex.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nel/include/nel/misc/mutex.h b/nel/include/nel/misc/mutex.h index a37ec3dbf..2717bb45e 100644 --- a/nel/include/nel/misc/mutex.h +++ b/nel/include/nel/misc/mutex.h @@ -257,7 +257,12 @@ public: # endif // NL_DEBUG # endif // NL_NO_ASM #elif defined(NL_OS_MAC) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +// warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - +// Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from instead return OSAtomicCompareAndSwap32(0, 1, reinterpret_cast(lockPtr)); +#pragma clang diagnostic pop #elif defined(NL_OS_UNIX) // GCC implements the same functionality using a builtin function // http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html