diff --git a/libcxx/include/math.h b/libcxx/include/math.h --- a/libcxx/include/math.h +++ b/libcxx/include/math.h @@ -312,472 +312,366 @@ // signbit -#ifdef signbit +# ifdef signbit template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_signbit(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_signbit) - return __builtin_signbit(__x); -#else - return signbit(__x); -#endif +_LIBCPP_HIDE_FROM_ABI bool __libcpp_signbit(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_signbit) + return __builtin_signbit(__x); +# else + return signbit(__x); +# endif } -#undef signbit +# undef signbit template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -signbit(_A1 __x) _NOEXCEPT -{ - return __libcpp_signbit(__x); +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +signbit(_A1 __x) _NOEXCEPT { + return __libcpp_signbit(__x); } template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type -signbit(_A1 __x) _NOEXCEPT -{ return __x < 0; } + typename std::enable_if< std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type + signbit(_A1 __x) _NOEXCEPT { + return __x < 0; +} template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type -signbit(_A1) _NOEXCEPT -{ return false; } + typename std::enable_if< std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type + signbit(_A1) _NOEXCEPT { + return false; +} -#elif defined(_LIBCPP_MSVCRT) +# elif defined(_LIBCPP_MSVCRT) template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -signbit(_A1 __x) _NOEXCEPT -{ +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +signbit(_A1 __x) _NOEXCEPT { return ::signbit(__x); } template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type -signbit(_A1 __x) _NOEXCEPT -{ return __x < 0; } + typename std::enable_if< std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type + signbit(_A1 __x) _NOEXCEPT { + return __x < 0; +} template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type -signbit(_A1) _NOEXCEPT -{ return false; } + typename std::enable_if< std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type + signbit(_A1) _NOEXCEPT { + return false; +} -#endif // signbit +# endif // signbit // fpclassify -#ifdef fpclassify +# ifdef fpclassify template -_LIBCPP_HIDE_FROM_ABI -int -__libcpp_fpclassify(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_fpclassify) - return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, - FP_ZERO, __x); -#else - return fpclassify(__x); -#endif +_LIBCPP_HIDE_FROM_ABI int __libcpp_fpclassify(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_fpclassify) + return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); +# else + return fpclassify(__x); +# endif } -#undef fpclassify +# undef fpclassify template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, int>::type -fpclassify(_A1 __x) _NOEXCEPT -{ - return __libcpp_fpclassify(__x); +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, int>::type +fpclassify(_A1 __x) _NOEXCEPT { + return __libcpp_fpclassify(__x); } template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, int>::type -fpclassify(_A1 __x) _NOEXCEPT -{ return __x == 0 ? FP_ZERO : FP_NORMAL; } +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, int>::type +fpclassify(_A1 __x) _NOEXCEPT { + return __x == 0 ? FP_ZERO : FP_NORMAL; +} -#elif defined(_LIBCPP_MSVCRT) +# elif defined(_LIBCPP_MSVCRT) template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -fpclassify(_A1 __x) _NOEXCEPT -{ +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +fpclassify(_A1 __x) _NOEXCEPT { return ::fpclassify(__x); } template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, int>::type -fpclassify(_A1 __x) _NOEXCEPT -{ return __x == 0 ? FP_ZERO : FP_NORMAL; } +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, int>::type +fpclassify(_A1 __x) _NOEXCEPT { + return __x == 0 ? FP_ZERO : FP_NORMAL; +} -#endif // fpclassify +# endif // fpclassify // isfinite -#ifdef isfinite +# ifdef isfinite template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isfinite(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_isfinite) - return __builtin_isfinite(__x); -#else - return isfinite(__x); -#endif +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isfinite(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_isfinite) + return __builtin_isfinite(__x); +# else + return isfinite(__x); +# endif } -#undef isfinite +# undef isfinite template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, - bool>::type -isfinite(_A1 __x) _NOEXCEPT -{ - return __libcpp_isfinite((typename std::__promote<_A1>::type)__x); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, bool>::type + isfinite(_A1 __x) _NOEXCEPT { + return __libcpp_isfinite((typename std::__promote<_A1>::type)__x); } template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, - bool>::type -isfinite(_A1) _NOEXCEPT -{ return true; } + typename std::enable_if< std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, bool>::type + isfinite(_A1) _NOEXCEPT { + return true; +} -#endif // isfinite +# endif // isfinite // isinf -#ifdef isinf +# ifdef isinf template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isinf(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_isinf) - return __builtin_isinf(__x); -#else - return isinf(__x); -#endif +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isinf(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_isinf) + return __builtin_isinf(__x); +# else + return isinf(__x); +# endif } -#undef isinf +# undef isinf template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, - bool>::type -isinf(_A1 __x) _NOEXCEPT -{ - return __libcpp_isinf((typename std::__promote<_A1>::type)__x); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, bool>::type + isinf(_A1 __x) _NOEXCEPT { + return __libcpp_isinf((typename std::__promote<_A1>::type)__x); } template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if< - std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, - bool>::type -isinf(_A1) _NOEXCEPT -{ return false; } + typename std::enable_if< std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, bool>::type + isinf(_A1) _NOEXCEPT { + return false; +} -#ifdef _LIBCPP_PREFERRED_OVERLOAD -inline _LIBCPP_HIDE_FROM_ABI -bool -isinf(float __x) _NOEXCEPT { return __libcpp_isinf(__x); } +# ifdef _LIBCPP_PREFERRED_OVERLOAD +inline _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { return __libcpp_isinf(__x); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD -bool -isinf(double __x) _NOEXCEPT { return __libcpp_isinf(__x); } +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT { return __libcpp_isinf(__x); } -inline _LIBCPP_HIDE_FROM_ABI -bool -isinf(long double __x) _NOEXCEPT { return __libcpp_isinf(__x); } -#endif +inline _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT { return __libcpp_isinf(__x); } +# endif -#endif // isinf +# endif // isinf // isnan -#ifdef isnan +# ifdef isnan template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isnan(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_isnan) - return __builtin_isnan(__x); -#else - return isnan(__x); -#endif +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isnan(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_isnan) + return __builtin_isnan(__x); +# else + return isnan(__x); +# endif } -#undef isnan +# undef isnan template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -isnan(_A1 __x) _NOEXCEPT -{ - return __libcpp_isnan(__x); +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +isnan(_A1 __x) _NOEXCEPT { + return __libcpp_isnan(__x); } template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -isnan(_A1) _NOEXCEPT -{ return false; } +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type isnan(_A1) _NOEXCEPT { + return false; +} -#ifdef _LIBCPP_PREFERRED_OVERLOAD -inline _LIBCPP_HIDE_FROM_ABI -bool -isnan(float __x) _NOEXCEPT { return __libcpp_isnan(__x); } +# ifdef _LIBCPP_PREFERRED_OVERLOAD +inline _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { return __libcpp_isnan(__x); } -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD -bool -isnan(double __x) _NOEXCEPT { return __libcpp_isnan(__x); } +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isnan(double __x) _NOEXCEPT { return __libcpp_isnan(__x); } -inline _LIBCPP_HIDE_FROM_ABI -bool -isnan(long double __x) _NOEXCEPT { return __libcpp_isnan(__x); } -#endif +inline _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT { return __libcpp_isnan(__x); } +# endif -#endif // isnan +# endif // isnan // isnormal -#ifdef isnormal +# ifdef isnormal template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isnormal(_A1 __x) _NOEXCEPT -{ -#if __has_builtin(__builtin_isnormal) - return __builtin_isnormal(__x); -#else - return isnormal(__x); -#endif +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isnormal(_A1 __x) _NOEXCEPT { +# if __has_builtin(__builtin_isnormal) + return __builtin_isnormal(__x); +# else + return isnormal(__x); +# endif } -#undef isnormal +# undef isnormal template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -isnormal(_A1 __x) _NOEXCEPT -{ - return __libcpp_isnormal(__x); +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +isnormal(_A1 __x) _NOEXCEPT { + return __libcpp_isnormal(__x); } template -inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if::value, bool>::type -isnormal(_A1 __x) _NOEXCEPT -{ return __x != 0; } +inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type +isnormal(_A1 __x) _NOEXCEPT { + return __x != 0; +} -#endif // isnormal +# endif // isnormal // isgreater -#ifdef isgreater +# ifdef isgreater template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isgreater(_A1 __x, _A2 __y) _NOEXCEPT -{ - return isgreater(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isgreater(_A1 __x, _A2 __y) _NOEXCEPT { + return isgreater(__x, __y); } -#undef isgreater +# undef isgreater template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isgreater(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isgreater((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + isgreater(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreater((type)__x, (type)__y); } -#endif // isgreater +# endif // isgreater // isgreaterequal -#ifdef isgreaterequal +# ifdef isgreaterequal template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT -{ - return isgreaterequal(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { + return isgreaterequal(__x, __y); } -#undef isgreaterequal +# undef isgreaterequal template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isgreaterequal((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreaterequal((type)__x, (type)__y); } -#endif // isgreaterequal +# endif // isgreaterequal // isless -#ifdef isless +# ifdef isless template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isless(_A1 __x, _A2 __y) _NOEXCEPT -{ - return isless(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isless(_A1 __x, _A2 __y) _NOEXCEPT { + return isless(__x, __y); } -#undef isless +# undef isless template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isless(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isless((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + isless(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isless((type)__x, (type)__y); } -#endif // isless +# endif // isless // islessequal -#ifdef islessequal +# ifdef islessequal template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_islessequal(_A1 __x, _A2 __y) _NOEXCEPT -{ - return islessequal(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_islessequal(_A1 __x, _A2 __y) _NOEXCEPT { + return islessequal(__x, __y); } -#undef islessequal +# undef islessequal template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -islessequal(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_islessequal((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + islessequal(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessequal((type)__x, (type)__y); } -#endif // islessequal +# endif // islessequal // islessgreater -#ifdef islessgreater +# ifdef islessgreater template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_islessgreater(_A1 __x, _A2 __y) _NOEXCEPT -{ - return islessgreater(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { + return islessgreater(__x, __y); } -#undef islessgreater +# undef islessgreater template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -islessgreater(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_islessgreater((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessgreater((type)__x, (type)__y); } -#endif // islessgreater +# endif // islessgreater // isunordered -#ifdef isunordered +# ifdef isunordered template -_LIBCPP_HIDE_FROM_ABI -bool -__libcpp_isunordered(_A1 __x, _A2 __y) _NOEXCEPT -{ - return isunordered(__x, __y); +_LIBCPP_HIDE_FROM_ABI bool __libcpp_isunordered(_A1 __x, _A2 __y) _NOEXCEPT { + return isunordered(__x, __y); } -#undef isunordered +# undef isunordered template inline _LIBCPP_HIDE_FROM_ABI -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isunordered(_A1 __x, _A2 __y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isunordered((type)__x, (type)__y); + typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type + isunordered(_A1 __x, _A2 __y) _NOEXCEPT { + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isunordered((type)__x, (type)__y); } -#endif // isunordered +# endif // isunordered // abs //