Alexandre Julliard : include/msvcrt: Define more math functions.

Alexandre Julliard julliard at winehq.org
Wed May 29 15:50:35 CDT 2019


Module: wine
Branch: master
Commit: 54bd7e655a4c21d769f6f57402ea38b6b8c8ac3f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=54bd7e655a4c21d769f6f57402ea38b6b8c8ac3f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 29 09:57:08 2019 +0200

include/msvcrt: Define more math functions.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/msvcrt/math.h | 82 ++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 55 insertions(+), 27 deletions(-)

diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h
index c539ebe..b82961e 100644
--- a/include/msvcrt/math.h
+++ b/include/msvcrt/math.h
@@ -70,6 +70,9 @@ double __cdecl ldexp(double, int);
 double __cdecl frexp(double, int*);
 double __cdecl modf(double, double*);
 double __cdecl fmod(double, double);
+double __cdecl fmin(double, double);
+double __cdecl fmax(double, double);
+double __cdecl erf(double);
 
 double __cdecl _hypot(double, double);
 double __cdecl _j0(double);
@@ -98,7 +101,16 @@ long __cdecl lrintf(float);
 long __cdecl lround(double);
 long __cdecl lroundf(float);
 
-#if defined(__x86_64__) || defined(__arm__)
+double __cdecl _copysign (double, double);
+double __cdecl _chgsign (double);
+double __cdecl _scalb(double, __msvcrt_long);
+double __cdecl _logb(double);
+double __cdecl _nextafter(double, double);
+int    __cdecl _finite(double);
+int    __cdecl _isnan(double);
+int    __cdecl _fpclass(double);
+
+#ifndef __i386__
 
 float __cdecl sinf(float);
 float __cdecl cosf(float);
@@ -121,41 +133,57 @@ float __cdecl sqrtf(float);
 float __cdecl ceilf(float);
 float __cdecl floorf(float);
 float __cdecl fabsf(float);
-float __cdecl ldexpf(float, int);
 float __cdecl frexpf(float, int*);
 float __cdecl modff(float, float*);
 float __cdecl fmodf(float, float);
 
+float __cdecl _copysignf(float, float);
+float __cdecl _chgsignf(float);
+float __cdecl _logbf(float);
+int   __cdecl _finitef(float);
+int   __cdecl _isnanf(float);
+int   __cdecl _fpclassf(float);
+
 #else
 
-#define sinf(x) ((float)sin((double)(x)))
-#define cosf(x) ((float)cos((double)(x)))
-#define tanf(x) ((float)tan((double)(x)))
-#define sinhf(x) ((float)sinh((double)(x)))
-#define coshf(x) ((float)cosh((double)(x)))
-#define tanhf(x) ((float)tanh((double)(x)))
-#define asinf(x) ((float)asin((double)(x)))
-#define acosf(x) ((float)acos((double)(x)))
-#define atanf(x) ((float)atan((double)(x)))
-#define atan2f(x,y) ((float)atan2((double)(x), (double)(y)))
-#define asinhf(x) ((float)asinh((double)(x)))
-#define acoshf(x) ((float)acosh((double)(x)))
-#define atanhf(x) ((float)atanh((double)(x)))
-#define expf(x) ((float)exp((double)(x)))
-#define logf(x) ((float)log((double)(x)))
-#define log10f(x) ((float)log10((double)(x)))
-#define powf(x,y) ((float)pow((double)(x), (double)(y)))
-#define sqrtf(x) ((float)sqrt((double)(x)))
-#define ceilf(x) ((float)ceil((double)(x)))
-#define floorf(x) ((float)floor((double)(x)))
-#define fabsf(x) ((float)fabs((double)(x)))
-#define frexpf(x) ((float)frexp((double)(x)))
-#define modff(x,y) ((float)modf((double)(x), (double*)(y)))
-#define fmodf(x,y) ((float)fmod((double)(x), (double)(y)))
+static inline float sinf(float x) { return sin(x); }
+static inline float cosf(float x) { return cos(x); }
+static inline float tanf(float x) { return tan(x); }
+static inline float sinhf(float x) { return sinh(x); }
+static inline float coshf(float x) { return cosh(x); }
+static inline float tanhf(float x) { return tanh(x); }
+static inline float asinf(float x) { return asin(x); }
+static inline float acosf(float x) { return acos(x); }
+static inline float atanf(float x) { return atan(x); }
+static inline float atan2f(float x, float y) { return atan2(x, y); }
+static inline float asinhf(float x) { return asinh(x); }
+static inline float acoshf(float x) { return acosh(x); }
+static inline float atanhf(float x) { return atanh(x); }
+static inline float expf(float x) { return exp(x); }
+static inline float logf(float x) { return log(x); }
+static inline float log10f(float x) { return log10(x); }
+static inline float powf(float x, float y) { return pow(x, y); }
+static inline float sqrtf(float x) { return sqrt(x); }
+static inline float ceilf(float x) { return ceil(x); }
+static inline float floorf(float x) { return floor(x); }
+static inline float fabsf(float x) { return fabs(x); }
+static inline float frexpf(float x, int *y) { return frexp(x, y); }
+static inline float modff(float x, float *y) { double yd, ret = modf(x, &yd); *y = yd; return ret; }
+static inline float fmodf(float x, float y) { return fmod(x, y); }
+
+static inline float _copysignf(float x, float y) { return _copysign(x, y); }
+static inline float _chgsignf(float x) { return _chgsign(x); }
+static inline float _logbf(float x) { return _logb(x); }
+static inline int   _finitef(float x) { return _finite(x); }
+static inline int   _isnanf(float x) { return _isnan(x); }
+static inline int   _fpclassf(float x) { return _fpclass(x); }
 
 #endif
 
-#define ldexpf(x,y) ((float)ldexp((double)(x),(y)))
+static inline float ldexpf(float x, int y) { return ldexp(x, y); }
+
+#define copysign(x,y)  _copysign(x,y)
+#define copysignf(x,y) _copysignf(x,y)
 
 double __cdecl nearbyint(double);
 float __cdecl nearbyintf(float);




More information about the wine-cvs mailing list