]> git.sesse.net Git - ffmpeg/commitdiff
atomics: Fix the win32 atomic_exchange function
authorMartin Storsjö <martin@martin.st>
Sat, 3 Apr 2021 21:04:46 +0000 (00:04 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 4 Apr 2021 08:06:08 +0000 (11:06 +0300)
This fixes building with MSVC after
a2a38b160620d91bc3f895dadc4501c589998b9c.

Remove the stray semicolon, and add casts for the input argument
(which is an intptr_t*) to the right type (PVOID volatile *).

Signed-off-by: Martin Storsjö <martin@martin.st>
compat/atomics/win32/stdatomic.h

index bb8e6e7e15a52983faadf8e46eb3f54d409c1c8c..28a627bfd3d9427186a7e8611a0c865e0f15ef3f 100644 (file)
@@ -96,7 +96,7 @@ do {                                    \
     atomic_load(object)
 
 #define atomic_exchange(object, desired) \
-    InterlockedExchangePointer(object, desired);
+    InterlockedExchangePointer((PVOID volatile *)object, (PVOID)desired)
 
 #define atomic_exchange_explicit(object, desired, order) \
     atomic_exchange(object, desired)