From: Rémi Bernon rbernon@codeweavers.com
And some C++ related inline helpers. --- include/msvcrt/math.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index 03c4bf57f59..5a41b061907 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -284,7 +284,22 @@ static const union { #define FP_ILOGB0 (-0x7fffffff - _C2) #define FP_ILOGBNAN 0x7fffffff
-#if _MSVCR_VER >= 120 +_ACRTIMP short __cdecl _dtest(double*); +_ACRTIMP short __cdecl _ldtest(long double*); +_ACRTIMP short __cdecl _fdtest(float*); + +#ifdef __cplusplus + +extern "C++" { +inline int fpclassify(float x) throw() { return _fdtest(&x); } +inline int fpclassify(double x) throw() { return _dtest(&x); } +inline int fpclassify(long double x) throw() { return _ldtest(&x); } +template <class T> inline bool isfinite(T x) throw() { return fpclassify(x) <= 0; } +template <class T> inline bool isinf(T x) throw() { return fpclassify(x) == FP_INFINITE; } +template <class T> inline bool isnan(T x) throw() { return fpclassify(x) == FP_NAN; } +} /* extern "C++" */ + +#elif _MSVCR_VER >= 120
_ACRTIMP short __cdecl _dclass(double); _ACRTIMP short __cdecl _fdclass(float);