From patchwork Fri Nov 18 11:10:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 82862 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp14016qge; Fri, 18 Nov 2016 03:11:09 -0800 (PST) X-Received: by 10.37.170.146 with SMTP id t18mr3966490ybi.134.1479467469057; Fri, 18 Nov 2016 03:11:09 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z68si1563070ybh.49.2016.11.18.03.11.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 03:11:09 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441920-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441920-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441920-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=wn+E5xBIg1Qe+LhZ Gy2MmqBatCDWS3GBMkPTlsIylOrba/ixG5+70AYKgAxy1GXF+nq70+RS2naVbG91 9cM9JR6E5u+RZ0or1WlpOztlryEKQvEoSCRqbFfpYaXMw+pBZ5jWQcCMnjMxJBTn BI/0OA+JrlNC05rWHY+APpC3AjE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=SVl+gGTV0H8Yy562VlRSpO pJyzw=; b=SMqnU6G6W/sPX1IJfPjAZHExjpHVo55DmnGMFNS4nT1nAnLNmx6y7s Rgsn2bbHE1j/udFr1gGBZd6Ls02+fz+8YOZfSyS9Xo4sKycLoks3QOC5VkKEsi/G kH26WBKSQpAO2ybVpqJO/iyvdQ0WojTB1M9iphjRlaAiD0ohGo25k= Received: (qmail 96229 invoked by alias); 18 Nov 2016 11:10:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 96100 invoked by uid 89); 18 Nov 2016 11:10:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=bear, 7879, erf, adjacent X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Nov 2016 11:10:33 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 1A71EC7C; Fri, 18 Nov 2016 12:10:31 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gl6fPd8SEYdk; Fri, 18 Nov 2016 12:10:08 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 8B96CC75; Fri, 18 Nov 2016 12:10:08 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id uAIBA7R5010029; Fri, 18 Nov 2016 12:10:07 +0100 (MET) From: Rainer Orth To: Jonathan Wakely Cc: gcc-patches@gcc.gnu.org, Bruce Korb , libstdc++@gcc.gnu.org Subject: Re: [fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+ References: <20161117165307.GO3145@redhat.com> Date: Fri, 18 Nov 2016 12:10:07 +0100 In-Reply-To: <20161117165307.GO3145@redhat.com> (Jonathan Wakely's message of "Thu, 17 Nov 2016 16:53:08 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Jonathan, > On 03/11/16 15:11 +0100, Rainer Orth wrote: >>Fortunately, this is all easily fixed by wrapping the affected templates >>in a new macro. That's what this patch does. The new libstdc++ >>acinclude.m4 test may well need wording changes in comments etc. and can >>perhaps be shortened a bit, bit it worked for me. > > See below. thanks for the thorough review. > The change is OK in principle, but I'd prefer more meaningful names > for the macros ... Fine with me: I know close to nothing of C++, so please bear with me ;-) >>--- 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 and templates are present >>+dnl in . > > The standard doesn't actually require templates to be used here, it > only requires "sufficient additional overloads" so that integral > arguments work. We happen to do that with templates, and apparently so > do the Solaris headers, but other implementations are possible. So a > more accurate description would be: > > dnl Check whether required C++11 overloads for FP and integral types > dnl are present in . > > And rather than PROTO1 and PROTO2 the macros could be called PROTO_FP > for the overloads for FP types, and PROTO_INT (or just PROTO_I) for > the overloads for integral types (which happen to be templates in our > header). I went for the longer/more expressive names. > The suggestions above would make it shorter, while still remaining > accurate to what the real code in the header does. It could be reduced > even further without altering the meaning for the purposes of this > test: > >>+ namespace std { >>+ template >>+ constexpr typename __gnu_cxx::__enable_if >>+ <__is_integer<_Tp>::__value, double>::__type >>+ log2(_Tp __x) >>+ { return __builtin_log2(__x); } > > template > struct __enable_if_int; > > template<> > struct __enable_if_int > { typedef double __type; }; > > template > constexpr typename __enable_if_int<_Tp>::__type > log2(_Tp __x) > { return __builtin_log2(__x); } > > I don't mind whether you go with this or just remove the unnecessary > structs, typedef and primary template bodies. Either is OK. I went for the latter to keep the testcase close to the original. Please find attached the revised version of the patch. I hope I've incorporated all of your comments. @Bruce: To avoid the hpux11_fabsf test breakage from my original fixincludes part, Dave suggested in private mail to replace the bypass = '__cplusplus' by mach = '*-hp-hpux11*' so the fix only applies to the systems that need them and doesn't get interference from other testcases. So I've got clean make check results in fixincludes. The patch has again been bootstrapped without regressions on i386-pc-solaris2.12, sparc-sun-solaris2.12, i386-pc-solaris2.11 (both with only the fp overloads and nothing at all), and x86_64-pc-linux-gnu. I plan to repeat that testing on the gcc-6 and gcc-5 branches; differences between the branches were minimal for the previons versions (like regenerating fixincl.x or an adjacent comment difference in c_global/cmath). Ok for mainline now and the backports after some soak time? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2016-10-27 Rainer Orth John David Anglin 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 templates. * 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. # HG changeset patch # Parent 7ff83d1e81a9cf7acd757fdca7c8718cf63a6419 Don't define libstdc++-internal macros in Solaris 11/12 diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2252,9 +2252,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"; @@ -3787,6 +3787,23 @@ fix = { }; /* + * 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 * contains one. Wrap the macro definition in an extra layer. diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h --- 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/acinclude.m4 b/libstdc++-v3/acinclude.m4 --- 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/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -539,7 +539,7 @@ namespace std _GLIBCXX_VISIBILITY(defaul #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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isunordered(__type(__x), __type(__y)); } +#endif #else @@ -1196,7 +1220,7 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 @@ namespace std _GLIBCXX_VISIBILITY(defaul { 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 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -490,7 +490,7 @@ namespace tr1 // 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 { 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 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 @@ namespace tr1 // 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 @@ namespace tr1 // 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); }