msvcrt: Import remainder implementation from musl.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-05-19 15:26:17 +02:00 committed by Alexandre Julliard
parent de0dc0e8ac
commit fd22e3b61b
7 changed files with 9 additions and 24 deletions

1
configure vendored
View File

@ -19638,7 +19638,6 @@ for ac_func in \
log1pf \
log2 \
log2f \
remainder \
remainderf \
tgamma \
tgammaf

View File

@ -2678,7 +2678,6 @@ AC_CHECK_FUNCS(\
log1pf \
log2 \
log2f \
remainder \
remainderf \
tgamma \
tgammaf

View File

@ -5474,13 +5474,16 @@ float CDECL _scalbf(float num, __msvcrt_long power)
/*********************************************************************
* remainder (MSVCR120.@)
*
* Copied from musl: src/math/remainder.c
*/
double CDECL remainder(double x, double y)
{
/* this matches 64-bit Windows. 32-bit Windows is slightly different */
if(!isfinite(x)) *_errno() = EDOM;
if(isnan(y) || y==0.0) *_errno() = EDOM;
return unix_funcs->remainder( x, y );
int q;
#if _MSVCR_VER == 120 && defined(__x86_64__)
if (isnan(x) || isnan(y)) *_errno() = EDOM;
#endif
return remquo(x, y, &q);
}
/*********************************************************************

View File

@ -475,19 +475,6 @@ static float CDECL unix_powf( float x, float y )
return powf( x, y );
}
/*********************************************************************
* remainder
*/
static double CDECL unix_remainder(double x, double y)
{
#ifdef HAVE_REMAINDER
return remainder(x, y);
#else
FIXME( "not implemented\n" );
return 0;
#endif
}
/*********************************************************************
* remainderf
*/
@ -634,7 +621,6 @@ static const struct unix_funcs funcs =
unix_logbf,
unix_pow,
unix_powf,
unix_remainder,
unix_remainderf,
unix_sin,
unix_sinf,

View File

@ -64,7 +64,6 @@ struct unix_funcs
float (CDECL *logbf)(float x);
double (CDECL *pow)(double x, double y);
float (CDECL *powf)(float x, float y);
double (CDECL *remainder)(double x, double y);
float (CDECL *remainderf)(float x, float y);
double (CDECL *sin)(double x);
float (CDECL *sinf)(float x);

View File

@ -630,9 +630,6 @@
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
/* Define to 1 if you have the `remainder' function. */
#undef HAVE_REMAINDER
/* Define to 1 if you have the `remainderf' function. */
#undef HAVE_REMAINDERF

View File

@ -73,6 +73,8 @@ _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 remquo(double, double, int*);
_ACRTIMP float __cdecl remquof(float, float, int*);
_ACRTIMP double __cdecl _hypot(double, double);
_ACRTIMP double __cdecl _j0(double);