https://git.reactos.org/?p=reactos.git;a=commitdiff;h=960511094b6110b383af1f7e005ef35aa24b292b

commit 960511094b6110b383af1f7e005ef35aa24b292b
Author:     Thomas Faber <[email protected]>
AuthorDate: Fri Aug 14 09:19:21 2020 +0200
Commit:     Thomas Faber <[email protected]>
CommitDate: Fri Aug 14 11:08:45 2020 +0200

    [XDK] Avoid defining interlocked intrinsics. CORE-17190
    
    Fixes build with MSVC 19.27+.
---
 sdk/include/xdk/interlocked.h | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/sdk/include/xdk/interlocked.h b/sdk/include/xdk/interlocked.h
index 6a956c8edd4..dbdd46e38f6 100644
--- a/sdk/include/xdk/interlocked.h
+++ b/sdk/include/xdk/interlocked.h
@@ -301,9 +301,11 @@
 
 #ifdef _M_IX86
 
+#undef _InterlockedExchange64
+#define _InterlockedExchange64 _InlineInterlockedExchange64
 FORCEINLINE
 LONG64
-_InterlockedExchange64(
+_InlineInterlockedExchange64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value)
 {
@@ -316,9 +318,11 @@ _InterlockedExchange64(
     }
 }
 
+#undef _InterlockedAdd64
+#define _InterlockedAdd64 _InlineInterlockedAdd64
 FORCEINLINE
 LONG64
-_InterlockedAdd64(
+_InlineInterlockedAdd64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value)
 {
@@ -332,9 +336,11 @@ _InterlockedAdd64(
     }
 }
 
+#undef _InterlockedExchangeAdd64
+#define _InterlockedExchangeAdd64 _InlineInterlockedExchangeAdd64
 FORCEINLINE
 LONG64
-_InterlockedExchangeAdd64 (
+_InlineInterlockedExchangeAdd64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value
     )
@@ -349,9 +355,11 @@ _InterlockedExchangeAdd64 (
     }
 }
 
+#undef _InterlockedAnd64
+#define _InterlockedAnd64 _InlineInterlockedAnd64
 FORCEINLINE
 LONG64
-_InterlockedAnd64(
+_InlineInterlockedAnd64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value)
 {
@@ -365,9 +373,11 @@ _InterlockedAnd64(
     }
 }
 
+#undef _InterlockedOr64
+#define _InterlockedOr64 _InlineInterlockedOr64
 FORCEINLINE
 LONG64
-_InterlockedOr64(
+_InlineInterlockedOr64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value)
 {
@@ -381,9 +391,11 @@ _InterlockedOr64(
     }
 }
 
+#undef _InterlockedXor64
+#define _InterlockedXor64 _InlineInterlockedXor64
 FORCEINLINE
 LONG64
-_InterlockedXor64(
+_InlineInterlockedXor64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target,
     _In_ LONG64 Value)
 {
@@ -397,17 +409,21 @@ _InterlockedXor64(
     }
 }
 
+#undef _InterlockedIncrement64
+#define _InterlockedIncrement64 _InlineInterlockedIncrement64
 FORCEINLINE
 LONG64
-_InterlockedIncrement64(
+_InlineInterlockedIncrement64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target)
 {
     return _InterlockedAdd64(Target, 1);
 }
 
+#undef _InterlockedDecrement64
+#define _InterlockedDecrement64 _InlineInterlockedDecrement64
 FORCEINLINE
 LONG64
-_InterlockedDecrement64(
+_InlineInterlockedDecrement64(
     _Inout_ _Interlocked_operand_ volatile LONG64 *Target)
 {
     return _InterlockedAdd64(Target, -1);

Reply via email to