diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-05-12 18:53:55 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-05-16 09:59:19 +0100 |
commit | 5baabdb15d0ee24da414f273a5bafd5eca262ede (patch) | |
tree | 8a55395832bd6606c544a67c0bb742acfebc26e9 /libstdc++-v3/config.h.in | |
parent | 0d76fb1582c1fc38e4f214b90f42f9536e071342 (diff) | |
download | gcc-5baabdb15d0ee24da414f273a5bafd5eca262ede.zip gcc-5baabdb15d0ee24da414f273a5bafd5eca262ede.tar.gz gcc-5baabdb15d0ee24da414f273a5bafd5eca262ede.tar.bz2 |
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/config.h.in')
-rw-r--r-- | libstdc++-v3/config.h.in | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 8e037fb..62be4c7 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -910,11 +910,19 @@ namespace std::tr1. */ #undef _GLIBCXX_USE_C99_FENV_TR1 +/* Define if C99 functions in <inttypes.h> should be imported in <cinttypes> + in namespace std in C++11. */ +#undef _GLIBCXX_USE_C99_INTTYPES + /* Define if C99 functions in <inttypes.h> should be imported in <tr1/cinttypes> in namespace std::tr1. */ #undef _GLIBCXX_USE_C99_INTTYPES_TR1 /* Define if wchar_t C99 functions in <inttypes.h> should be imported in + <cinttypes> in namespace std in C++11. */ +#undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T + +/* Define if wchar_t C99 functions in <inttypes.h> should be imported in <tr1/cinttypes> in namespace std::tr1. */ #undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 @@ -922,6 +930,10 @@ <tr1/cmath> in namespace std::tr1. */ #undef _GLIBCXX_USE_C99_MATH_TR1 +/* Define if C99 types in <stdint.h> should be imported in <cstdint> in + namespace std for C++11. */ +#undef _GLIBCXX_USE_C99_STDINT + /* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in namespace std::tr1. */ #undef _GLIBCXX_USE_C99_STDINT_TR1 |