diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 18:56:31 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 18:56:31 -0400 |
commit | 0f95ad02491fe3b0b9c66c60b3655751cdc74cea (patch) | |
tree | 90ef86508776eb168c4ed5d5542faab22cfffebb | |
parent | c054c0e7fa09235b6ab79e1bebb2ebdc0bc0d00e (diff) |
clean up includes
-rw-r--r-- | src/complex/_tgmath.h | 6 | ||||
-rw-r--r-- | src/complex/cacos.c | 4 | ||||
-rw-r--r-- | src/complex/cacosh.c | 4 | ||||
-rw-r--r-- | src/complex/casinh.c | 2 | ||||
-rw-r--r-- | src/complex/catanh.c | 2 | ||||
-rw-r--r-- | src/complex/clog.c | 4 | ||||
-rw-r--r-- | src/math/_tgmath.h | 68 |
7 files changed, 40 insertions, 50 deletions
diff --git a/src/complex/_tgmath.h b/src/complex/_tgmath.h index c317f3dd..31fe7324 100644 --- a/src/complex/_tgmath.h +++ b/src/complex/_tgmath.h @@ -1,5 +1,5 @@ -#include "CMPLX.c" -#include "CMPLXF.c" -#include "CMPLXL.c" +#include "CMPLX.h" +#include "CMPLXF.h" +#include "CMPLXL.h" #include "math/_tgmath.h" diff --git a/src/complex/cacos.c b/src/complex/cacos.c index aaf45137..5df9c0df 100644 --- a/src/complex/cacos.c +++ b/src/complex/cacos.c @@ -4,10 +4,6 @@ #include "math.h" #include "fenv.h" -#include "math/M_PI.c" -#include "math/M_PI_2.c" -#include "math/M_PI_4.c" - TYPE complex TGFN(cacos)(TYPE complex z) { int classr = fpclassify(TGFN(creal)(z)); diff --git a/src/complex/cacosh.c b/src/complex/cacosh.c index b5f1fdb1..908e4938 100644 --- a/src/complex/cacosh.c +++ b/src/complex/cacosh.c @@ -4,10 +4,6 @@ #include "math.h" #include "fenv.h" -#include "math/M_PI.c" -#include "math/M_PI_2.c" -#include "math/M_PI_4.c" - TYPE complex TGFN(cacosh)(TYPE complex z) { int classr = fpclassify(TGFN(creal)(z)); diff --git a/src/complex/casinh.c b/src/complex/casinh.c index 71414e43..4386d5ee 100644 --- a/src/complex/casinh.c +++ b/src/complex/casinh.c @@ -4,8 +4,6 @@ #include "math.h" #include "fenv.h" -#include "math/M_PI_4.c" - TYPE complex TGFN(casinh)(TYPE complex z) { int classr = fpclassify(TGFN(creal)(z)); diff --git a/src/complex/catanh.c b/src/complex/catanh.c index 8b5c6109..69ccfd48 100644 --- a/src/complex/catanh.c +++ b/src/complex/catanh.c @@ -4,8 +4,6 @@ #include "math.h" #include "fenv.h" -#include "math/M_PI_2.c" - TYPE complex TGFN(catanh)(TYPE complex z) { int classr = fpclassify(TGFN(creal)(z)); diff --git a/src/complex/clog.c b/src/complex/clog.c index 914ca1c6..e0ab86ab 100644 --- a/src/complex/clog.c +++ b/src/complex/clog.c @@ -4,10 +4,6 @@ #include "math.h" #include "fenv.h" -#include "math/M_PI.c" -#include "math/M_PI_2.c" -#include "math/M_PI_4.c" - TYPE complex TGFN(clog)(TYPE complex z) { int classr = fpclassify(TGFN(creal)(z)); diff --git a/src/math/_tgmath.h b/src/math/_tgmath.h index 1feea423..bb4c04e5 100644 --- a/src/math/_tgmath.h +++ b/src/math/_tgmath.h @@ -2,37 +2,6 @@ #define __NONSTD_TGMATH_H__ #include <math.h> -#ifdef TGSOURCE - -# if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) -# define TGCMPLX(__x, __y) CMPLXF(__x, __y) -# define TGFN(__x) __x##f -# define TYPE float -# define TGHUGE HUGE_VALF -# include TGSOURCE -# undef TGCMPLX -# undef TGFN -# undef TYPE -# undef TGHUGE - -# define TGCMPLX(__x, __y) CMPLXL(__x, __y) -# define TGFN(__x) __x##l -# define TYPE long double -# define TGHUGE HUGE_VALL -# include TGSOURCE -# undef TGCMPLX -# undef TGFN -# undef TYPE -# undef TGHUGE -# endif - -#endif - -#define TGCMPLX(__x, __y) CMPLX(__x, __y) -#define TGFN(__x) __x -#define TYPE double -#define TGHUGE HUGE_VAL - #ifndef FP_ZERO #include "FP_ZERO.h" #endif @@ -57,8 +26,10 @@ #include "INFINITY.h" #endif +#if ((!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L)) #undef feraiseexcept #define feraiseexcept(_) +#endif #ifndef fpclassify #include "fpclassify.h" @@ -80,4 +51,39 @@ #include "M_PI_2.h" #endif +#ifndef M_PI_4 +#include "M_PI_4.h" +#endif + +#ifdef TGSOURCE + +# if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) +# define TGCMPLX(__x, __y) CMPLXF(__x, __y) +# define TGFN(__x) __x##f +# define TYPE float +# define TGHUGE HUGE_VALF +# include TGSOURCE +# undef TGCMPLX +# undef TGFN +# undef TYPE +# undef TGHUGE + +# define TGCMPLX(__x, __y) CMPLXL(__x, __y) +# define TGFN(__x) __x##l +# define TYPE long double +# define TGHUGE HUGE_VALL +# include TGSOURCE +# undef TGCMPLX +# undef TGFN +# undef TYPE +# undef TGHUGE +# endif + +#endif + +#define TGCMPLX(__x, __y) CMPLX(__x, __y) +#define TGFN(__x) __x +#define TYPE double +#define TGHUGE HUGE_VAL + #endif |