aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config.h.in
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-05-13 00:57:15 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-05-31 21:01:16 +0100
commit1f378f6dd33ad5067a437d1c456979f8662020d6 (patch)
tree255394acfc51f529940024c77bebc8c61cc01c32 /libstdc++-v3/config.h.in
parentfb409a15d9babc78fe1d9957afcbaf1102cce58f (diff)
downloadgcc-1f378f6dd33ad5067a437d1c456979f8662020d6.zip
gcc-1f378f6dd33ad5067a437d1c456979f8662020d6.tar.gz
gcc-1f378f6dd33ad5067a437d1c456979f8662020d6.tar.bz2
libstdc++: Stop using _GLIBCXX_USE_C99_MATH_TR1 in <cmath>
Similar to the three commits r14-908, r14-909 and r14-910, the _GLIBCXX_USE_C99_MATH_TR1 macro is misleading when it is also used for <cmath>, not only for <tr1/cmath> headers. It is also wrong, because the configure checks for TR1 use -std=c++98 and a target might define the C99 features for C++11 but not for C++98. Add separate configure checks for the <math.h> functions using -std=c++11 for the checks. Use the new macro defined by those checks in the C++11-specific parts of <cmath>, and in <complex>, <random> etc. The check that defines _GLIBCXX_NO_C99_ROUNDING_FUNCS is only needed for the C++11 <cmath> checks, so remove that from GLIBCXX_CHECK_C99_TR1 and only do it for GLIBCXX_ENABLE_C99. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_C99): Add checks for C99 math functions and define _GLIBCXX_USE_C99_MATH_FUNCS. Move checks for C99 rounding functions to here. (GLIBCXX_CHECK_C99_TR1): Remove checks for C99 rounding functions from here. * config.h.in: Regenerate. * configure: Regenerate. * include/bits/random.h: Use _GLIBCXX_USE_C99_MATH_FUNCS instead of _GLIBCXX_USE_C99_MATH_TR1. * include/bits/random.tcc: Likewise. * include/c_compatibility/math.h: Likewise. * include/c_global/cmath: Likewise. * include/ext/random: Likewise. * include/ext/random.tcc: Likewise. * include/std/complex: Likewise. * testsuite/20_util/from_chars/4.cc: Likewise. * testsuite/20_util/from_chars/8.cc: Likewise. * testsuite/26_numerics/complex/proj.cc: Likewise. * testsuite/26_numerics/headers/cmath/60401.cc: Likewise. * testsuite/26_numerics/headers/cmath/types_std_c++0x.cc: Likewise. * testsuite/lib/libstdc++.exp (check_v3_target_cstdint): Likewise. * testsuite/util/testsuite_random.h: Likewise.
Diffstat (limited to 'libstdc++-v3/config.h.in')
-rw-r--r--libstdc++-v3/config.h.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index bbb2613..4fbf5ef 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -779,8 +779,8 @@
C99 library functions to be present. */
#undef _GLIBCXX11_USE_C99_COMPLEX
-/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
- in namespace std for C++11. */
+/* Define if C99 generic macros in <math.h> should be imported in <cmath> in
+ namespace std for C++11. */
#undef _GLIBCXX11_USE_C99_MATH
/* Define if C99 functions or macros in <stdio.h> should be imported in
@@ -938,6 +938,10 @@
<tr1/cinttypes> in namespace std::tr1. */
#undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
+/* Define if C99 functions in <math.h> should be imported in <cmath> in
+ namespace std for C++11. */
+#undef _GLIBCXX_USE_C99_MATH_FUNCS
+
/* Define if C99 functions or macros in <math.h> should be imported in
<tr1/cmath> in namespace std::tr1. */
#undef _GLIBCXX_USE_C99_MATH_TR1