From 6327d11e068896f8bda8bebaecc146f01cdb1b5d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 7 Sep 2014 17:09:34 +0000 Subject: [PATCH] [CRT/INTRIN_X86] * Skip some intrinsics when compiling with Clang. svn path=/trunk/; revision=64062 --- reactos/include/crt/mingw32/intrin_x86.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/reactos/include/crt/mingw32/intrin_x86.h b/reactos/include/crt/mingw32/intrin_x86.h index d9dcced3002..61ee6fb6f9d 100644 --- a/reactos/include/crt/mingw32/intrin_x86.h +++ b/reactos/include/crt/mingw32/intrin_x86.h @@ -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) { -- 2.17.1