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:
parent
45586c5703
commit
0cdc52c65c
1
configure
vendored
1
configure
vendored
@ -19636,7 +19636,6 @@ for ac_func in \
|
||||
fmaf \
|
||||
lgamma \
|
||||
lgammaf \
|
||||
llrintf \
|
||||
log1p \
|
||||
log1pf \
|
||||
log2 \
|
||||
|
@ -2676,7 +2676,6 @@ AC_CHECK_FUNCS(\
|
||||
fmaf \
|
||||
lgamma \
|
||||
lgammaf \
|
||||
llrintf \
|
||||
log1p \
|
||||
log1pf \
|
||||
log2 \
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user