math: add type promoting template definition on MSVCRT

When building with MSVCRT, we need to manually provide the type
promoting overloads to allow the correct type deduced invocation for
signbit(Int) and fpclassify(int).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2017-02-18 19:28:38 +00:00
parent 524f109550
commit 1eab168286

View File

@@ -333,6 +333,16 @@ signbit(_A1 __lcpp_x) _NOEXCEPT
return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
}
#elif defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) >= 14)
template <typename _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
signbit(_A1 __lcpp_x) _NOEXCEPT
{
return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
}
#endif // signbit
// fpclassify
@@ -357,6 +367,16 @@ fpclassify(_A1 __lcpp_x) _NOEXCEPT
return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
}
#elif defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) >= 14)
template <typename _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
}
#endif // fpclassify
// isfinite