mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-04 18:57:38 +00:00
msvcrt: Implement lrintf 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
0838c995ea
commit
aa2248164c
1
configure
vendored
1
configure
vendored
|
@ -19642,7 +19642,6 @@ for ac_func in \
|
|||
log1pf \
|
||||
log2 \
|
||||
log2f \
|
||||
lrintf \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
|
|
|
@ -2682,7 +2682,6 @@ AC_CHECK_FUNCS(\
|
|||
log1pf \
|
||||
log2 \
|
||||
log2f \
|
||||
lrintf \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
|
|
|
@ -4356,7 +4356,15 @@ __msvcrt_long CDECL lrint(double x)
|
|||
*/
|
||||
__msvcrt_long CDECL lrintf(float x)
|
||||
{
|
||||
return unix_funcs->lrintf( x );
|
||||
float f;
|
||||
|
||||
f = rintf(x);
|
||||
if ((f < 0 && f != (float)(__msvcrt_long)f)
|
||||
|| (f >= 0 && f != (float)(__msvcrt_ulong)f)) {
|
||||
*_errno() = EDOM;
|
||||
return 0;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -555,18 +555,6 @@ static float CDECL unix_logbf( float x )
|
|||
return logbf( x );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* lrintf
|
||||
*/
|
||||
static int CDECL unix_lrintf(float x)
|
||||
{
|
||||
#ifdef HAVE_LRINTF
|
||||
return lrintf(x);
|
||||
#else
|
||||
return x >= 0 ? floorf(x + 0.5) : ceilf(x - 0.5);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* modf
|
||||
*/
|
||||
|
@ -882,7 +870,6 @@ static const struct unix_funcs funcs =
|
|||
unix_log2f,
|
||||
unix_logb,
|
||||
unix_logbf,
|
||||
unix_lrintf,
|
||||
unix_modf,
|
||||
unix_modff,
|
||||
unix_nearbyint,
|
||||
|
|
|
@ -72,7 +72,6 @@ struct unix_funcs
|
|||
float (CDECL *log2f)(float x);
|
||||
double (CDECL *logb)(double x);
|
||||
float (CDECL *logbf)(float x);
|
||||
int (CDECL *lrintf)(float x);
|
||||
double (CDECL *modf)(double x, double *iptr);
|
||||
float (CDECL *modff)(float x, float *iptr);
|
||||
double (CDECL *nearbyint)(double num);
|
||||
|
|
|
@ -471,9 +471,6 @@
|
|||
/* Define to 1 if you have the `log2f' function. */
|
||||
#undef HAVE_LOG2F
|
||||
|
||||
/* Define to 1 if you have the `lrintf' function. */
|
||||
#undef HAVE_LRINTF
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
|
|
Loading…
Reference in a new issue