[PATCH v3] include: Add some math declarations.
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com> --- v3: remove incorrect declarations and other unavailable functions v2: correct some declarations --- include/msvcrt/math.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index da07303bcd9..97ae6dfe240 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,15 +220,20 @@ _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 static inline float _chgsignf(float x) { return _chgsign(x); } static inline float _copysignf(float x, float y) { return _copysign(x, y); } 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); } #endif -- 2.25.1
Daniel Lehman <dlehman25(a)gmail.com> writes:
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
--- v3: remove incorrect declarations and other unavailable functions v2: correct some declarations --- include/msvcrt/math.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)
It doesn't match the function definitions: gcc -m64 -c -o dlls/msvcr120/math.o ../wine/dlls/msvcrt/math.c -Idlls/msvcr120 -I../wine/dlls/msvcr120 \ -I../wine/dlls/msvcrt -Iinclude -I../wine/include -I../wine/include/msvcrt -D__WINESRC__ \ -D_CRTIMP= -D_MSVCR_VER=120 -Wall -pipe -fcf-protection=none -fno-stack-protector \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-4 -fPIC \ -fasynchronous-unwind-tables -D_WIN32 -fno-builtin -fshort-wchar -Wno-format -mabi=ms -g -O2 -fno-diagnostics-show-caret ../wine/dlls/msvcrt/math.c:8698:15: error: conflicting types for ‘llrint’; have ‘long int(double)’ In file included from ../wine/dlls/msvcrt/math.c:45: ../wine/include/msvcrt/math.h:114:28: note: previous declaration of ‘llrint’ with type ‘long long int(double)’ ../wine/dlls/msvcrt/math.c:8714:15: error: conflicting types for ‘llrintf’; have ‘long int(float)’ In file included from ../wine/dlls/msvcrt/math.c:45: ../wine/include/msvcrt/math.h:115:28: note: previous declaration of ‘llrintf’ with type ‘long long int(float)’ ../wine/dlls/msvcrt/math.c:8801:15: error: conflicting types for ‘llround’; have ‘long int(double)’ In file included from ../wine/dlls/msvcrt/math.c:45: ../wine/include/msvcrt/math.h:116:28: note: previous declaration of ‘llround’ with type ‘long long int(double)’ ../wine/dlls/msvcrt/math.c:8816:15: error: conflicting types for ‘llroundf’; have ‘long int(float)’ In file included from ../wine/dlls/msvcrt/math.c:45: ../wine/include/msvcrt/math.h:117:28: note: previous declaration of ‘llroundf’ with type ‘long long int(float)’ make: *** [Makefile:104865: dlls/msvcr120/math.o] Error 1 -- Alexandre Julliard julliard(a)winehq.org
In file included from ../wine/dlls/msvcrt/math.c:45: ../wine/include/msvcrt/math.h:117:28: note: previous declaration of ‘llroundf’ with type ‘long long int(float)’ make: *** [Makefile:104865: dlls/msvcr120/math.o] Error 1
i didn't see those with mingw/llvm (although there are a ton of warnings without my changes) but i tried with gcc and without-mingw and do see those errors. i'll send another version thanks daniel
participants (3)
-
Alexandre Julliard -
Daniel Lehman -
Piotr Caban