LibC: Implement nan{,f,l} as functions

One port was using function pointers to these functions so macros don't
work.
This commit is contained in:
Bananymous 2024-11-08 02:49:21 +02:00
parent 4417268ecc
commit 92862fdf39
2 changed files with 6 additions and 3 deletions

View File

@ -191,9 +191,9 @@ long lroundl(long double);
double modf(double, double*); double modf(double, double*);
float modff(float, float*); float modff(float, float*);
long double modfl(long double, long double*); long double modfl(long double, long double*);
#define nan(tagp) __builtin_nan(tagp) double nan(const char*);
#define nanf(tagp) __builtin_nanf(tagp) float nanf(const char*);
#define nanl(tagp) __builtin_nanl(tagp) long double nanl(const char*);
double nearbyint(double); double nearbyint(double);
float nearbyintf(float); float nearbyintf(float);
long double nearbyintl(long double); long double nearbyintl(long double);

View File

@ -249,6 +249,9 @@ BAN_FUNC1(logb)
FUNC_EXPR1_RET(lrint, long, BAN::Math::rint(a)) FUNC_EXPR1_RET(lrint, long, BAN::Math::rint(a))
FUNC_EXPR1_RET(lround, long, BAN::Math::round(a)) FUNC_EXPR1_RET(lround, long, BAN::Math::round(a))
BAN_FUNC2_PTR(modf) BAN_FUNC2_PTR(modf)
double nan(const char* tagp) { return __builtin_nan(tagp); }
float nanf(const char* tagp) { return __builtin_nanf(tagp); }
long double nanl(const char* tagp) { return __builtin_nanl(tagp); }
FUNC_EXPR1(nearbyint, BAN::Math::rint(a)) FUNC_EXPR1(nearbyint, BAN::Math::rint(a))
FUNC_EXPR2(nextafter, nextafter_impl(a, b)) FUNC_EXPR2(nextafter, nextafter_impl(a, b))
FUNC_EXPR2_TYPE(nexttoward, long double, nextafter_impl(a, b)) FUNC_EXPR2_TYPE(nexttoward, long double, nextafter_impl(a, b))