aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-05-19 12:50:28 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-05-19 23:39:21 +0100
commit6f038efd93593da6e661b829d1bd3877e75550f1 (patch)
tree647d25b401c1b0ada6f122d6e9a440b82c8e786b /libstdc++-v3/src
parentf3e22baec0290c23654e99bf184153765944f4aa (diff)
downloadgcc-6f038efd93593da6e661b829d1bd3877e75550f1.zip
gcc-6f038efd93593da6e661b829d1bd3877e75550f1.tar.gz
gcc-6f038efd93593da6e661b829d1bd3877e75550f1.tar.bz2
libstdc++: Avoid including <cstdint> for std::char_traits
We should prefer the __UINT_LEAST16_TYPE__ and __UINT_LEAST32_TYPE__ macros, if available, so that we don't need all of <cstdint> in every header that uses std::char_traits. libstdc++-v3/ChangeLog: * include/bits/char_traits.h: Only include <cstdint> when necessary. * include/std/stacktrace: Use __UINTPTR_TYPE__ instead of uintptr_t. * src/c++11/cow-stdexcept.cc: Include <stdint.h>. * src/c++17/floating_to_chars.cc: Likewise. * testsuite/20_util/assume_aligned/1.cc: Include <cstdint>. * testsuite/20_util/assume_aligned/3.cc: Likewise. * testsuite/20_util/shared_ptr/creation/array.cc: Likewise.
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/c++11/cow-stdexcept.cc4
-rw-r--r--libstdc++-v3/src/c++17/floating_to_chars.cc2
2 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/src/c++11/cow-stdexcept.cc b/libstdc++-v3/src/c++11/cow-stdexcept.cc
index 5ccf2ca..9e87874 100644
--- a/libstdc++-v3/src/c++11/cow-stdexcept.cc
+++ b/libstdc++-v3/src/c++11/cow-stdexcept.cc
@@ -200,6 +200,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
#if _GLIBCXX_USE_WEAK_REF
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+#include <stdint.h>
+
+using std::size_t;
+
extern "C" {
#ifndef _GLIBCXX_MANGLE_SIZE_T
diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc
index 4599d68..b1c915e 100644
--- a/libstdc++-v3/src/c++17/floating_to_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_to_chars.cc
@@ -85,6 +85,8 @@ using F128_type = __float128;
using F128_type = void;
#endif
+#include <stdint.h>
+
namespace
{
#if defined __SIZEOF_INT128__