Signed-off-by: Daniel Lehman dlehman25@gmail.com --- v2: correct some declarations --- include/msvcrt/math.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index da07303bcd9..82f58839cd8 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -69,12 +69,16 @@ _ACRTIMP double __cdecl fabs(double); _ACRTIMP double __cdecl ldexp(double, int); _ACRTIMP double __cdecl frexp(double, int*); _ACRTIMP double __cdecl modf(double, double*); +_ACRTIMP double __cdecl fdim(double, double); _ACRTIMP double __cdecl fmod(double, double); _ACRTIMP double __cdecl fmin(double, double); _ACRTIMP double __cdecl fmax(double, double); _ACRTIMP double __cdecl erf(double); +_ACRTIMP double __cdecl remainder(double, double); _ACRTIMP double __cdecl remquo(double, double, int*); _ACRTIMP float __cdecl remquof(float, float, int*); +_ACRTIMP double __cdecl lgamma(double); +_ACRTIMP double __cdecl tgamma(double);
_ACRTIMP double __cdecl _hypot(double, double); _ACRTIMP double __cdecl _j0(double); @@ -86,18 +90,31 @@ _ACRTIMP double __cdecl _yn(int, double);
_ACRTIMP double __cdecl cbrt(double); _ACRTIMP double __cdecl exp2(double); +_ACRTIMP double __cdecl expm1(double); +_ACRTIMP double __cdecl log1p(double); _ACRTIMP double __cdecl log2(double); +_ACRTIMP double __cdecl logb(double); _ACRTIMP double __cdecl rint(double); _ACRTIMP double __cdecl round(double); _ACRTIMP double __cdecl trunc(double);
_ACRTIMP float __cdecl cbrtf(float); _ACRTIMP float __cdecl exp2f(float); +_ACRTIMP float __cdecl expm1f(float); +_ACRTIMP float __cdecl log1pf(float); _ACRTIMP float __cdecl log2f(float); +_ACRTIMP float __cdecl logbf(float); _ACRTIMP float __cdecl rintf(float); _ACRTIMP float __cdecl roundf(float); _ACRTIMP float __cdecl truncf(float);
+_ACRTIMP int __cdecl ilogb(double); +_ACRTIMP int __cdecl ilogbf(float); + +_ACRTIMP long long __cdecl llrint(double); +_ACRTIMP long long __cdecl llrintf(float); +_ACRTIMP long long __cdecl llround(double); +_ACRTIMP long long __cdecl llroundf(float); _ACRTIMP __msvcrt_long __cdecl lrint(double); _ACRTIMP __msvcrt_long __cdecl lrintf(float); _ACRTIMP __msvcrt_long __cdecl lround(double); @@ -105,6 +122,8 @@ _ACRTIMP __msvcrt_long __cdecl lroundf(float);
_ACRTIMP double __cdecl scalbn(double,int); _ACRTIMP float __cdecl scalbnf(float,int); +_ACRTIMP double __cdecl scalbln(double,__msvcrt_long); +_ACRTIMP float __cdecl scalblnf(float,__msvcrt_long);
_ACRTIMP double __cdecl _copysign (double, double); _ACRTIMP double __cdecl _chgsign (double); @@ -115,6 +134,8 @@ _ACRTIMP int __cdecl _finite(double); _ACRTIMP int __cdecl _isnan(double); _ACRTIMP int __cdecl _fpclass(double);
+_ACRTIMP double __cdecl nextafter(double, double); + #ifndef __i386__
_ACRTIMP float __cdecl sinf(float); @@ -199,6 +220,14 @@ _ACRTIMP float __cdecl _logbf(float); _ACRTIMP float __cdecl acoshf(float); _ACRTIMP float __cdecl asinhf(float); _ACRTIMP float __cdecl atanhf(float); +_ACRTIMP float __cdecl erff(float); +_ACRTIMP float __cdecl fdimf(float, float); +_ACRTIMP float __cdecl fmaxf(float, float); +_ACRTIMP float __cdecl fminf(float, float); +_ACRTIMP float __cdecl lgammaf(float); +_ACRTIMP float __cdecl nextafterf(float, float); +_ACRTIMP float __cdecl remainderf(float, float); +_ACRTIMP float __cdecl tgammaf(float);
#else
@@ -208,6 +237,14 @@ static inline float _logbf(float x) { return _logb(x); } static inline float acoshf(float x) { return acosh(x); } static inline float asinhf(float x) { return asinh(x); } static inline float atanhf(float x) { return atanh(x); } +static inline float erff(float x) { return erf(x); } +static inline float fdimf(float x, float y) { return fdim(x, y); } +static inline float fmaxf(float x, float y) { return fmax(x, y); } +static inline float fminf(float x, float y) { return fmin(x, y); } +static inline float lgammaf(float x) { return lgamma(x); } +static inline float nextafterf(float x, float y) { return nextafter(x, y); } +static inline float remainderf(float x, float y) { return remainder(x, y); } +static inline float tgammaf(float x) { return tgamma(x); }
#endif
Hi Daniel,
On 4/5/22 04:40, Daniel Lehman wrote:
+static inline float nextafterf(float x, float y) { return nextafter(x, y); }
This will not work.
Thanks, Piotr
On 4/4/22 21:40, Daniel Lehman wrote:
@@ -208,6 +237,14 @@ static inline float _logbf(float x) { return _logb(x); } static inline float acoshf(float x) { return acosh(x); } static inline float asinhf(float x) { return asinh(x); } static inline float atanhf(float x) { return atanh(x); } +static inline float erff(float x) { return erf(x); } +static inline float fdimf(float x, float y) { return fdim(x, y); } +static inline float fmaxf(float x, float y) { return fmax(x, y); } +static inline float fminf(float x, float y) { return fmin(x, y); } +static inline float lgammaf(float x) { return lgamma(x); } +static inline float nextafterf(float x, float y) { return nextafter(x, y); } +static inline float remainderf(float x, float y) { return remainder(x, y); } +static inline float tgammaf(float x) { return tgamma(x); }
#endif
All of these functions don't seem to be available for CRT versions below 120, i.e. neither the float or double version is, so these forwards won't work anyway. It looks like the asinh/acosh/atanh forwards are also broken in this respect.