diff --git a/configure b/configure index 794a3e09c29..2251a30af72 100755 --- a/configure +++ b/configure @@ -19641,7 +19641,6 @@ for ac_func in \ log2f \ lrint \ lrintf \ - lround \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/configure.ac b/configure.ac index 3bfa2885002..20ec971b5bb 100644 --- a/configure.ac +++ b/configure.ac @@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\ log2f \ lrint \ lrintf \ - lround \ nearbyint \ nearbyintf \ nexttoward \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index e1251ba7115..018a8ae47e4 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -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; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 3bf99c09c24..a7c7202c516 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -765,18 +765,6 @@ static double CDECL unix_round(double x) #endif } -/********************************************************************* - * lround - */ -static int CDECL unix_lround(double x) -{ -#ifdef HAVE_LROUND - return lround(x); -#else - return unix_round(x); -#endif -} - /********************************************************************* * sin */ @@ -944,7 +932,6 @@ static const struct unix_funcs funcs = unix_logbf, unix_lrint, unix_lrintf, - unix_lround, unix_modf, unix_modff, unix_nearbyint, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index c74115bc76c..89972ed669f 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -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); diff --git a/include/config.h.in b/include/config.h.in index 544fe85b248..387c8b718ff 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -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