From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id BD9743858C54; Fri, 12 May 2023 16:48:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD9743858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683910102; bh=ca2IV6P+MZNrOATJjEv0JWVWzUiHRZkvYDJQK13pkME=; h=From:To:Subject:Date:From; b=YOndo9Py0ggzPpXeNEMH++f05lpy79/gjBFU8G1XUqYk2pFZloyXKPyp947xFwDnC OwuSsyhxsley0ogGtB1k2U4/WJw8d+RSZjZCbMAYOY4yngNcXnGIES2s8SIspWyLeG PMC6/wN7FAziTAJCs41oHWSg5jBmql3qOaxumvcE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-796] libstdc++: Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1 X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 1953c0cfb006a696723baa7d5ea14038f6d901a4 X-Git-Newrev: 6d664515720bb277d49eb1457477a9d88f4ba5ed Message-Id: <20230512164822.BD9743858C54@sourceware.org> Date: Fri, 12 May 2023 16:48:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6d664515720bb277d49eb1457477a9d88f4ba5ed commit r14-796-g6d664515720bb277d49eb1457477a9d88f4ba5ed Author: Jonathan Wakely Date: Fri May 12 13:55:17 2023 +0100 libstdc++: Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1 Since r9-2028-g8ba7f29e3dd064 we've defined most of unconditionally, including uint_least32_t. This means that all of can be defined unconditionally, which means that std::shuffle and std::ranges::shuffle can be too. libstdc++-v3/ChangeLog: * include/bits/algorithmfwd.h (shuffle): Do not depend on _GLIBCXX_USE_C99_STDINT_TR1. * include/bits/ranges_algo.h (shuffle): Likewise. * include/bits/stl_algo.h (shuffle): Likewise. * include/ext/random: Likewise. * include/ext/throw_allocator.h (random_condition): Likewise. * include/std/random: Likewise. * src/c++11/cow-string-inst.cc: Likewise. * src/c++11/random.cc: Likewise. Diff: --- libstdc++-v3/include/bits/algorithmfwd.h | 2 +- libstdc++-v3/include/bits/ranges_algo.h | 2 -- libstdc++-v3/include/bits/stl_algo.h | 3 --- libstdc++-v3/include/ext/random | 4 ++-- libstdc++-v3/include/ext/throw_allocator.h | 8 -------- libstdc++-v3/include/std/random | 7 +------ libstdc++-v3/src/c++11/cow-string-inst.cc | 2 -- libstdc++-v3/src/c++11/random.cc | 3 --- 8 files changed, 4 insertions(+), 27 deletions(-) diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index 03e627866ad..0d623901cd2 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -622,7 +622,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2) // set_symmetric_difference // set_union -#if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#if __cplusplus >= 201103L template void shuffle(_RAIter, _RAIter, _UGenerator&&); diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h index 410d3ae1dd8..da66ff8045d 100644 --- a/libstdc++-v3/include/bits/ranges_algo.h +++ b/libstdc++-v3/include/bits/ranges_algo.h @@ -1564,7 +1564,6 @@ namespace ranges inline constexpr __sample_fn sample{}; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 struct __shuffle_fn { template _Sent, @@ -1591,7 +1590,6 @@ namespace ranges }; inline constexpr __shuffle_fn shuffle{}; -#endif struct __push_heap_fn { diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 3d37091a9b4..54695490166 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -3692,7 +3692,6 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2) #endif // C++17 #endif // C++14 -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /** * @brief Generate two uniformly distributed integers using a * single distribution invocation. @@ -3803,8 +3802,6 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) std::iter_swap(__i, __first + __d(__g, __p_type(0, __i - __first))); } -#endif // USE C99_STDINT - #endif // C++11 _GLIBCXX_BEGIN_NAMESPACE_ALGO diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 795c3c5389a..62acb67e05b 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -45,7 +45,7 @@ # include #endif -#if defined(_GLIBCXX_USE_C99_STDINT_TR1) && defined(UINT32_C) +#ifdef UINT32_C namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { @@ -3923,7 +3923,7 @@ _GLIBCXX_END_NAMESPACE_VERSION #include #include -#endif // _GLIBCXX_USE_C99_STDINT_TR1 && UINT32_C +#endif // UINT32_C #endif // C++11 diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 0dbf00176dc..71b7198fa1e 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -495,7 +495,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /** * @brief Base class for random probability control and throw. */ @@ -613,7 +612,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return _S_e; } }; -#endif // _GLIBCXX_USE_C99_STDINT_TR1 /** * @brief Class with exception generation control. Intended to be @@ -769,7 +767,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif }; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /// Type throwing via random condition. struct throw_value_random : public throw_value_base { @@ -800,7 +797,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator=(throw_value_random&&) = default; #endif }; -#endif // _GLIBCXX_USE_C99_STDINT_TR1 /** * @brief Allocator class with logging and exception generation control. @@ -947,7 +943,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif }; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /// Allocator throwing via random condition. template struct throw_allocator_random @@ -973,7 +968,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator=(const throw_allocator_random&) = default; #endif }; -#endif // _GLIBCXX_USE_C99_STDINT_TR1 _GLIBCXX_END_NAMESPACE_VERSION } // namespace @@ -1002,7 +996,6 @@ namespace std _GLIBCXX_VISIBILITY(default) } }; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /// Explicit specialization of std::hash for __gnu_cxx::throw_value_random. template<> struct hash<__gnu_cxx::throw_value_random> @@ -1017,7 +1010,6 @@ namespace std _GLIBCXX_VISIBILITY(default) return __result; } }; -#endif #pragma GCC diagnostic pop } // end namespace std diff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random index e6591bc48a7..a0785a46019 100644 --- a/libstdc++-v3/include/std/random +++ b/libstdc++-v3/include/std/random @@ -38,22 +38,17 @@ #else #include +#include // For uint_fast32_t, uint_fast64_t, uint_least32_t #include #include #include #include #include #include - -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 - -#include // For uint_fast32_t, uint_fast64_t, uint_least32_t #include #include #include -#endif // _GLIBCXX_USE_C99_STDINT_TR1 - #endif // C++11 #endif // _GLIBCXX_RANDOM diff --git a/libstdc++-v3/src/c++11/cow-string-inst.cc b/libstdc++-v3/src/c++11/cow-string-inst.cc index c6b3a2cce1e..5a2b8ffa568 100644 --- a/libstdc++-v3/src/c++11/cow-string-inst.cc +++ b/libstdc++-v3/src/c++11/cow-string-inst.cc @@ -33,7 +33,6 @@ # error This file should not be compiled for this configuration. #endif -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 #include namespace std _GLIBCXX_VISIBILITY(default) @@ -46,4 +45,3 @@ namespace std _GLIBCXX_VISIBILITY(default) random_device::_M_init_pretr1(const std::string& token) { _M_init(token.c_str(), token.length()); } } // namespace -#endif diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index daf934808cc..6ecdc7169ab 100644 --- a/libstdc++-v3/src/c++11/random.cc +++ b/libstdc++-v3/src/c++11/random.cc @@ -28,8 +28,6 @@ #include #include -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 - #if defined __i386__ || defined __x86_64__ # include # ifdef _GLIBCXX_X86_RDRAND @@ -674,4 +672,3 @@ namespace std _GLIBCXX_VISIBILITY(default) template struct __detail::_Mod; #endif } -#endif // _GLIBCXX_USE_C99_STDINT_TR1