Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -94,6 +94,11 @@ support the C functionality for wide characters. When wide characters are not supported, several parts of the library will be disabled, notably the wide character specializations of std::basic_string." ON) +option(LIBCXX_ENABLE_LONG_DOUBLE_MATH + "Whether to include support for long double math functions in the library. + Disabling long double support can be useful when porting to platforms that + don't support the C long double math functions. When long doubles are not + supported, several cmath and math.h the library will be disabled." ON) option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS "Whether to turn on vendor availability annotations on declarations that depend on definitions in a shared library. By default, we assume that we're not building @@ -857,6 +862,7 @@ config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION) config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE) config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS) +config_define_if_not(LIBCXX_ENABLE_LONG_DOUBLE_MATH _LIBCPP_HAS_NO_LONG_DOUBLE_MATH) config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) config_define_if(LIBCXX_ENABLE_DEBUG_MODE _LIBCPP_ENABLE_DEBUG_MODE) if (LIBCXX_ENABLE_ASSERTIONS) Index: libcxx/docs/BuildingLibcxx.rst =================================================================== --- libcxx/docs/BuildingLibcxx.rst +++ libcxx/docs/BuildingLibcxx.rst @@ -265,6 +265,16 @@ support for ``wchar_t``. This is especially useful in embedded settings where C Standard Libraries don't always provide all the usual bells and whistles. +.. option:: LIBCXX_ENABLE_LONG_DOUBLE_MATH:BOOL + + **Default**: ``ON`` + + This option can be used to disable support for ``long double`` in the math + library. It also allows the math library to work on top of a C Standard + Library that does not provide support for ``long double`` math functions. + This is especially useful in embedded settings where C Standard Libraries + don't always provide all the usual bells and whistles. + .. option:: LIBCXX_INSTALL_LIBRARY_DIR:PATH **Default**: ``lib${LIBCXX_LIBDIR_SUFFIX}`` Index: libcxx/include/__config_site.in =================================================================== --- libcxx/include/__config_site.in +++ libcxx/include/__config_site.in @@ -29,6 +29,7 @@ #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS +#cmakedefine _LIBCPP_HAS_NO_LONG_DOUBLE_MATH #cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT #cmakedefine _LIBCPP_ENABLE_DEBUG_MODE Index: libcxx/include/cmath =================================================================== --- libcxx/include/cmath +++ libcxx/include/cmath @@ -541,7 +541,9 @@ #if _LIBCPP_STD_VER > 14 inline _LIBCPP_INLINE_VISIBILITY float hypot( float __x, float __y, float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -643,8 +645,10 @@ _LIBCPP_HIDE_FROM_ABI constexpr double lerp(double __a, double __b, double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH _LIBCPP_HIDE_FROM_ABI constexpr long double lerp(long double __a, long double __b, long double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } +#endif template inline _LIBCPP_HIDE_FROM_ABI Index: libcxx/include/math.h =================================================================== --- libcxx/include/math.h +++ libcxx/include/math.h @@ -510,9 +510,11 @@ bool isinf(double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY bool isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } +# endif #endif #endif // isinf @@ -558,9 +560,11 @@ bool isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY bool isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } +# endif #endif #endif // isnan @@ -791,8 +795,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return ::acosf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -803,8 +809,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return ::asinf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -815,8 +823,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return ::atanf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -827,8 +837,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return ::atan2f(__lcpp_y, __lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -850,8 +862,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ::ceilf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -862,8 +876,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return ::cosf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -874,8 +890,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return ::coshf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -886,8 +904,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return ::expf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -898,8 +918,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -910,8 +932,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return ::floorf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -922,8 +946,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmodf(__lcpp_x, __lcpp_y);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -945,8 +971,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpf(__lcpp_x, __lcpp_e);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -957,8 +985,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpf(__lcpp_x, __lcpp_e);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -969,8 +999,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return ::logf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -981,8 +1013,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return ::log10f(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -993,15 +1027,19 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);} # endif +# endif // pow # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::powf(__lcpp_x, __lcpp_y);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1023,7 +1061,9 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return ::sinf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);} +# endif #endif template @@ -1035,8 +1075,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return ::sinhf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1047,8 +1089,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1059,8 +1103,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return ::tanf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1071,8 +1117,10 @@ # if !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return ::tanhf(__lcpp_x);} +# ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);} # endif +# endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1082,7 +1130,9 @@ // acosh inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return ::acoshf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1092,7 +1142,9 @@ // asinh inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return ::asinhf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1102,7 +1154,10 @@ // atanh inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return ::atanhf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);} +#endif + template inline _LIBCPP_INLINE_VISIBILITY @@ -1112,7 +1167,9 @@ // cbrt inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return ::cbrtf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1143,6 +1200,7 @@ #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH #if __has_builtin(__builtin_copysignl) _LIBCPP_CONSTEXPR #endif @@ -1153,6 +1211,7 @@ return ::copysignl(__lcpp_x, __lcpp_y); #endif } +#endif template #if __has_builtin(__builtin_copysign) @@ -1180,9 +1239,11 @@ return ::__libcpp_copysign(__lcpp_x, __lcpp_y); } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT { return ::__libcpp_copysign(__lcpp_x, __lcpp_y); } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1199,7 +1260,9 @@ // erf inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return ::erff(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1209,7 +1272,9 @@ // erfc inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return ::erfcf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1219,7 +1284,9 @@ // exp2 inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return ::exp2f(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1229,7 +1296,9 @@ // expm1 inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return ::expm1f(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1239,7 +1308,9 @@ // fdim inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fdimf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1267,6 +1338,7 @@ return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT { #if __has_builtin(__builtin_fmal) @@ -1275,6 +1347,7 @@ return ::fmal(__lcpp_x, __lcpp_y, __lcpp_z); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1301,7 +1374,9 @@ // fmax inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmaxf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1322,7 +1397,9 @@ // fmin inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fminf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1343,7 +1420,9 @@ // hypot inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::hypotf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1364,7 +1443,9 @@ // ilogb inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ::ilogbf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1374,7 +1455,9 @@ // lgamma inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return ::lgammaf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1391,6 +1474,7 @@ return ::llrintf(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_llrintl) @@ -1399,6 +1483,7 @@ return ::llrintl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1422,6 +1507,7 @@ return ::llroundf(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_llroundl) @@ -1430,6 +1516,7 @@ return ::llroundl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1446,7 +1533,9 @@ // log1p inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return ::log1pf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1456,7 +1545,9 @@ // log2 inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return ::log2f(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1466,7 +1557,9 @@ // logb inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return ::logbf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1483,6 +1576,7 @@ return ::lrintf(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_lrintl) @@ -1491,6 +1585,7 @@ return ::lrintl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1514,6 +1609,7 @@ return ::lroundf(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_lroundl) @@ -1522,6 +1618,7 @@ return ::lroundl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1540,7 +1637,9 @@ // nearbyint inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return ::nearbyintf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1550,7 +1649,9 @@ // nextafter inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::nextafterf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1570,6 +1671,7 @@ // nexttoward +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);} @@ -1577,11 +1679,14 @@ inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if::value, double>::type nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);} +#endif // remainder inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::remainderf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1602,7 +1707,9 @@ // remquo inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1630,6 +1737,7 @@ return ::rintf(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_rintl) @@ -1638,6 +1746,7 @@ return ::rintl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1661,6 +1770,7 @@ return ::round(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_roundl) @@ -1669,6 +1779,7 @@ return ::roundl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1685,7 +1796,9 @@ // scalbln inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1695,7 +1808,9 @@ // scalbn inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnf(__lcpp_x, __lcpp_y);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1705,7 +1820,9 @@ // tgamma inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return ::tgammaf(__lcpp_x);} +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);} +#endif template inline _LIBCPP_INLINE_VISIBILITY @@ -1722,6 +1839,7 @@ return ::trunc(__lcpp_x); #endif } +#ifndef _LIBCPP_HAS_NO_LONG_DOUBLE_MATH inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_truncl) @@ -1730,6 +1848,7 @@ return ::truncl(__lcpp_x); #endif } +#endif template inline _LIBCPP_INLINE_VISIBILITY