summaryrefslogtreecommitdiff
path: root/src/math/_tgmath.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/_tgmath.h')
-rw-r--r--src/math/_tgmath.h68
1 files changed, 37 insertions, 31 deletions
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