msvcrt: Import lroundf 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-04-29 17:06:35 +02:00 committed by Alexandre Julliard
parent 389e0532fe
commit 7fa8b03cd3
6 changed files with 8 additions and 20 deletions

1
configure vendored
View File

@ -19642,7 +19642,6 @@ for ac_func in \
lrint \
lrintf \
lround \
lroundf \
nearbyint \
nearbyintf \
nexttoward \

View File

@ -2685,7 +2685,6 @@ AC_CHECK_FUNCS(\
lrint \
lrintf \
lround \
lroundf \
nearbyint \
nearbyintf \
nexttoward \

View File

@ -4368,10 +4368,17 @@ __msvcrt_long CDECL lround(double x)
/*********************************************************************
* lroundf (MSVCR120.@)
*
* Copied from musl: src/math/lroundf.c
*/
__msvcrt_long CDECL lroundf(float x)
{
return unix_funcs->lroundf( x );
float f = roundf(x);
if (f != (float)(__msvcrt_long)f) {
*_errno() = EDOM;
return 0;
}
return f;
}
/*********************************************************************

View File

@ -777,18 +777,6 @@ static int CDECL unix_lround(double x)
#endif
}
/*********************************************************************
* lroundf
*/
static int CDECL unix_lroundf(float x)
{
#ifdef HAVE_LROUNDF
return lroundf(x);
#else
return unix_lround(x);
#endif
}
/*********************************************************************
* sin
*/
@ -957,7 +945,6 @@ static const struct unix_funcs funcs =
unix_lrint,
unix_lrintf,
unix_lround,
unix_lroundf,
unix_modf,
unix_modff,
unix_nearbyint,

View File

@ -75,7 +75,6 @@ struct unix_funcs
int (CDECL *lrint)(double x);
int (CDECL *lrintf)(float x);
int (CDECL *lround)(double x);
int (CDECL *lroundf)(float x);
double (CDECL *modf)(double x, double *iptr);
float (CDECL *modff)(float x, float *iptr);
double (CDECL *nearbyint)(double num);

View File

@ -480,9 +480,6 @@
/* Define to 1 if you have the `lround' function. */
#undef HAVE_LROUND
/* Define to 1 if you have the `lroundf' function. */
#undef HAVE_LROUNDF
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT