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 \ ...@@ -19641,7 +19641,6 @@ for ac_func in \
log2f \ log2f \
lrint \ lrint \
lrintf \ lrintf \
lround \
nearbyint \ nearbyint \
nearbyintf \ nearbyintf \
nexttoward \ nexttoward \
......
...@@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\ ...@@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\
log2f \ log2f \
lrint \ lrint \
lrintf \ lrintf \
lround \
nearbyint \ nearbyint \
nearbyintf \ nearbyintf \
nexttoward \ nexttoward \
......
...@@ -4360,10 +4360,17 @@ float CDECL roundf(float x) ...@@ -4360,10 +4360,17 @@ float CDECL roundf(float x)
/********************************************************************* /*********************************************************************
* lround (MSVCR120.@) * lround (MSVCR120.@)
*
* Copied from musl: src/math/lround.c
*/ */
__msvcrt_long CDECL lround(double x) __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) ...@@ -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 * sin
*/ */
static double CDECL unix_sin( double x ) static double CDECL unix_sin( double x )
...@@ -944,7 +932,6 @@ static const struct unix_funcs funcs = ...@@ -944,7 +932,6 @@ static const struct unix_funcs funcs =
unix_logbf, unix_logbf,
unix_lrint, unix_lrint,
unix_lrintf, unix_lrintf,
unix_lround,
unix_modf, unix_modf,
unix_modff, unix_modff,
unix_nearbyint, unix_nearbyint,
......
...@@ -74,7 +74,6 @@ struct unix_funcs ...@@ -74,7 +74,6 @@ struct unix_funcs
float (CDECL *logbf)(float x); float (CDECL *logbf)(float x);
int (CDECL *lrint)(double x); int (CDECL *lrint)(double x);
int (CDECL *lrintf)(float x); int (CDECL *lrintf)(float x);
int (CDECL *lround)(double x);
double (CDECL *modf)(double x, double *iptr); double (CDECL *modf)(double x, double *iptr);
float (CDECL *modff)(float x, float *iptr); float (CDECL *modff)(float x, float *iptr);
double (CDECL *nearbyint)(double num); double (CDECL *nearbyint)(double num);
......
...@@ -477,9 +477,6 @@ ...@@ -477,9 +477,6 @@
/* Define to 1 if you have the `lrintf' function. */ /* Define to 1 if you have the `lrintf' function. */
#undef HAVE_LRINTF #undef HAVE_LRINTF
/* Define to 1 if you have the `lround' function. */
#undef HAVE_LROUND
/* Define to 1 if you have the `lstat' function. */ /* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT #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