diff --git a/configure b/configure index b4434b16a86..d4f1cf1383c 100755 --- a/configure +++ b/configure @@ -19636,7 +19636,6 @@ for ac_func in \ fmaf \ lgamma \ lgammaf \ - llrint \ llrintf \ log1p \ log1pf \ diff --git a/configure.ac b/configure.ac index 2cd25a5671b..8fa4eac0961 100644 --- a/configure.ac +++ b/configure.ac @@ -2676,7 +2676,6 @@ AC_CHECK_FUNCS(\ fmaf \ lgamma \ lgammaf \ - llrint \ llrintf \ log1p \ log1pf \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 22b2b0c71ed..b9209e7b349 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4372,7 +4372,15 @@ __msvcrt_long CDECL lrintf(float x) */ __int64 CDECL llrint(double x) { - return unix_funcs->llrint( x ); + double d; + + d = rint(x); + if ((d < 0 && d != (double)(__int64)d) + || (d >= 0 && d != (double)(unsigned __int64)d)) { + *_errno() = EDOM; + return 0; + } + return d; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 52410b0cc9c..a7a69405877 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -435,18 +435,6 @@ static float CDECL unix_lgammaf(float x) #endif } -/********************************************************************* - * llrint - */ -static __int64 CDECL unix_llrint(double x) -{ -#ifdef HAVE_LLRINT - return llrint(x); -#else - return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); -#endif -} - /********************************************************************* * llrintf */ @@ -858,7 +846,6 @@ static const struct unix_funcs funcs = unix_ldexp, unix_lgamma, unix_lgammaf, - unix_llrint, unix_llrintf, unix_log, unix_logf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 4a33940fd64..56e8d630dc2 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -60,7 +60,6 @@ struct unix_funcs double (CDECL *ldexp)(double x, int exp); double (CDECL *lgamma)(double x); float (CDECL *lgammaf)(float x); - __int64 (CDECL *llrint)(double x); __int64 (CDECL *llrintf)(float x); double (CDECL *log)(double x); float (CDECL *logf)(float x); diff --git a/include/config.h.in b/include/config.h.in index 920600dd680..db5dba7a54f 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -453,9 +453,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VIDEODEV2_H -/* Define to 1 if you have the `llrint' function. */ -#undef HAVE_LLRINT - /* Define to 1 if you have the `llrintf' function. */ #undef HAVE_LLRINTF