X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Ftgmath.h;h=832b052b5e106c4b2de2cd20e11dbcf53625c6f5;hp=52913913e3ae9f78e870ca870302ea5dfc4d59de;hb=934609442339edb21a33532ccefac8b78e6305f2;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/include/tgmath.h b/include/tgmath.h index 52913913..832b052b 100644 --- a/include/tgmath.h +++ b/include/tgmath.h @@ -59,10 +59,12 @@ sizeof(double) == sizeof(long double) /* function selection */ -#define __tg_real(fun, x) (__RETCAST(x)( \ +#define __tg_real_nocast(fun, x) ( \ __FLT(x) ? fun ## f (x) : \ __LDBL(x) ? fun ## l (x) : \ - fun(x) )) + fun(x) ) + +#define __tg_real(fun, x) (__RETCAST(x)__tg_real_nocast(fun, x)) #define __tg_real_2_1(fun, x, y) (__RETCAST(x)( \ __FLT(x) ? fun ## f (x, y) : \ @@ -121,6 +123,69 @@ sizeof(double) == sizeof(long double) __LDBL(x) ? fabsl(x) : \ fabs(x) )) +/* suppress any macros in math.h or complex.h */ + +#undef acos +#undef acosh +#undef asin +#undef asinh +#undef atan +#undef atan2 +#undef atanh +#undef carg +#undef cbrt +#undef ceil +#undef cimag +#undef conj +#undef copysign +#undef cos +#undef cosh +#undef cproj +#undef creal +#undef erf +#undef erfc +#undef exp +#undef exp2 +#undef expm1 +#undef fabs +#undef fdim +#undef floor +#undef fma +#undef fmax +#undef fmin +#undef fmod +#undef frexp +#undef hypot +#undef ilogb +#undef ldexp +#undef lgamma +#undef llrint +#undef llround +#undef log +#undef log10 +#undef log1p +#undef log2 +#undef logb +#undef lrint +#undef lround +#undef nearbyint +#undef nextafter +#undef nexttoward +#undef pow +#undef remainder +#undef remquo +#undef rint +#undef round +#undef scalbln +#undef scalbn +#undef sin +#undef sinh +#undef sqrt +#undef tan +#undef tanh +#undef tgamma +#undef trunc + /* tg functions */ #define acos(x) __tg_real_complex(acos, (x)) @@ -154,20 +219,20 @@ sizeof(double) == sizeof(long double) #define fmod(x,y) __tg_real_2(fmod, (x), (y)) #define frexp(x,y) __tg_real_2_1(frexp, (x), (y)) #define hypot(x,y) __tg_real_2(hypot, (x), (y)) -#define ilogb(x) __tg_real(ilogb, (x)) +#define ilogb(x) __tg_real_nocast(ilogb, (x)) #define ldexp(x,y) __tg_real_2_1(ldexp, (x), (y)) #define lgamma(x) __tg_real(lgamma, (x)) -#define llrint(x) __tg_real(llrint, (x)) -#define llround(x) __tg_real(llround, (x)) +#define llrint(x) __tg_real_nocast(llrint, (x)) +#define llround(x) __tg_real_nocast(llround, (x)) #define log(x) __tg_real_complex(log, (x)) #define log10(x) __tg_real(log10, (x)) #define log1p(x) __tg_real(log1p, (x)) #define log2(x) __tg_real(log2, (x)) #define logb(x) __tg_real(logb, (x)) -#define lrint(x) __tg_real(lrint, (x)) -#define lround(x) __tg_real(lround, (x)) +#define lrint(x) __tg_real_nocast(lrint, (x)) +#define lround(x) __tg_real_nocast(lround, (x)) #define nearbyint(x) __tg_real(nearbyint, (x)) -#define nextafter(x,y) __tg_real_2(nextafter, (x), (y) +#define nextafter(x,y) __tg_real_2(nextafter, (x), (y)) #define nexttoward(x,y) __tg_real_2(nexttoward, (x), (y)) #define pow(x,y) __tg_real_complex_pow((x), (y)) #define remainder(x,y) __tg_real_2(remainder, (x), (y))