msvcrt: Import neabyintf 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
961d611baf
commit
2caca43733
|
@ -19641,7 +19641,6 @@ for ac_func in \
|
|||
log2 \
|
||||
log2f \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
nexttowardf \
|
||||
remainder \
|
||||
|
|
|
@ -2681,7 +2681,6 @@ AC_CHECK_FUNCS(\
|
|||
log2 \
|
||||
log2f \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
nexttowardf \
|
||||
remainder \
|
||||
|
|
|
@ -3426,10 +3426,19 @@ double CDECL nearbyint(double num)
|
|||
|
||||
/*********************************************************************
|
||||
* _nearbyintf (MSVCR120.@)
|
||||
*
|
||||
* Based on musl: src/math/nearbyteintf.c
|
||||
*/
|
||||
float CDECL nearbyintf(float num)
|
||||
float CDECL nearbyintf(float x)
|
||||
{
|
||||
return unix_funcs->nearbyintf( num );
|
||||
fenv_t env;
|
||||
|
||||
fegetenv(&env);
|
||||
_control87(_MCW_EM, _MCW_EM);
|
||||
x = rintf(x);
|
||||
feclearexcept(FE_INEXACT);
|
||||
feupdateenv(&env);
|
||||
return x;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -559,18 +559,6 @@ static double CDECL unix_nearbyint(double num)
|
|||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* nearbyintf
|
||||
*/
|
||||
static float CDECL unix_nearbyintf(float num)
|
||||
{
|
||||
#ifdef HAVE_NEARBYINTF
|
||||
return nearbyintf(num);
|
||||
#else
|
||||
return unix_nearbyint(num);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* nextafter
|
||||
*/
|
||||
|
@ -847,7 +835,6 @@ static const struct unix_funcs funcs =
|
|||
unix_modf,
|
||||
unix_modff,
|
||||
unix_nearbyint,
|
||||
unix_nearbyintf,
|
||||
unix_nextafter,
|
||||
unix_nextafterf,
|
||||
unix_nexttoward,
|
||||
|
|
|
@ -73,7 +73,6 @@ struct unix_funcs
|
|||
double (CDECL *modf)(double x, double *iptr);
|
||||
float (CDECL *modff)(float x, float *iptr);
|
||||
double (CDECL *nearbyint)(double num);
|
||||
float (CDECL *nearbyintf)(float num);
|
||||
double (CDECL *nextafter)(double x, double y);
|
||||
float (CDECL *nextafterf)(float x, float y);
|
||||
double (CDECL *nexttoward)(double x, double y);
|
||||
|
|
|
@ -504,9 +504,6 @@
|
|||
/* Define to 1 if you have the `nearbyint' function. */
|
||||
#undef HAVE_NEARBYINT
|
||||
|
||||
/* Define to 1 if you have the `nearbyintf' function. */
|
||||
#undef HAVE_NEARBYINTF
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
|
|
Loading…
Reference in New Issue