diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-24 13:15:43 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-24 13:15:43 +0000 |
commit | f8b67ee90fda9ae687d8f154ed09ce0b585f27d6 (patch) | |
tree | cde511fb00f0fef608bd92523dc754de32fc6ae2 /libstdc++-v3/acinclude.m4 | |
parent | 51ba582e7be7041c5f935fdee5fd061c0b9e3365 (diff) |
Handle C++11 <math.h> overloads on Solaris 12
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): New test.
* configure.ac: Use it.
* configure: Regenerate.
* config.h.in: Regenerate.
* include/c_global/cmath [__cplusplus >= 201103L]
(std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO.
(std::isfinite): Likewise.
(std::isinf): Likewise.
(std::isnan): Likewise.
(std::isnormal): Likewise.
(std::signbit): Likewise.
(std::isgreater): Likewise.
(std::isgreaterequal): Likewise.
(std::isless): Likewise.
(std::islessequal): Likewise.
(std::islessgreater): Likewise.
(std::isunordered): Likewise.
(std::acosh): Likewise.
(std::asinh): Likewise.
(std::atanh): Likewise.
(std::cbrt): Likewise.
(std::copysign): Likewise.
(std::erf): Likewise.
(std::erfc): Likewise.
(std::exp2): Likewise.
(std::expm1): Likewise.
(std::fdim): Likewise.
(std::fma): Likewise.
(std::fmax): Likewise.
(std::fmin): Likewise.
(std::hypot): Likewise.
(std::ilogb): Likewise.
(std::lgamma): Likewise.
(std::llrint): Likewise.
(std::llround): Likewise.
(std::log1p): Likewise.
(std::log2): Likewise.
(std::logb): Likewise.
(std::lrint): Likewise.
(std::lround): Likewise.
(std::nearbyint): Likewise.
(std::nextafter): Likewise.
(std::nexttoward): Likewise.
(std::remainder): Likewise.
(std::remquo): Likewise.
(std::rint): Likewise.
(std::round): Likewise.
(std::scalbln): Likewise.
(std::scalbn): Likewise.
(std::tgamma): Likewise.
(std::trunc): Likewise.
* include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1] (std::tr1::acosh):
Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO.
(std::tr1::asinh): Likewise.
(std::tr1::atanh): Likewise.
(std::tr1::cbrt): Likewise.
(std::tr1::copysign): Likewise.
(std::tr1::erf): Likewise.
(std::tr1::erfc): Likewise.
(std::tr1::exp2): Likewise.
(std::tr1::expm1): Likewise.
(std::tr1::fabs): Likewise.
(std::tr1::fdim): Likewise.
(std::tr1::fma): Likewise.
(std::tr1::fmax): Likewise.
(std::tr1::fmin): Likewise.
(std::tr1::hypot): Likewise.
(std::tr1::ilogb): Likewise.
(std::tr1::lgamma): Likewise.
(std::tr1::llrint): Likewise.
(std::tr1::llround): Likewise.
(std::tr1::log1p): Likewise.
(std::tr1::log2): Likewise.
(std::tr1::logb): Likewise.
(std::tr1::lrint): Likewise.
(std::tr1::lround): Likewise.
(std::tr1::nearbyint): Likewise.
(std::tr1::nextafter): Likewise.
(std::tr1::nexttoward): Likewise.
(std::tr1::remainder): Likewise.
(std::tr1::remquo): Likewise.
(std::tr1::rint): Likewise.
(std::tr1::scalbln): Likewise.
(std::tr1::scalbn): Likewise.
(std::tr1::tgamma): Likewise.
(std::tr1::trunc): Likewise.
(std::tr1::pow): Likewise.
* testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc:
Restrict dg-xfail-if, dg-excess-errors to *-*-solaris2.1[01]*.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230807 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index e6575eae678..312b1fd8924 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -2147,6 +2147,52 @@ AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [ ]) dnl +dnl Check whether required C++11 overloads are present in <math.h>. +dnl +AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++11" + + case "$host" in + *-*-solaris2.*) + # Solaris 12 introduced the C++11 <math.h> overloads. A backport to + # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch. + AC_MSG_CHECKING([for C++11 <math.h> overloads]) + AC_CACHE_VAL(glibcxx_cv_math11_overload, [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [#include <math.h> + #undef isfinite + namespace std { + inline bool isfinite(float __x) + { return __builtin_isfinite(__x); } + } + ])], + [glibcxx_cv_math11_overload=no], + [glibcxx_cv_math11_overload=yes] + )]) + + # autoheader cannot handle indented templates. + AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO], + [/* Define if all C++11 overloads are available in <math.h>. */ +#if __cplusplus >= 201103L +#undef __CORRECT_ISO_CPP11_MATH_H_PROTO +#endif]) + + if test $glibcxx_cv_math11_overload = yes; then + AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO) + fi + AC_MSG_RESULT([$glibcxx_cv_math11_overload]) + ;; + esac + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +dnl dnl Check whether macros, etc are present for <system_error> dnl AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [ |