Commit 45586c57 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Implement llrint using rint function.

parent aa224816
......@@ -19636,7 +19636,6 @@ for ac_func in \
fmaf \
lgamma \
lgammaf \
llrint \
llrintf \
log1p \
log1pf \
......
......@@ -2676,7 +2676,6 @@ AC_CHECK_FUNCS(\
fmaf \
lgamma \
lgammaf \
llrint \
llrintf \
log1p \
log1pf \
......
......@@ -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;
}
/*********************************************************************
......
......@@ -436,18 +436,6 @@ static float CDECL unix_lgammaf(float x)
}
/*********************************************************************
* 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
*/
static __int64 CDECL unix_llrintf(float x)
......@@ -858,7 +846,6 @@ static const struct unix_funcs funcs =
unix_ldexp,
unix_lgamma,
unix_lgammaf,
unix_llrint,
unix_llrintf,
unix_log,
unix_logf,
......
......@@ -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);
......
......@@ -453,9 +453,6 @@
/* Define to 1 if you have the <linux/videodev2.h> 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
......
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