From 4a13a03f468ff985e851c021da1300061fc37f54 Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 9 Jan 2019 23:40:32 -0800 Subject: [PATCH] Windows Port: Fix compiling on 32-bit Windows. (Regression from commit abc0649.) --- desmume/src/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/types.h b/desmume/src/types.h index b6f57a45b..55238cf9c 100755 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -307,8 +307,8 @@ typedef int desmume_BOOL; #include //#define atomic_add_32(V,M) InterlockedAddNoFence((volatile LONG *)(V),(LONG)(M)) // Requires Windows 8 -#define atomic_add_32(V,M) _InterlockedAdd((volatile LONG *)(V),(LONG)(M)) -#define atomic_add_barrier32(V,M) _InterlockedAdd((volatile LONG *)(V),(LONG)(M)) +inline s32 atomic_add_32(volatile s32 *V, s32 M) { return (s32)(InterlockedExchangeAdd((volatile LONG *)V, (LONG)M) + M); } +inline s32 atomic_add_barrier32(volatile s32 *V, s32 M) { return (s32)(InterlockedExchangeAdd((volatile LONG *)V, (LONG)M) + M); } //#define atomic_inc_32(V) InterlockedIncrementNoFence((volatile LONG *)(V)) // Requires Windows 8 #define atomic_inc_32(V) _InterlockedIncrement((volatile LONG *)(V))