From faea4c9937d36b17e53fdc7d5a254d7e936e1755 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 11 Dec 2012 22:44:36 +0100 Subject: make CMPLX macros available in complex.h in non-c11 mode as well --- include/complex.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/complex.h b/include/complex.h index 8206e026..13a45c57 100644 --- a/include/complex.h +++ b/include/complex.h @@ -115,11 +115,9 @@ long double creall(long double complex); #define __CMPLX(x, y, t) \ ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z) -#if __STDC_VERSION__ >= 201112L #define CMPLX(x, y) __CMPLX(x, y, double) #define CMPLXF(x, y) __CMPLX(x, y, float) #define CMPLXL(x, y) __CMPLX(x, y, long double) -#endif #ifdef __cplusplus } -- cgit v1.2.1 From 64623cd59a5e72c6322548bca3827a75d5d11918 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 11 Dec 2012 22:57:39 +0100 Subject: math: remove long double version of bessel functions from math.h j0l,j1l,jnl,y0l,j1l,jnl are gnu extensions, bsd and posix do not have them. noone seems to use them and there is no plan to implement them any time soon so we shouldn't declare them in math.h. --- include/math.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/math.h b/include/math.h index b44738d7..19108795 100644 --- a/include/math.h +++ b/include/math.h @@ -399,14 +399,6 @@ float ynf(int, float); #ifdef _GNU_SOURCE long double lgammal_r(long double, int*); -long double j0l(long double); -long double j1l(long double); -long double jnl(int, long double); - -long double y0l(long double); -long double y1l(long double); -long double ynl(int, long double); - void sincos(double, double*, double*); void sincosf(float, float*, float*); void sincosl(long double, long double*, long double*); -- cgit v1.2.1 From 934609442339edb21a33532ccefac8b78e6305f2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 14 Dec 2012 12:49:35 +0100 Subject: fixed tgmath.h for functions with integral result in tgmath.h the return values are casted to the appropriate floating-point type (if the compiler supports gcc __typeof__), this is wrong in case of ilogb, lrint, llrint, lround, llround which do not need such cast --- include/tgmath.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/tgmath.h b/include/tgmath.h index 5b65e21f..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) : \ @@ -217,18 +219,18 @@ 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 nexttoward(x,y) __tg_real_2(nexttoward, (x), (y)) -- cgit v1.2.1