msvcrt: Import lround implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7fa8b03cd3
commit
69ad3c11cf
|
@ -19641,7 +19641,6 @@ for ac_func in \
|
|||
log2f \
|
||||
lrint \
|
||||
lrintf \
|
||||
lround \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
|
|
|
@ -2684,7 +2684,6 @@ AC_CHECK_FUNCS(\
|
|||
log2f \
|
||||
lrint \
|
||||
lrintf \
|
||||
lround \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
|
|
|
@ -4360,10 +4360,17 @@ float CDECL roundf(float x)
|
|||
|
||||
/*********************************************************************
|
||||
* lround (MSVCR120.@)
|
||||
*
|
||||
* Copied from musl: src/math/lround.c
|
||||
*/
|
||||
__msvcrt_long CDECL lround(double x)
|
||||
{
|
||||
return unix_funcs->lround( x );
|
||||
double d = round(x);
|
||||
if (d != (double)(__msvcrt_long)d) {
|
||||
*_errno() = EDOM;
|
||||
return 0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -765,18 +765,6 @@ static double CDECL unix_round(double x)
|
|||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* lround
|
||||
*/
|
||||
static int CDECL unix_lround(double x)
|
||||
{
|
||||
#ifdef HAVE_LROUND
|
||||
return lround(x);
|
||||
#else
|
||||
return unix_round(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* sin
|
||||
*/
|
||||
|
@ -944,7 +932,6 @@ static const struct unix_funcs funcs =
|
|||
unix_logbf,
|
||||
unix_lrint,
|
||||
unix_lrintf,
|
||||
unix_lround,
|
||||
unix_modf,
|
||||
unix_modff,
|
||||
unix_nearbyint,
|
||||
|
|
|
@ -74,7 +74,6 @@ struct unix_funcs
|
|||
float (CDECL *logbf)(float x);
|
||||
int (CDECL *lrint)(double x);
|
||||
int (CDECL *lrintf)(float x);
|
||||
int (CDECL *lround)(double x);
|
||||
double (CDECL *modf)(double x, double *iptr);
|
||||
float (CDECL *modff)(float x, float *iptr);
|
||||
double (CDECL *nearbyint)(double num);
|
||||
|
|
|
@ -477,9 +477,6 @@
|
|||
/* Define to 1 if you have the `lrintf' function. */
|
||||
#undef HAVE_LRINTF
|
||||
|
||||
/* Define to 1 if you have the `lround' function. */
|
||||
#undef HAVE_LROUND
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
|
|
Loading…
Reference in New Issue