From 3115f94f7fe0388f026837b36d165b026032093e Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Mon, 21 Nov 2016 16:09:47 +0000 Subject: [PATCH] Don't define libstdc++-internal macros in Solaris 10+ libstdc++-v3: * acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments. (__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ... (__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this. Add test for C++11 integral overloads. * configure: Regenerate. * config.h.in: Regenerate. * include/c_global/cmath [__cplusplus >= 201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename. * include/c_global/cmath [_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L] (std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT. (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. [__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1] (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 && __cplusplus >= 201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename. fixincludes: * inclhack.def (solaris_math_12): New fix. (hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector. * fixincl.x: Regenerate. * tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test. From-SVN: r242671 --- fixincludes/ChangeLog | 7 ++ fixincludes/fixincl.x | 63 ++++++++-- fixincludes/inclhack.def | 19 ++- fixincludes/tests/base/math.h | 6 + libstdc++-v3/ChangeLog | 65 ++++++++++ libstdc++-v3/acinclude.m4 | 79 ++++++++++-- libstdc++-v3/config.h.in | 9 +- libstdc++-v3/configure | 84 +++++++++++-- libstdc++-v3/include/c_global/cmath | 184 +++++++++++++++++++++------- libstdc++-v3/include/tr1/cmath | 72 +++++------ 10 files changed, 466 insertions(+), 122 deletions(-) diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index fef9f9fdc6f..d447171a8da 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,10 @@ +2016-11-21 Rainer Orth + + * inclhack.def (solaris_math_12): New fix. + (hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector. + * fixincl.x: Regenerate. + * tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test. + 2016-11-20 Rainer Orth PR sanitizer/78267 diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 00d03be8ffe..b0eeef9dfdf 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed November 20, 2016 at 11:44:36 AM by AutoGen 5.16.2 + * It has been AutoGen-ed November 20, 2016 at 12:02:46 PM by AutoGen 5.16.2 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 11:44:37 MET 2016 +/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 12:02:47 MET 2016 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 241 fixup descriptions. + * This file contains 242 fixup descriptions. * * See README for more information. * @@ -4507,7 +4507,9 @@ tSCC zHpux11_FabsfList[] = /* * Machine/OS name selection pattern */ -#define apzHpux11_FabsfMachs (const char**)NULL +tSCC* apzHpux11_FabsfMachs[] = { + "*-hp-hpux11*", + (const char*)NULL }; /* * content selection pattern - do fix if pattern found @@ -4515,15 +4517,8 @@ tSCC zHpux11_FabsfList[] = tSCC zHpux11_FabsfSelect0[] = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*"; -/* - * content bypass pattern - skip fix if pattern found - */ -tSCC zHpux11_FabsfBypass0[] = - "__cplusplus"; - -#define HPUX11_FABSF_TEST_CT 2 +#define HPUX11_FABSF_TEST_CT 1 static tTestDesc aHpux11_FabsfTests[] = { - { TT_NEGREP, zHpux11_FabsfBypass0, (regex_t*)NULL }, { TT_EGREP, zHpux11_FabsfSelect0, (regex_t*)NULL }, }; /* @@ -7581,6 +7576,42 @@ static const char* apzSolaris_Math_11Patch[] = { #endif", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_12 fix + */ +tSCC zSolaris_Math_12Name[] = + "solaris_math_12"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_12List[] = + "math.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzSolaris_Math_12Machs[] = { + "*-*-solaris2*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_12Select0[] = + "#undef.*_GLIBCXX_USE_C99_MATH"; + +#define SOLARIS_MATH_12_TEST_CT 1 +static tTestDesc aSolaris_Math_12Tests[] = { + { TT_EGREP, zSolaris_Math_12Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_12 + */ +static const char* apzSolaris_Math_12Patch[] = { sed_cmd_z, + "-e", "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Solaris_Once_Init_1 fix @@ -9879,7 +9910,7 @@ static const char* apzX11_SprintfPatch[] = { */ #define REGEX_COUNT 279 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 241 +#define FIX_COUNT 242 /* * Enumerate the fixes @@ -10068,6 +10099,7 @@ typedef enum { SOLARIS_MATH_8_FIXIDX, SOLARIS_MATH_9_FIXIDX, SOLARIS_MATH_11_FIXIDX, + SOLARIS_MATH_12_FIXIDX, SOLARIS_ONCE_INIT_1_FIXIDX, SOLARIS_POSIX_SPAWN_RESTRICT_FIXIDX, SOLARIS_POW_INT_OVERLOAD_FIXIDX, @@ -11044,6 +11076,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SOLARIS_MATH_11_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSolaris_Math_11Tests, apzSolaris_Math_11Patch, 0 }, + { zSolaris_Math_12Name, zSolaris_Math_12List, + apzSolaris_Math_12Machs, + SOLARIS_MATH_12_TEST_CT, FD_MACH_ONLY, + aSolaris_Math_12Tests, apzSolaris_Math_12Patch, 0 }, + { zSolaris_Once_Init_1Name, zSolaris_Once_Init_1List, apzSolaris_Once_Init_1Machs, SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 931161b69ce..240fc7437e6 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2334,9 +2334,9 @@ fix = { */ fix = { hackname = hpux11_fabsf; + mach = "*-hp-hpux11*"; files = math.h; select = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*"; - bypass = "__cplusplus"; c_fix = format; c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; @@ -3867,6 +3867,23 @@ _EOArg_; _EOText_; }; +/* + * Some versions of Solaris 10+ #undef libstdc++-internal macros. + */ +fix = { + hackname = solaris_math_12; + files = math.h; + mach = '*-*-solaris2*'; + select = '#undef.*_GLIBCXX_USE_C99_MATH'; + sed = "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d"; + test_text = << _EOText_ +#if __cplusplus >= 201103L +#undef _GLIBCXX_USE_C99_MATH +#undef _GLIBCXX_USE_C99_MATH_TR1 +#endif +_EOText_; +}; + /* * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a * structure. As such, it need two levels of brackets, but only diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h index 766017280b5..c7da15ad2c7 100644 --- a/fixincludes/tests/base/math.h +++ b/fixincludes/tests/base/math.h @@ -85,6 +85,12 @@ extern int class(); #endif /* RS6000_DOUBLE_CHECK */ +#if defined( SOLARIS_MATH_12_CHECK ) +#if __cplusplus >= 201103L +#endif +#endif /* SOLARIS_MATH_12_CHECK */ + + #if defined( STRICT_ANSI_NOT_CTD_CHECK ) #if 1 && \ && defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \ diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d82aaa4aff5..d364e2e48a8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,68 @@ +2016-11-21 Rainer Orth + + * acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments. + (__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ... + (__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this. + Add test for C++11 integral overloads. + * configure: Regenerate. + * config.h.in: Regenerate. + + * include/c_global/cmath [__cplusplus >= 201103L]: Reflect + __CORRECT_ISO_CPP11_MATH_H_PROTO to + __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename. + * include/c_global/cmath [_GLIBCXX_USE_C99_MATH && + !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L] + (std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT. + (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. + [__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1] + (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 && __cplusplus >= + 201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to + __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename. + 2016-11-15 Jonathan Wakely PR libstdc++/59406 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 1fc4de16e21..c88e4732d0b 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -2181,7 +2181,8 @@ AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [ ]) dnl -dnl Check whether required C++11 overloads are present in . +dnl Check whether required C++11 overloads for floating point and integral +dnl types are present in . dnl AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ @@ -2192,10 +2193,10 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ case "$host" in *-*-solaris2.*) - # Solaris 12 introduced the C++11 overloads. A backport to - # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch. - AC_MSG_CHECKING([for C++11 overloads]) - AC_CACHE_VAL(glibcxx_cv_math11_overload, [ + # Solaris 12 Build 86, Solaris 11.3 SRU 3.6, and Solaris 10 Patch + # 11996[67]-02 introduced the C++11 floating point overloads. + AC_MSG_CHECKING([for C++11 floating point overloads]) + AC_CACHE_VAL(glibcxx_cv_math11_fp_overload, [ AC_COMPILE_IFELSE([AC_LANG_SOURCE( [#include #undef isfinite @@ -2204,21 +2205,73 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ { return __builtin_isfinite(__x); } } ])], - [glibcxx_cv_math11_overload=no], - [glibcxx_cv_math11_overload=yes] + [glibcxx_cv_math11_fp_overload=no], + [glibcxx_cv_math11_fp_overload=yes] )]) # autoheader cannot handle indented templates. - AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO], - [/* Define if all C++11 overloads are available in . */ + AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_FP], + [/* Define if all C++11 floating point overloads are available in . */ #if __cplusplus >= 201103L -#undef __CORRECT_ISO_CPP11_MATH_H_PROTO +#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP #endif]) - if test $glibcxx_cv_math11_overload = yes; then - AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO) + if test $glibcxx_cv_math11_fp_overload = yes; then + AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP) fi - AC_MSG_RESULT([$glibcxx_cv_math11_overload]) + AC_MSG_RESULT([$glibcxx_cv_math11_fp_overload]) + + # Solaris 12 Build 90, Solaris 11.3 SRU 5.6, and Solaris 10 Patch + # 11996[67]-02 introduced the C++11 integral type overloads. + AC_MSG_CHECKING([for C++11 integral type overloads]) + AC_CACHE_VAL(glibcxx_cv_math11_int_overload, [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [#include + namespace std { + template + struct __is_integer; + template<> + struct __is_integer + { + enum { __value = 1 }; + }; + } + namespace __gnu_cxx { + template + struct __enable_if; + template + struct __enable_if + { typedef _Tp __type; }; + } + namespace std { + template + constexpr typename __gnu_cxx::__enable_if + <__is_integer<_Tp>::__value, double>::__type + log2(_Tp __x) + { return __builtin_log2(__x); } + } + int + main (void) + { + int i = 1000; + return std::log2(i); + } + ])], + [glibcxx_cv_math11_int_overload=no], + [glibcxx_cv_math11_int_overload=yes] + )]) + + # autoheader cannot handle indented templates. + AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_INT], + [/* Define if all C++11 integral type overloads are available in . */ +#if __cplusplus >= 201103L +#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT +#endif]) + + if test $glibcxx_cv_math11_int_overload = yes; then + AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_INT) + fi + AC_MSG_RESULT([$glibcxx_cv_math11_int_overload]) ;; *) # If defines the obsolete isinf(double) and isnan(double) diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 63996709ad4..09ddfeb7993 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -977,9 +977,14 @@ /* Define to 1 if mutex_timedlock is available. */ #undef _GTHREAD_USE_MUTEX_TIMEDLOCK -/* Define if all C++11 overloads are available in . */ +/* Define if all C++11 floating point overloads are available in . */ #if __cplusplus >= 201103L -#undef __CORRECT_ISO_CPP11_MATH_H_PROTO +#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP +#endif + +/* Define if all C++11 integral type overloads are available in . */ +#if __cplusplus >= 201103L +#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT #endif #if defined (HAVE__ACOSF) && ! defined (HAVE_ACOSF) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 55de4badd83..f32197e0fab 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -18236,11 +18236,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu case "$host" in *-*-solaris2.*) - # Solaris 12 introduced the C++11 overloads. A backport to - # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 overloads" >&5 -$as_echo_n "checking for C++11 overloads... " >&6; } - if test "${glibcxx_cv_math11_overload+set}" = set; then : + # Solaris 12 Build 86, Solaris 11.3 SRU 3.6, and Solaris 10 Patch + # 11996[67]-02 introduced the C++11 floating point overloads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 floating point overloads" >&5 +$as_echo_n "checking for C++11 floating point overloads... " >&6; } + if test "${glibcxx_cv_math11_fp_overload+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -18255,9 +18255,9 @@ else _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - glibcxx_cv_math11_overload=no + glibcxx_cv_math11_fp_overload=no else - glibcxx_cv_math11_overload=yes + glibcxx_cv_math11_fp_overload=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -18267,12 +18267,74 @@ fi # autoheader cannot handle indented templates. - if test $glibcxx_cv_math11_overload = yes; then - $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO 1" >>confdefs.h + if test $glibcxx_cv_math11_fp_overload = yes; then + $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_overload" >&5 -$as_echo "$glibcxx_cv_math11_overload" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_fp_overload" >&5 +$as_echo "$glibcxx_cv_math11_fp_overload" >&6; } + + # Solaris 12 Build 90, Solaris 11.3 SRU 5.6, and Solaris 10 Patch + # 11996[67]-02 introduced the C++11 integral type overloads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 integral type overloads" >&5 +$as_echo_n "checking for C++11 integral type overloads... " >&6; } + if test "${glibcxx_cv_math11_int_overload+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + namespace std { + template + struct __is_integer; + template<> + struct __is_integer + { + enum { __value = 1 }; + }; + } + namespace __gnu_cxx { + template + struct __enable_if; + template + struct __enable_if + { typedef _Tp __type; }; + } + namespace std { + template + constexpr typename __gnu_cxx::__enable_if + <__is_integer<_Tp>::__value, double>::__type + log2(_Tp __x) + { return __builtin_log2(__x); } + } + int + main (void) + { + int i = 1000; + return std::log2(i); + } + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + glibcxx_cv_math11_int_overload=no +else + glibcxx_cv_math11_int_overload=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + + # autoheader cannot handle indented templates. + + + if test $glibcxx_cv_math11_int_overload = yes; then + $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO_INT 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_int_overload" >&5 +$as_echo "$glibcxx_cv_math11_int_overload" >&6; } ;; *) # If defines the obsolete isinf(double) and isnan(double) diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index 24ce811adf2..bea9b18ef58 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -539,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr int fpclassify(float __x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, @@ -556,13 +556,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION FP_SUBNORMAL, FP_ZERO, __x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, int>::__type fpclassify(_Tp __x) { return __x != 0 ? FP_NORMAL : FP_ZERO; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isfinite(float __x) { return __builtin_isfinite(__x); } @@ -576,13 +578,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isfinite(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isfinite(_Tp __x) { return true; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isinf(float __x) { return __builtin_isinf(__x); } @@ -601,13 +605,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isinf(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isinf(_Tp __x) { return false; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isnan(float __x) { return __builtin_isnan(__x); } @@ -626,13 +632,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isnan(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isnan(_Tp __x) { return false; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isnormal(float __x) { return __builtin_isnormal(__x); } @@ -646,13 +654,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isnormal(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isnormal(_Tp __x) { return __x != 0 ? true : false; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP // Note: middle-end/36757 is fixed, __builtin_signbit is type-generic. constexpr bool signbit(float __x) @@ -667,13 +677,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_signbit(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type signbit(_Tp __x) { return __x < 0 ? true : false; } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isgreater(float __x, float __y) { return __builtin_isgreater(__x, __y); } @@ -687,6 +699,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isgreater(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -696,8 +709,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isgreater(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isgreaterequal(float __x, float __y) { return __builtin_isgreaterequal(__x, __y); } @@ -711,6 +725,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isgreaterequal(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -720,8 +735,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isgreaterequal(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isless(float __x, float __y) { return __builtin_isless(__x, __y); } @@ -735,6 +751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isless(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -744,8 +761,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isless(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool islessequal(float __x, float __y) { return __builtin_islessequal(__x, __y); } @@ -759,6 +777,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_islessequal(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -768,8 +787,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_islessequal(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool islessgreater(float __x, float __y) { return __builtin_islessgreater(__x, __y); } @@ -783,6 +803,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_islessgreater(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -792,8 +813,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_islessgreater(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr bool isunordered(float __x, float __y) { return __builtin_isunordered(__x, __y); } @@ -807,6 +829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_isunordered(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value @@ -816,6 +839,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isunordered(__type(__x), __type(__y)); } +#endif #else @@ -1196,7 +1220,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::truncl; /// Additional overloads. -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float acosh(float __x) { return __builtin_acoshf(__x); } @@ -1206,13 +1230,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_acoshl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type acosh(_Tp __x) { return __builtin_acosh(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float asinh(float __x) { return __builtin_asinhf(__x); } @@ -1222,13 +1248,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_asinhl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type asinh(_Tp __x) { return __builtin_asinh(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float atanh(float __x) { return __builtin_atanhf(__x); } @@ -1238,13 +1266,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_atanhl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type atanh(_Tp __x) { return __builtin_atanh(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float cbrt(float __x) { return __builtin_cbrtf(__x); } @@ -1254,13 +1284,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_cbrtl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type cbrt(_Tp __x) { return __builtin_cbrt(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float copysign(float __x, float __y) { return __builtin_copysignf(__x, __y); } @@ -1270,6 +1302,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_copysignl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type copysign(_Tp __x, _Up __y) @@ -1277,8 +1310,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return copysign(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float erf(float __x) { return __builtin_erff(__x); } @@ -1288,13 +1322,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_erfl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type erf(_Tp __x) { return __builtin_erf(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float erfc(float __x) { return __builtin_erfcf(__x); } @@ -1304,13 +1340,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_erfcl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type erfc(_Tp __x) { return __builtin_erfc(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float exp2(float __x) { return __builtin_exp2f(__x); } @@ -1320,13 +1358,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_exp2l(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type exp2(_Tp __x) { return __builtin_exp2(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float expm1(float __x) { return __builtin_expm1f(__x); } @@ -1336,13 +1376,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_expm1l(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type expm1(_Tp __x) { return __builtin_expm1(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float fdim(float __x, float __y) { return __builtin_fdimf(__x, __y); } @@ -1352,6 +1394,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fdiml(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fdim(_Tp __x, _Up __y) @@ -1359,8 +1402,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fdim(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float fma(float __x, float __y, float __z) { return __builtin_fmaf(__x, __y, __z); } @@ -1370,6 +1414,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmal(__x, __y, __z); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type fma(_Tp __x, _Up __y, _Vp __z) @@ -1377,8 +1422,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; return fma(__type(__x), __type(__y), __type(__z)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float fmax(float __x, float __y) { return __builtin_fmaxf(__x, __y); } @@ -1388,6 +1434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmaxl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmax(_Tp __x, _Up __y) @@ -1395,8 +1442,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fmax(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float fmin(float __x, float __y) { return __builtin_fminf(__x, __y); } @@ -1406,6 +1454,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fminl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmin(_Tp __x, _Up __y) @@ -1413,8 +1462,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fmin(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float hypot(float __x, float __y) { return __builtin_hypotf(__x, __y); } @@ -1424,6 +1474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_hypotl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type hypot(_Tp __x, _Up __y) @@ -1431,8 +1482,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return hypot(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr int ilogb(float __x) { return __builtin_ilogbf(__x); } @@ -1442,14 +1494,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_ilogbl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, int>::__type ilogb(_Tp __x) { return __builtin_ilogb(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float lgamma(float __x) { return __builtin_lgammaf(__x); } @@ -1459,13 +1513,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_lgammal(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type lgamma(_Tp __x) { return __builtin_lgamma(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr long long llrint(float __x) { return __builtin_llrintf(__x); } @@ -1475,13 +1531,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_llrintl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long long>::__type llrint(_Tp __x) { return __builtin_llrint(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr long long llround(float __x) { return __builtin_llroundf(__x); } @@ -1491,13 +1549,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_llroundl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long long>::__type llround(_Tp __x) { return __builtin_llround(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float log1p(float __x) { return __builtin_log1pf(__x); } @@ -1507,13 +1567,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_log1pl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log1p(_Tp __x) { return __builtin_log1p(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP // DR 568. constexpr float log2(float __x) @@ -1524,13 +1586,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_log2l(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log2(_Tp __x) { return __builtin_log2(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float logb(float __x) { return __builtin_logbf(__x); } @@ -1540,13 +1604,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_logbl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type logb(_Tp __x) { return __builtin_logb(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr long lrint(float __x) { return __builtin_lrintf(__x); } @@ -1556,13 +1622,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_lrintl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long>::__type lrint(_Tp __x) { return __builtin_lrint(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr long lround(float __x) { return __builtin_lroundf(__x); } @@ -1572,13 +1640,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_lroundl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long>::__type lround(_Tp __x) { return __builtin_lround(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float nearbyint(float __x) { return __builtin_nearbyintf(__x); } @@ -1588,13 +1658,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_nearbyintl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type nearbyint(_Tp __x) { return __builtin_nearbyint(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float nextafter(float __x, float __y) { return __builtin_nextafterf(__x, __y); } @@ -1604,6 +1676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_nextafterl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type nextafter(_Tp __x, _Up __y) @@ -1611,8 +1684,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return nextafter(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float nexttoward(float __x, long double __y) { return __builtin_nexttowardf(__x, __y); } @@ -1622,13 +1696,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_nexttowardl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type nexttoward(_Tp __x, long double __y) { return __builtin_nexttoward(__x, __y); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float remainder(float __x, float __y) { return __builtin_remainderf(__x, __y); } @@ -1638,6 +1714,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remainderl(__x, __y); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remainder(_Tp __x, _Up __y) @@ -1645,8 +1722,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return remainder(__type(__x), __type(__y)); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float remquo(float __x, float __y, int* __pquo) { return __builtin_remquof(__x, __y, __pquo); } @@ -1656,6 +1734,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remquol(__x, __y, __pquo); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remquo(_Tp __x, _Up __y, int* __pquo) @@ -1663,8 +1742,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return remquo(__type(__x), __type(__y), __pquo); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float rint(float __x) { return __builtin_rintf(__x); } @@ -1674,13 +1754,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_rintl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type rint(_Tp __x) { return __builtin_rint(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float round(float __x) { return __builtin_roundf(__x); } @@ -1690,13 +1772,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_roundl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type round(_Tp __x) { return __builtin_round(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float scalbln(float __x, long __ex) { return __builtin_scalblnf(__x, __ex); } @@ -1706,13 +1790,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_scalblnl(__x, __ex); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type scalbln(_Tp __x, long __ex) { return __builtin_scalbln(__x, __ex); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float scalbn(float __x, int __ex) { return __builtin_scalbnf(__x, __ex); } @@ -1722,13 +1808,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_scalbnl(__x, __ex); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type scalbn(_Tp __x, int __ex) { return __builtin_scalbn(__x, __ex); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float tgamma(float __x) { return __builtin_tgammaf(__x); } @@ -1738,13 +1826,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_tgammal(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type tgamma(_Tp __x) { return __builtin_tgamma(__x); } +#endif -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP constexpr float trunc(float __x) { return __builtin_truncf(__x); } @@ -1754,11 +1844,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_truncl(__x); } #endif +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type trunc(_Tp __x) { return __builtin_trunc(__x); } +#endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath index 7f77a2b01ad..9a4a1764ca1 100644 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -490,7 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // In C++03 we need to provide the additional overloads. -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float acosh(float __x) { return __builtin_acoshf(__x); } @@ -506,7 +506,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION acosh(_Tp __x) { return __builtin_acosh(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float asinh(float __x) { return __builtin_asinhf(__x); } @@ -522,7 +522,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION asinh(_Tp __x) { return __builtin_asinh(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float atanh(float __x) { return __builtin_atanhf(__x); } @@ -538,7 +538,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION atanh(_Tp __x) { return __builtin_atanh(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float cbrt(float __x) { return __builtin_cbrtf(__x); } @@ -554,7 +554,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION cbrt(_Tp __x) { return __builtin_cbrt(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float copysign(float __x, float __y) { return __builtin_copysignf(__x, __y); } @@ -572,7 +572,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return copysign(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float erf(float __x) { return __builtin_erff(__x); } @@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION erf(_Tp __x) { return __builtin_erf(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float erfc(float __x) { return __builtin_erfcf(__x); } @@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION erfc(_Tp __x) { return __builtin_erfc(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float exp2(float __x) { return __builtin_exp2f(__x); } @@ -620,7 +620,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION exp2(_Tp __x) { return __builtin_exp2(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float expm1(float __x) { return __builtin_expm1f(__x); } @@ -636,7 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION expm1(_Tp __x) { return __builtin_expm1(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float fdim(float __x, float __y) { return __builtin_fdimf(__x, __y); } @@ -654,7 +654,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return fdim(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float fma(float __x, float __y, float __z) { return __builtin_fmaf(__x, __y, __z); } @@ -672,7 +672,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return fma(__type(__x), __type(__y), __type(__z)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float fmax(float __x, float __y) { return __builtin_fmaxf(__x, __y); } @@ -690,7 +690,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return fmax(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float fmin(float __x, float __y) { return __builtin_fminf(__x, __y); } @@ -708,7 +708,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return fmin(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float hypot(float __x, float __y) { return __builtin_hypotf(__x, __y); } @@ -726,7 +726,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return hypot(__type(__y), __type(__x)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline int ilogb(float __x) { return __builtin_ilogbf(__x); } @@ -742,7 +742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ilogb(_Tp __x) { return __builtin_ilogb(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float lgamma(float __x) { return __builtin_lgammaf(__x); } @@ -758,7 +758,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION lgamma(_Tp __x) { return __builtin_lgamma(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline long long llrint(float __x) { return __builtin_llrintf(__x); } @@ -774,7 +774,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION llrint(_Tp __x) { return __builtin_llrint(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline long long llround(float __x) { return __builtin_llroundf(__x); } @@ -790,7 +790,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION llround(_Tp __x) { return __builtin_llround(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float log1p(float __x) { return __builtin_log1pf(__x); } @@ -807,7 +807,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_log1p(__x); } // DR 568. -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float log2(float __x) { return __builtin_log2f(__x); } @@ -823,7 +823,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION log2(_Tp __x) { return __builtin_log2(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float logb(float __x) { return __builtin_logbf(__x); } @@ -841,7 +841,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __builtin_logb(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline long lrint(float __x) { return __builtin_lrintf(__x); } @@ -857,7 +857,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION lrint(_Tp __x) { return __builtin_lrint(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline long lround(float __x) { return __builtin_lroundf(__x); } @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION lround(_Tp __x) { return __builtin_lround(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float nearbyint(float __x) { return __builtin_nearbyintf(__x); } @@ -889,7 +889,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION nearbyint(_Tp __x) { return __builtin_nearbyint(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float nextafter(float __x, float __y) { return __builtin_nextafterf(__x, __y); } @@ -907,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return nextafter(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float nexttoward(float __x, long double __y) { return __builtin_nexttowardf(__x, __y); } @@ -923,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION nexttoward(_Tp __x, long double __y) { return __builtin_nexttoward(__x, __y); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float remainder(float __x, float __y) { return __builtin_remainderf(__x, __y); } @@ -941,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return remainder(__type(__x), __type(__y)); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float remquo(float __x, float __y, int* __pquo) { return __builtin_remquof(__x, __y, __pquo); } @@ -959,7 +959,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return remquo(__type(__x), __type(__y), __pquo); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float rint(float __x) { return __builtin_rintf(__x); } @@ -975,7 +975,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION rint(_Tp __x) { return __builtin_rint(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float round(float __x) { return __builtin_roundf(__x); } @@ -991,7 +991,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION round(_Tp __x) { return __builtin_round(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float scalbln(float __x, long __ex) { return __builtin_scalblnf(__x, __ex); } @@ -1007,7 +1007,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION scalbln(_Tp __x, long __ex) { return __builtin_scalbln(__x, __ex); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float scalbn(float __x, int __ex) { return __builtin_scalbnf(__x, __ex); } @@ -1023,7 +1023,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION scalbn(_Tp __x, int __ex) { return __builtin_scalbn(__x, __ex); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float tgamma(float __x) { return __builtin_tgammaf(__x); } @@ -1039,7 +1039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION tgamma(_Tp __x) { return __builtin_tgamma(__x); } -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float trunc(float __x) { return __builtin_truncf(__x); } @@ -1084,7 +1084,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // the discussion about this issue here: // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float pow(float __x, float __y) { return std::pow(__x, __y); } @@ -1112,7 +1112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // to std::fabs. #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO -#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO +#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP inline float fabs(float __x) { return __builtin_fabsf(__x); } -- 2.30.2