From 0f9f1ece1497fa9553e8f083bd1141d7d5f52ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 20 Jun 2019 18:51:36 +0200 Subject: [PATCH] Stop requiring same memory ordering in win32 atomic_compare_exchange functions --- lib/isc/win32/include/isc/stdatomic.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/isc/win32/include/isc/stdatomic.h b/lib/isc/win32/include/isc/stdatomic.h index 1d933e55e9..f27141c66d 100644 --- a/lib/isc/win32/include/isc/stdatomic.h +++ b/lib/isc/win32/include/isc/stdatomic.h @@ -222,7 +222,10 @@ atomic_compare_exchange_strong_explicit8(atomic_int_fast8_t *obj, { bool __r; int8_t __v; - REQUIRE(succ == fail); + + UNUSED(succ); + UNUSED(fail); + __v = InterlockedCompareExchange8((atomic_int_fast8_t *)obj, desired, *expected); __r = (*(expected) == __v); if (!__r) { @@ -239,7 +242,10 @@ atomic_compare_exchange_strong_explicit32(atomic_int_fast32_t *obj, memory_order fail) { bool __r; int32_t __v; - REQUIRE(succ == fail); + + UNUSED(succ); + UNUSED(fail); + switch (succ) { case memory_order_relaxed: __v = InterlockedCompareExchangeNoFence((atomic_int_fast32_t *)obj, desired, *expected); @@ -269,7 +275,10 @@ atomic_compare_exchange_strong_explicit64(atomic_int_fast64_t *obj, memory_order fail) { bool __r; int64_t __v; - REQUIRE(succ == fail); + + UNUSED(succ); + UNUSED(fail); + #ifdef _WIN64 switch (succ) { case memory_order_relaxed: