Commit 52e6723c by Benjamin Kosnik Committed by Benjamin Kosnik

acinclude.m4 (GLIBCXX_ENABLE_C99): Test for complex math functions...


2005-01-25  Benjamin Kosnik  <bkoz@redhat.com>

	* acinclude.m4 (GLIBCXX_ENABLE_C99): Test for complex math
	functions, and enable _GLIBCXX_USE_C99_COMPLEX_MATH if they exist.
	* acconfig.h: Add _GLIBCXX_USE_C99_COMPLEX_MATH.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/std/std_complex.h: Protect complex builtins with
	_GLIBCXX_USE_C99_COMPLEX_MATH.

From-SVN: r94221
parent e71c0aa7
2005-01-25 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE_C99): Test for complex math
functions, and enable _GLIBCXX_USE_C99_COMPLEX_MATH if they exist.
* acconfig.h: Add _GLIBCXX_USE_C99_COMPLEX_MATH.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/std/std_complex.h: Protect complex builtins with
_GLIBCXX_USE_C99_COMPLEX_MATH.
2005-01-24 Paolo Carlini <pcarlini@suse.de> 2005-01-24 Paolo Carlini <pcarlini@suse.de>
* include/tr1/type_traits: Implement is_signed and is_unsigned. * include/tr1/type_traits: Implement is_signed and is_unsigned.
......
...@@ -13,11 +13,14 @@ ...@@ -13,11 +13,14 @@
// Include I/O support for 'long long' and 'unsigned long long'. // Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCXX_USE_LONG_LONG #undef _GLIBCXX_USE_LONG_LONG
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
// Define if C99 math functions (like fpclassify) should be exposed. // Define if C99 math functions (like fpclassify) should be exposed.
#undef _GLIBCXX_USE_C99_MATH #undef _GLIBCXX_USE_C99_MATH
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed. // Define if C99 complex math functions should be used in std::complex.
#undef _GLIBCXX_USE_C99 #undef _GLIBCXX_USE_C99_COMPLEX_MATH
// Define if code specialized for wchar_t should be used. // Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T #undef _GLIBCXX_USE_WCHAR_T
......
...@@ -871,6 +871,121 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [ ...@@ -871,6 +871,121 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
AC_DEFINE(_GLIBCXX_USE_C99_MATH) AC_DEFINE(_GLIBCXX_USE_C99_MATH)
fi fi
# Check for the existence of <math.h> complex functions.
# This is necessary even though libstdc++ uses the builtin versions
# of these functions, because if the builtin cannot be used, a reference
# to the library function is emitted.
AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no)
ac_c99_complex=no;
if test x"$ac_has_complex_h" = x"yes"; then
ac_c99_complex=yes;
AC_MSG_CHECKING([for ISO C99 support in <complex.h>])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
cabsf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
cabs(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
cabsl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
cargf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
carg(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
cargl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
ccosf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
ccos(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
ccosl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
ccoshf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
ccosh(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
ccoshl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
cexpf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
cexp(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
cexpl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
csinf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
csin(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
csinl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
csinhf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
csinh(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
csinhl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
csqrtf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
csqrt(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
csqrtl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
ctanf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
ctan(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
ctanl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
ctanhf(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
ctanh(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
ctanhl(tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ float _ComplexT; _ComplexT tmp;
cpowf(tmp, tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ double _ComplexT; _ComplexT tmp;
cpow(tmp, tmp);],, [ac_c99_complex=no])
AC_TRY_COMPILE([#include <complex.h>],
[typedef __complex__ long double _ComplexT; _ComplexT tmp;
cpowl(tmp, tmp);],, [ac_c99_complex=no])
fi
AC_MSG_RESULT($ac_c99_complex)
if test x"$ac_c99_complex" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX_MATH)
fi
# Check for the existence in <stdio.h> of vscanf, et. al. # Check for the existence in <stdio.h> of vscanf, et. al.
ac_c99_stdio=yes; ac_c99_stdio=yes;
AC_MSG_CHECKING([for ISO C99 support in <stdio.h>]) AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
......
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
// Include I/O support for 'long long' and 'unsigned long long'. // Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCXX_USE_LONG_LONG #undef _GLIBCXX_USE_LONG_LONG
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
// Define if C99 math functions (like fpclassify) should be exposed. // Define if C99 math functions (like fpclassify) should be exposed.
#undef _GLIBCXX_USE_C99_MATH #undef _GLIBCXX_USE_C99_MATH
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed. // Define if C99 complex math functions should be used in std::complex.
#undef _GLIBCXX_USE_C99 #undef _GLIBCXX_USE_C99_COMPLEX_MATH
// Define if code specialized for wchar_t should be used. // Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T #undef _GLIBCXX_USE_WCHAR_T
...@@ -200,6 +203,9 @@ ...@@ -200,6 +203,9 @@
/* Define to 1 if you have the `ceill' function. */ /* Define to 1 if you have the `ceill' function. */
#undef HAVE_CEILL #undef HAVE_CEILL
/* Define to 1 if you have the <complex.h> header file. */
#undef HAVE_COMPLEX_H
/* Define to 1 if you have the `copysign' function. */ /* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN #undef HAVE_COPYSIGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment