}
#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 */
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 */
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)
{