From b0811b24d400aaab3629440c0da9fd792b22f55b Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Mon, 15 Aug 2022 02:25:43 +0400 Subject: [atomic] memory_order for load on Windows --- source/kit/atomic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/kit/atomic.c b/source/kit/atomic.c index 33d355a..fc5b53d 100644 --- a/source/kit/atomic.c +++ b/source/kit/atomic.c @@ -25,7 +25,9 @@ void kit_atomic_store_explicit(volatile KIT_ATOMIC_VAR *var, KIT_ATOMIC_VAR kit_atomic_load_explicit(volatile KIT_ATOMIC_VAR *var, int memory_order) { - return *var; + if (memory_order == memory_order_relaxed) + return *var; + return InterlockedExchangeAdd_(var, 0); } KIT_ATOMIC_VAR kit_atomic_fetch_add_explicit( -- cgit v1.2.3