summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/c_compatibility/inttypes.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-05-12 18:53:55 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-05-16 09:59:19 +0100
commit5baabdb15d0ee24da414f273a5bafd5eca262ede (patch)
tree8a55395832bd6606c544a67c0bb742acfebc26e9 /libstdc++-v3/include/c_compatibility/inttypes.h
parent0d76fb1582c1fc38e4f214b90f42f9536e071342 (diff)
downloadgcc-5baabdb15d0ee24da414f273a5bafd5eca262ede.tar.gz
libstdc++: Stop using _GLIBCXX_USE_C99_STDINT_TR1 in <cstdint>
The _GLIBCXX_USE_C99_STDINT_TR1 macro (and the comments about it in acinclude.m4 and config.h) are misleading when it is also used for <stdint>, not only <tr1/stdint>. It is also wrong, because the configure checks for TR1 use -std=c++98 and a target might define uint32_t etc. for C++11 but not for C++98. Add a separate configure check for the <stdint.h> types using -std=c++11 for the checks. Use the result of that separate check in <cstdint> and most other places that still depend on the macro (many uses of that macro have been removed already). The remaining uses of the STDINT_TR1 macro are really for TR1, or are in the src/c++11/compatibility-*.cc files, where we don't want/need to change the condition they depend on (if those symbols were only exported when <stdint.h> types were available for -std=c++98, then that's the condition we should continue to use for whether to export the compat symbols now). Make similar changes for the related _GLIBCXX_USE_C99_INTTYPES_TR1 and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 macros, adding new macros for non-TR1 uses. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_USE_C99): Check for <stdint.h> types in C++11 mode and define _GLIBCXX_USE_C99_STDINT. Check for <inttypes.h> features in C++11 mode and define _GLIBCXX_USE_C99_INTTYPES and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T. * config.h.in: Regenerate. * configure: Regenerate. * doc/doxygen/user.cfg.in (PREDEFINED): Add new macros. * include/bits/chrono.h: Check _GLIBCXX_USE_C99_STDINT instead of _GLIBCXX_USE_C99_STDINT_TR1. * include/c_compatibility/inttypes.h: Check _GLIBCXX_USE_C99_INTTYPES and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T instead of _GLIBCXX_USE_C99_INTTYPES_TR1 and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1. * include/c_compatibility/stdatomic.h: Check _GLIBCXX_USE_C99_STDINT instead of _GLIBCXX_USE_C99_STDINT_TR1. * include/c_compatibility/stdint.h: Likewise. * include/c_global/cinttypes: Check _GLIBCXX_USE_C99_INTTYPES and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T instead of _GLIBCXX_USE_C99_INTTYPES_TR1 and _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1. * include/c_global/cstdint: Check _GLIBCXX_USE_C99_STDINT instead of _GLIBCXX_USE_C99_STDINT_TR1. * include/std/atomic: Likewise. * src/c++11/cow-stdexcept.cc: Likewise. * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Likewise. * testsuite/lib/libstdc++.exp (check_v3_target_cstdint): Likewise.
Diffstat (limited to 'libstdc++-v3/include/c_compatibility/inttypes.h')
-rw-r--r--libstdc++-v3/include/c_compatibility/inttypes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/include/c_compatibility/inttypes.h b/libstdc++-v3/include/c_compatibility/inttypes.h
index 9c2b7d6c68d..070fcbcc1f2 100644
--- a/libstdc++-v3/include/c_compatibility/inttypes.h
+++ b/libstdc++-v3/include/c_compatibility/inttypes.h
@@ -48,7 +48,7 @@
# endif
# endif
-#ifdef _GLIBCXX_USE_C99_INTTYPES_TR1
+#ifdef _GLIBCXX_USE_C99_INTTYPES
namespace std
{
@@ -72,13 +72,13 @@ namespace std
using ::strtoimax;
using ::strtoumax;
-#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T
using ::wcstoimax;
using ::wcstoumax;
#endif
} // namespace
-#endif _GLIBCXX_USE_C99_INTTYPES_TR1
+#endif _GLIBCXX_USE_C99_INTTYPES
#else