aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-05-12 12:44:03 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-05-16 09:59:19 +0100
commit0d76fb1582c1fc38e4f214b90f42f9536e071342 (patch)
tree6dc945f1ef56c9d508cdcaabda02a9340f39269b /libstdc++-v3/acinclude.m4
parentbf904527ab6de99106ae59c3957348006019c4cf (diff)
downloadgcc-0d76fb1582c1fc38e4f214b90f42f9536e071342.zip
gcc-0d76fb1582c1fc38e4f214b90f42f9536e071342.tar.gz
gcc-0d76fb1582c1fc38e4f214b90f42f9536e071342.tar.bz2
libstdc++: Stop using _GLIBCXX_USE_C99_COMPLEX_TR1 in <complex>
The _GLIBCXX_USE_C99_COMPLEX_TR1 macro (and the comments about it in acinclude.m4 and config.h) are misleading when it is also used for <complex>, not only <tr1/complex>. It is also wrong, because the configure checks for TR1 use -std=c++98 and a target might define cacos etc. for C++11 but not for C++98. Add a separate configure check for the inverse trigonometric functions that are covered by _GLIBCXX_USE_C99_COMPLEX_TR1, but using -std=c++11 for the checks. Use the result of that separate check in <complex>. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_USE_C99): Check for complex inverse trig functions in C++11 mode and define _GLIBCXX_USE_C99_COMPLEX_ARC. * config.h.in: Regenerate. * configure: Regenerate. * doc/doxygen/user.cfg.in (PREDEFINED): Add new macro. * include/std/complex: Check _GLIBCXX_USE_C99_COMPLEX_ARC instead of _GLIBCXX_USE_C99_COMPLEX_TR1.
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 0ce3b8b..84b12ad 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1200,6 +1200,43 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
requires corresponding C99 library functions to be present.])
fi
+ # Check for the existence of <complex.h> complex inverse trigonometric
+ # math functions used by <complex> for C++11 and later.
+ ac_c99_complex_arc=no;
+ if test x"$ac_has_complex_h" = x"yes"; then
+ AC_MSG_CHECKING([for ISO C99 support for inverse trig functions in <complex.h>])
+ AC_TRY_COMPILE([#include <complex.h>],
+ [typedef __complex__ float float_type; float_type tmpf;
+ cacosf(tmpf);
+ casinf(tmpf);
+ catanf(tmpf);
+ cacoshf(tmpf);
+ casinhf(tmpf);
+ catanhf(tmpf);
+ typedef __complex__ double double_type; double_type tmpd;
+ cacos(tmpd);
+ casin(tmpd);
+ catan(tmpd);
+ cacosh(tmpd);
+ casinh(tmpd);
+ catanh(tmpd);
+ typedef __complex__ long double ld_type; ld_type tmpld;
+ cacosl(tmpld);
+ casinl(tmpld);
+ catanl(tmpld);
+ cacoshl(tmpld);
+ casinhl(tmpld);
+ catanhl(tmpld);
+ ],[ac_c99_complex_arc=yes], [ac_c99_complex_arc=no])
+ fi
+ AC_MSG_RESULT($ac_c99_complex_arc)
+ if test x"$ac_c99_complex_arc" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX_ARC, 1,
+ [Define if C99 inverse trig functions in <complex.h> should be
+ used in <complex>. Using compiler builtins for these functions
+ requires corresponding C99 library functions to be present.])
+ fi
+
# Check for the existence in <stdio.h> of vscanf, et. al.
AC_CACHE_CHECK([for ISO C99 support in <stdio.h> for C++11],
glibcxx_cv_c99_stdio_cxx11, [