Stop requiring same memory ordering in win32 atomic_compare_exchange functions

This commit is contained in:
Ondřej Surý 2019-06-20 18:51:36 +02:00
parent 28af0de764
commit 0f9f1ece14

View file

@ -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: