all repos — mgba @ aead90a2c14949fbf063a8ef210867a949f9e437

mGBA Game Boy Advance Emulator

Windows: Fix ATOMIC_*_PTR in MSVC
Vicki Pfau vi@endrift.com
Mon, 24 Jun 2019 14:02:56 -0700
commit

aead90a2c14949fbf063a8ef210867a949f9e437

parent

ba547b26d1c645b6f62739f01d7194794cca6949

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M include/mgba-util/common.hinclude/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