Alexandre Julliard : include: Define fpclassify().
Alexandre Julliard
julliard at winehq.org
Fri Oct 15 15:40:04 CDT 2021
Module: wine
Branch: master
Commit: 29717168359b152fe7a8d7dd53d990955692d693
URL: https://source.winehq.org/git/wine.git/?a=commit;h=29717168359b152fe7a8d7dd53d990955692d693
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 15 11:05:38 2021 +0200
include: Define fpclassify().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
include/msvcrt/math.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h
index d4db618f542..da07303bcd9 100644
--- a/include/msvcrt/math.h
+++ b/include/msvcrt/math.h
@@ -251,11 +251,22 @@ static const union {
#define FP_ILOGB0 (-0x7fffffff - _C2)
#define FP_ILOGBNAN 0x7fffffff
+#if _MSVCR_VER >= 120
+
_ACRTIMP short __cdecl _dclass(double);
_ACRTIMP short __cdecl _fdclass(float);
_ACRTIMP int __cdecl _dsign(double);
_ACRTIMP int __cdecl _fdsign(float);
+#define fpclassify(x) (sizeof(x) == sizeof(float) ? _fdclass(x) : _dclass(x))
+#define signbit(x) (sizeof(x) == sizeof(float) ? _fdsign(x) : _dsign(x))
+#define isinf(x) (fpclassify(x) == FP_INFINITE)
+#define isnan(x) (fpclassify(x) == FP_NAN)
+#define isnormal(x) (fpclassify(x) == FP_NORMAL)
+#define isfinite(x) (fpclassify(x) <= 0)
+
+#else
+
static inline int __isnanf(float x)
{
union { float x; unsigned int i; } u = { x };
@@ -303,6 +314,8 @@ static inline int __signbit(double x)
#define signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : __signbit(x))
#define isfinite(x) (!isinf(x) && !isnan(x))
+#endif
+
#ifdef __cplusplus
}
#endif
More information about the wine-cvs
mailing list