summaryrefslogtreecommitdiff
path: root/src/math/_tgmath.h
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-10 12:58:34 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-10 12:58:34 -0500
commit3fe929ecd22b5ca3f5dc35c0c8be523fa7fc1de7 (patch)
treebd482aa8d9ed810e323d679f704e5aaa31f9d105 /src/math/_tgmath.h
parent6d4678bc82d4a80499123b33a971d2e2c0becb5f (diff)
move nonstd/tgmath.h to ./_tgmath.h
Diffstat (limited to 'src/math/_tgmath.h')
-rw-r--r--src/math/_tgmath.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/math/_tgmath.h b/src/math/_tgmath.h
new file mode 100644
index 00000000..01533baa
--- /dev/null
+++ b/src/math/_tgmath.h
@@ -0,0 +1,31 @@
+#ifndef __NONSTD_TGMATH_H__
+#define __NONSTD_TGMATH_H__
+#include <math.h>
+
+#ifdef TGSOURCE
+
+# if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+# define TGFN(x) x##f
+# define TYPE float
+# define TGHUGE HUGE_VALF
+# include TGSOURCE
+# undef TGFN
+# undef TYPE
+# undef TGHUGE
+
+# define TGFN(x) x##l
+# define TYPE long double
+# define TGHUGE HUGE_VALL
+# include TGSOURCE
+# undef TGFN
+# undef TYPE
+# undef TGHUGE
+# endif
+
+#endif
+
+#define TGFN(x) x
+#define TYPE double
+#define TGHUGE HUGE_VAL
+
+#endif