]> git.sesse.net Git - ffmpeg/blobdiff - compat/atomics/win32/stdatomic.h
Merge commit '6a93b596c5c3af31b843d63013a7985ffeea354d'
[ffmpeg] / compat / atomics / win32 / stdatomic.h
index fa7ef51ea5488e2186bf9a6e51a7b72f06f63d56..bb8e6e7e15a52983faadf8e46eb3f54d409c1c8c 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef COMPAT_ATOMICS_WIN32_STDATOMIC_H
 #define COMPAT_ATOMICS_WIN32_STDATOMIC_H
 
+#define WIN32_LEAN_AND_MEAN
 #include <stddef.h>
 #include <stdint.h>
 #include <windows.h>
@@ -104,7 +105,8 @@ static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *exp
                                                  intptr_t desired)
 {
     intptr_t old = *expected;
-    *expected = InterlockedCompareExchangePointer(object, desired, old);
+    *expected = (intptr_t)InterlockedCompareExchangePointer(
+        (PVOID *)object, (PVOID)desired, (PVOID)old);
     return *expected == old;
 }