msvcrt: Import llroundf implementation from musl.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-04-29 17:06:30 +02:00 committed by Alexandre Julliard
parent 833e8cdd42
commit 668cf2e66d
6 changed files with 8 additions and 20 deletions

1
configure vendored
View file

@ -19636,7 +19636,6 @@ for ac_func in \
llrint \
llrintf \
llround \
llroundf \
log1p \
log1pf \
log2 \

View file

@ -2679,7 +2679,6 @@ AC_CHECK_FUNCS(\
llrint \
llrintf \
llround \
llroundf \
log1p \
log1pf \
log2 \

View file

@ -4384,10 +4384,17 @@ __int64 CDECL llround(double x)
/*********************************************************************
* llroundf (MSVCR120.@)
*
* Copied from musl: src/math/llroundf.c
*/
__int64 CDECL llroundf(float x)
{
return unix_funcs->llroundf( x );
float f = roundf(x);
if (f != (float)(__int64)f) {
*_errno() = EDOM;
return 0;
}
return f;
}
/*********************************************************************

View file

@ -801,18 +801,6 @@ static __int64 CDECL unix_llround(double x)
#endif
}
/*********************************************************************
* llroundf
*/
static __int64 CDECL unix_llroundf(float x)
{
#ifdef HAVE_LLROUNDF
return llroundf(x);
#else
return unix_llround(x);
#endif
}
/*********************************************************************
* sin
*/
@ -969,7 +957,6 @@ static const struct unix_funcs funcs =
unix_llrint,
unix_llrintf,
unix_llround,
unix_llroundf,
unix_log,
unix_logf,
unix_log10,

View file

@ -63,7 +63,6 @@ struct unix_funcs
__int64 (CDECL *llrint)(double x);
__int64 (CDECL *llrintf)(float x);
__int64 (CDECL *llround)(double x);
__int64 (CDECL *llroundf)(float x);
double (CDECL *log)(double x);
float (CDECL *logf)(float x);
double (CDECL *log10)(double x);

View file

@ -462,9 +462,6 @@
/* Define to 1 if you have the `llround' function. */
#undef HAVE_LLROUND
/* Define to 1 if you have the `llroundf' function. */
#undef HAVE_LLROUNDF
/* Define to 1 if you have the `log1p' function. */
#undef HAVE_LOG1P