From a4ae16b67ae3145ab0261d1ab8fb15a52569a5c3 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 14 Oct 2015 08:36:22 +0000 Subject: [PATCH] Fix GCC atomic implementation in C++03 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250279 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/atomic | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/atomic b/include/atomic index 13965fbd..b5d5a27b 100644 --- a/include/atomic +++ b/include/atomic @@ -552,7 +552,12 @@ typedef enum memory_order namespace __gcc_atomic { template struct __gcc_atomic_t { - __gcc_atomic_t() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY +#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS + __gcc_atomic_t() _NOEXCEPT = default; +#else + __gcc_atomic_t() _NOEXCEPT : __a_value() {} +#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS _LIBCPP_CONSTEXPR explicit __gcc_atomic_t(_Tp value) _NOEXCEPT : __a_value(value) {} _Tp __a_value; @@ -573,7 +578,7 @@ struct __can_assign { sizeof(__test_atomic_assignable<_Tp, _Td>(1)) == sizeof(char); }; -static inline constexpr int __to_gcc_order(memory_order __order) { +static inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { // Avoid switch statement to make this a constexpr. return __order == memory_order_relaxed ? __ATOMIC_RELAXED: (__order == memory_order_acquire ? __ATOMIC_ACQUIRE: @@ -583,7 +588,7 @@ static inline constexpr int __to_gcc_order(memory_order __order) { __ATOMIC_CONSUME)))); } -static inline constexpr int __to_gcc_failure_order(memory_order __order) { +static inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) { // Avoid switch statement to make this a constexpr. return __order == memory_order_relaxed ? __ATOMIC_RELAXED: (__order == memory_order_acquire ? __ATOMIC_ACQUIRE: