diff --git a/stl/inc/atomic b/stl/inc/atomic index 96e2c387467..8881fae37a8 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -728,7 +728,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics return reinterpret_cast<_Ty&>(_As_bytes); } -#ifdef _M_IX86 +#if defined(_M_IX86) && defined(__clang__) // TRANSITION, LLVM-46595 _Ty exchange(const _Ty _Value, const memory_order _Order = memory_order_seq_cst) noexcept { // exchange with (effectively) sequential consistency _Ty _Temp{load()}; @@ -737,7 +737,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics return _Temp; } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) && defined(__clang__), LLVM-46595 / !defined(_M_IX86) || !defined(__clang__) vvv _Ty exchange(const _Ty _Value, const memory_order _Order = memory_order_seq_cst) noexcept { // exchange with given memory order long long _As_bytes; @@ -745,7 +745,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics _Atomic_reinterpret_as(_Value)); return reinterpret_cast<_Ty&>(_As_bytes); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) || !defined(__clang__) ^^^ bool compare_exchange_strong(_Ty& _Expected, const _Ty _Desired, const memory_order _Order = memory_order_seq_cst) noexcept { // CAS with given memory order @@ -1067,7 +1067,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper using _Base::_Base; #endif // ^^^ no workaround ^^^ -#ifdef _M_IX86 +#if defined(_M_IX86) && defined(__clang__) // TRANSITION, LLVM-46595 _Ty fetch_add(const _Ty _Operand, const memory_order _Order = memory_order_seq_cst) noexcept { // effectively sequential consistency _Ty _Temp{this->load()}; @@ -1120,7 +1120,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper return fetch_add(static_cast<_Ty>(-1)) - static_cast<_Ty>(1); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) && defined(__clang__), LLVM-46595 / !defined(_M_IX86) || !defined(__clang__) vvv _Ty fetch_add(const _Ty _Operand, const memory_order _Order = memory_order_seq_cst) noexcept { long long _Result; _ATOMIC_CHOOSE_INTRINSIC(_Order, _Result, _InterlockedExchangeAdd64, @@ -1170,7 +1170,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper _Ty operator--() noexcept { return static_cast<_Ty>(_InterlockedDecrement64(_Atomic_address_as(this->_Storage))); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) || !defined(__clang__) ^^^ }; #if 1 // TRANSITION, ABI