Commit 7fa8b03c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Import lroundf implementation from musl.

parent 389e0532
...@@ -19642,7 +19642,6 @@ for ac_func in \ ...@@ -19642,7 +19642,6 @@ for ac_func in \
lrint \ lrint \
lrintf \ lrintf \
lround \ lround \
lroundf \
nearbyint \ nearbyint \
nearbyintf \ nearbyintf \
nexttoward \ nexttoward \
......
...@@ -2685,7 +2685,6 @@ AC_CHECK_FUNCS(\ ...@@ -2685,7 +2685,6 @@ AC_CHECK_FUNCS(\
lrint \ lrint \
lrintf \ lrintf \
lround \ lround \
lroundf \
nearbyint \ nearbyint \
nearbyintf \ nearbyintf \
nexttoward \ nexttoward \
......
...@@ -4368,10 +4368,17 @@ __msvcrt_long CDECL lround(double x) ...@@ -4368,10 +4368,17 @@ __msvcrt_long CDECL lround(double x)
/********************************************************************* /*********************************************************************
* lroundf (MSVCR120.@) * lroundf (MSVCR120.@)
*
* Copied from musl: src/math/lroundf.c
*/ */
__msvcrt_long CDECL lroundf(float x) __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;
} }
/********************************************************************* /*********************************************************************
......
...@@ -778,18 +778,6 @@ static int CDECL unix_lround(double x) ...@@ -778,18 +778,6 @@ static int CDECL unix_lround(double x)
} }
/********************************************************************* /*********************************************************************
* lroundf
*/
static int CDECL unix_lroundf(float x)
{
#ifdef HAVE_LROUNDF
return lroundf(x);
#else
return unix_lround(x);
#endif
}
/*********************************************************************
* sin * sin
*/ */
static double CDECL unix_sin( double x ) static double CDECL unix_sin( double x )
...@@ -957,7 +945,6 @@ static const struct unix_funcs funcs = ...@@ -957,7 +945,6 @@ static const struct unix_funcs funcs =
unix_lrint, unix_lrint,
unix_lrintf, unix_lrintf,
unix_lround, unix_lround,
unix_lroundf,
unix_modf, unix_modf,
unix_modff, unix_modff,
unix_nearbyint, unix_nearbyint,
......
...@@ -75,7 +75,6 @@ struct unix_funcs ...@@ -75,7 +75,6 @@ struct unix_funcs
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); int (CDECL *lround)(double x);
int (CDECL *lroundf)(float 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);
......
...@@ -480,9 +480,6 @@ ...@@ -480,9 +480,6 @@
/* Define to 1 if you have the `lround' function. */ /* Define to 1 if you have the `lround' function. */
#undef HAVE_LROUND #undef HAVE_LROUND
/* Define to 1 if you have the `lroundf' function. */
#undef HAVE_LROUNDF
/* 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