msvcrt: Implement llrintf using rintf function.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-05-10 20:12:05 +02:00 committed by Alexandre Julliard
parent 45586c5703
commit 0cdc52c65c
6 changed files with 9 additions and 20 deletions

1
configure vendored
View file

@ -19636,7 +19636,6 @@ for ac_func in \
fmaf \
lgamma \
lgammaf \
llrintf \
log1p \
log1pf \
log2 \

View file

@ -2676,7 +2676,6 @@ AC_CHECK_FUNCS(\
fmaf \
lgamma \
lgammaf \
llrintf \
log1p \
log1pf \
log2 \

View file

@ -4388,7 +4388,15 @@ __int64 CDECL llrint(double x)
*/
__int64 CDECL llrintf(float x)
{
return unix_funcs->llrintf( x );
float f;
f = rintf(x);
if ((f < 0 && f != (float)(__int64)f)
|| (f >= 0 && f != (float)(unsigned __int64)f)) {
*_errno() = EDOM;
return 0;
}
return f;
}
/*********************************************************************

View file

@ -435,18 +435,6 @@ static float CDECL unix_lgammaf(float x)
#endif
}
/*********************************************************************
* llrintf
*/
static __int64 CDECL unix_llrintf(float x)
{
#ifdef HAVE_LLRINTF
return llrintf(x);
#else
return x >= 0 ? floorf(x + 0.5) : ceilf(x - 0.5);
#endif
}
/*********************************************************************
* log
*/
@ -846,7 +834,6 @@ static const struct unix_funcs funcs =
unix_ldexp,
unix_lgamma,
unix_lgammaf,
unix_llrintf,
unix_log,
unix_logf,
unix_log10,

View file

@ -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 *llrintf)(float x);
double (CDECL *log)(double x);
float (CDECL *logf)(float x);
double (CDECL *log10)(double x);

View file

@ -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 `llrintf' function. */
#undef HAVE_LLRINTF
/* Define to 1 if you have the `log1p' function. */
#undef HAVE_LOG1P