[committed] libstdc++: Reduce <atomic> dependency on _GLIBCXX_USE_C99_STDINT_TR1
Checks
Commit Message
Tested powerpc64le-linux. Pushed to trunk.
-- >8 --
Since r9-2028-g8ba7f29e3dd064 we've defined most of <cstdint>
unconditionally, so we can do the same for most of the std::atomic
aliases such as std::atomic_int_least32_t.
The only aliases that need to depend on _GLIBCXX_USE_C99_STDINT_TR1 are
the ones for the integer types that are not guaranteed to be defined,
e.g. std::atomic_int32_t.
libstdc++-v3/ChangeLog:
* include/std/atomic (atomic_int_least8_t, atomic_uint_least8_t)
(atomic_int_least16_t, atomic_uint_least16_t)
(atomic_int_least32_t, atomic_uint_least32_t)
(atomic_int_least64_t, atomic_uint_least64_t)
(atomic_int_fast16_t, atomic_uint_fast16_t)
(atomic_int_fast32_t, atomic_uint_fast32_t)
(atomic_int_fast64_t, atomic_uint_fast64_t)
(atomic_intmax_t, atomic_uintmax_t): Define unconditionally.
* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Adjust.
---
libstdc++-v3/include/std/atomic | 5 +----
.../testsuite/29_atomics/headers/stdatomic.h/c_compat.cc | 4 +---
2 files changed, 2 insertions(+), 7 deletions(-)
@@ -1130,7 +1130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// atomic_uint64_t
typedef atomic<uint64_t> atomic_uint64_t;
-
+#endif
/// atomic_int_least8_t
typedef atomic<int_least8_t> atomic_int_least8_t;
@@ -1180,7 +1180,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// atomic_uint_fast64_t
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
-#endif
/// atomic_intptr_t
@@ -1195,13 +1194,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// atomic_ptrdiff_t
typedef atomic<ptrdiff_t> atomic_ptrdiff_t;
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
/// atomic_intmax_t
typedef atomic<intmax_t> atomic_intmax_t;
/// atomic_uintmax_t
typedef atomic<uintmax_t> atomic_uintmax_t;
-#endif
// Function definitions, atomic_flag operations.
inline bool
@@ -79,6 +79,7 @@ static_assert(is_same<atomic_int32_t, _Atomic(int32_t)>);
static_assert(is_same<atomic_uint32_t, _Atomic(uint32_t)>);
static_assert(is_same<atomic_int64_t, _Atomic(int64_t)>);
static_assert(is_same<atomic_uint64_t, _Atomic(uint64_t)>);
+#endif
static_assert(is_same<atomic_int_least8_t, _Atomic(int_least8_t)>);
static_assert(is_same<atomic_uint_least8_t, _Atomic(uint_least8_t)>);
static_assert(is_same<atomic_int_least16_t, _Atomic(int_least16_t)>);
@@ -95,13 +96,10 @@ static_assert(is_same<atomic_int_fast32_t, _Atomic(int_fast32_t)>);
static_assert(is_same<atomic_uint_fast32_t, _Atomic(uint_fast32_t)>);
static_assert(is_same<atomic_int_fast64_t, _Atomic(int_fast64_t)>);
static_assert(is_same<atomic_uint_fast64_t, _Atomic(uint_fast64_t)>);
-#endif
static_assert(is_same<atomic_intptr_t, _Atomic(intptr_t)>);
static_assert(is_same<atomic_uintptr_t, _Atomic(uintptr_t)>);
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
static_assert(is_same<atomic_intmax_t, _Atomic(intmax_t)>);
static_assert(is_same<atomic_uintmax_t, _Atomic(uintmax_t)>);
-#endif
#include <stddef.h>
static_assert(is_same<atomic_size_t, _Atomic(size_t)>);
static_assert(is_same<atomic_ptrdiff_t, _Atomic(ptrdiff_t)>);