Windows: Fix ATOMIC_*_PTR in MSVC
Vicki Pfau vi@endrift.com
Mon, 24 Jun 2019 14:02:56 -0700
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
include/mgba-util/common.h
→
include/mgba-util/common.h
@@ -102,8 +102,8 @@ #define ATOMIC_SUB(DST, OP) InterlockedAddRelease(&DST, -OP)
#define ATOMIC_OR(DST, OP) InterlockedOrRelease(&DST, OP) #define ATOMIC_AND(DST, OP) InterlockedAndRelease(&DST, OP) #define ATOMIC_CMPXCHG(DST, EXPECTED, SRC) (InterlockedCompareExchange(&DST, SRC, EXPECTED) == EXPECTED) -#define ATOMIC_STORE_PTR(DST, SRC) InterlockedExchangePointer(DST, SRC) -#define ATOMIC_LOAD_PTR(DST, SRC) DST = InterlockedCompareExchangePointer(SRC, 0, 0) +#define ATOMIC_STORE_PTR(DST, SRC) InterlockedExchangePointer(&DST, SRC) +#define ATOMIC_LOAD_PTR(DST, SRC) DST = InterlockedCompareExchangePointer(&SRC, 0, 0) #else // TODO #define ATOMIC_STORE(DST, SRC) DST = SRC