]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Stop using _GLIBCXX_USE_C99_STDINT_TR1 in <cstdint>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 17:53:55 +0000 (18:53 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 16 May 2023 08:59:19 +0000 (09:59 +0100)
commit5baabdb15d0ee24da414f273a5bafd5eca262ede
tree8a55395832bd6606c544a67c0bb742acfebc26e9
parent0d76fb1582c1fc38e4f214b90f42f9536e071342
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.
14 files changed:
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/doc/doxygen/user.cfg.in
libstdc++-v3/include/bits/chrono.h
libstdc++-v3/include/c_compatibility/inttypes.h
libstdc++-v3/include/c_compatibility/stdatomic.h
libstdc++-v3/include/c_compatibility/stdint.h
libstdc++-v3/include/c_global/cinttypes
libstdc++-v3/include/c_global/cstdint
libstdc++-v3/include/std/atomic
libstdc++-v3/src/c++11/cow-stdexcept.cc
libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc
libstdc++-v3/testsuite/lib/libstdc++.exp