From 15432a9fee0fb453a10112052398b6c5fce8ef48 Mon Sep 17 00:00:00 2001 From: Todd White Date: Thu, 13 Aug 2026 21:52:25 -0400 Subject: [PATCH] Cast the pointers InterlockedCompareExchangePointer is given Every other atomic macro in the _WIN32 branch casts its arguments, to LONGLONG volatile* or LONG volatile*. The pointer one passed its arguments through untouched, so a caller holding a typed pointer, such as CFTimeZoneRef* in CFTimeZone.c, does not compile: the parameter is PVOID volatile*. The other branch uses __sync_val_compare_and_swap, which is type generic, so this only shows up on Windows. --- Source/GSPrivate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/GSPrivate.h b/Source/GSPrivate.h index 7e7eb58..6685f52 100644 --- a/Source/GSPrivate.h +++ b/Source/GSPrivate.h @@ -80,7 +80,8 @@ #define GSAtomicCompareAndSwapPointer(ptr, oldv, newv) \ - InterlockedCompareExchangePointer((ptr), (newv), (oldv)) + InterlockedCompareExchangePointer((PVOID volatile*)(ptr), \ + (PVOID)(newv), (PVOID)(oldv)) #else /* _WIN32 */