Commit 69ad3c11 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Import lround implementation from musl.

parent 7fa8b03c
......@@ -19641,7 +19641,6 @@ for ac_func in \
log2f \
lrint \
lrintf \
lround \
nearbyint \
nearbyintf \
nexttoward \
......
......@@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\
log2f \
lrint \
lrintf \
lround \
nearbyint \
nearbyintf \
nexttoward \
......
......@@ -4360,10 +4360,17 @@ float CDECL roundf(float x)
/*********************************************************************
* lround (MSVCR120.@)
*
* Copied from musl: src/math/lround.c
*/
__msvcrt_long CDECL lround(double x)
{
return unix_funcs->lround( x );
double d = round(x);
if (d != (double)(__msvcrt_long)d) {
*_errno() = EDOM;
return 0;
}
return d;
}
/*********************************************************************
......
......@@ -766,18 +766,6 @@ static double CDECL unix_round(double x)
}
/*********************************************************************
* lround
*/
static int CDECL unix_lround(double x)
{
#ifdef HAVE_LROUND
return lround(x);
#else
return unix_round(x);
#endif
}
/*********************************************************************
* sin
*/
static double CDECL unix_sin( double x )
......@@ -944,7 +932,6 @@ static const struct unix_funcs funcs =
unix_logbf,
unix_lrint,
unix_lrintf,
unix_lround,
unix_modf,
unix_modff,
unix_nearbyint,
......
......@@ -74,7 +74,6 @@ struct unix_funcs
float (CDECL *logbf)(float x);
int (CDECL *lrint)(double x);
int (CDECL *lrintf)(float x);
int (CDECL *lround)(double x);
double (CDECL *modf)(double x, double *iptr);
float (CDECL *modff)(float x, float *iptr);
double (CDECL *nearbyint)(double num);
......
......@@ -477,9 +477,6 @@
/* Define to 1 if you have the `lrintf' function. */
#undef HAVE_LRINTF
/* Define to 1 if you have the `lround' function. */
#undef HAVE_LROUND
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment