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*);
float modff(float, float*);
long double modfl(long double, long double*);
#define nan(tagp) __builtin_nan(tagp)
#define nanf(tagp) __builtin_nanf(tagp)
#define nanl(tagp) __builtin_nanl(tagp)
double nan(const char*);
float nanf(const char*);
long double nanl(const char*);
double nearbyint(double);
float nearbyintf(float);
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(lround, long, BAN::Math::round(a))
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_EXPR2(nextafter, nextafter_impl(a, b))
FUNC_EXPR2_TYPE(nexttoward, long double, nextafter_impl(a, b))