]> granicus.if.org Git - clang/commitdiff
Intrin.h: Implement _InterlockedExchangePointer
authorReid Kleckner <reid@kleckner.net>
Wed, 26 Mar 2014 16:09:48 +0000 (16:09 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 26 Mar 2014 16:09:48 +0000 (16:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204827 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/Intrin.h

index 2ed88301cf9b657a2d6b6a1747e1af137be3ced5..90a218e6297158c9d77412538ac42e59bcbaebd3 100644 (file)
@@ -422,6 +422,7 @@ static __inline__
 __int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
 static __inline__
 __int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
+static __inline__
 void *_InterlockedExchangePointer(void *volatile *_Target, void *_Value);
 static __inline__
 __int64 _InterlockedIncrement64(__int64 volatile *_Addend);
@@ -795,6 +796,11 @@ _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value) {
   __atomic_exchange(_Target, &_Value, &_Value, 0);
   return _Value;
 }
+static __inline__ void *__attribute__((__always_inline__, __nodebug__))
+_InterlockedExchangePointer(void *volatile *_Target, void *_Value) {
+  __atomic_exchange(_Target, &_Value, &_Value, 0);
+  return _Value;
+}
 #endif
 /*----------------------------------------------------------------------------*\
 |* Interlocked Compare Exchange