[CRT/INTRIN_X86]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 7 Sep 2014 17:09:34 +0000 (17:09 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 7 Sep 2014 17:09:34 +0000 (17:09 +0000)
* Skip some intrinsics when compiling with Clang.

svn path=/trunk/; revision=64062

reactos/include/crt/mingw32/intrin_x86.h

index d9dcced..61ee6fb 100644 (file)
@@ -190,17 +190,19 @@ __INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Desti
 }
 
 #ifndef __clang__
+
 __INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
 {
        return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
-#endif
 
 __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
 {
        return (void *)__sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
+#endif
+
 __INTRIN_INLINE char _InterlockedExchange8(volatile char * const Target, const char Value)
 {
        /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
@@ -215,6 +217,8 @@ __INTRIN_INLINE short _InterlockedExchange16(volatile short * const Target, cons
        return __sync_lock_test_and_set(Target, Value);
 }
 
+#ifndef __clang__
+
 __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
 {
        /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
@@ -222,21 +226,23 @@ __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const lo
        return __sync_lock_test_and_set(Target, Value);
 }
 
-#if defined(_M_AMD64)
-__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value)
+__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
 {
        /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
        __sync_synchronize();
-       return __sync_lock_test_and_set(Target, Value);
+       return (void *)__sync_lock_test_and_set(Target, Value);
 }
+
 #endif
 
-__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
+#if defined(_M_AMD64)
+__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value)
 {
        /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
        __sync_synchronize();
-       return (void *)__sync_lock_test_and_set(Target, Value);
+       return __sync_lock_test_and_set(Target, Value);
 }
+#endif
 
 __INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
 {