summaryrefslogtreecommitdiff
path: root/src/tgmath
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-08 18:45:05 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-08 18:45:05 -0500
commit84217308cf704fda8a9db817b458ccadf444efe9 (patch)
tree1d65e1610c22d6a68c90d67f4c7f3b147bfa151f /src/tgmath
parent7ef8a7379f7f7d09e71ccae2a0b688c3cd80423f (diff)
add headers and assembly
Diffstat (limited to 'src/tgmath')
-rw-r--r--src/tgmath/__tgmath.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tgmath/__tgmath.h b/src/tgmath/__tgmath.h
new file mode 100644
index 00000000..b4e5c5ac
--- /dev/null
+++ b/src/tgmath/__tgmath.h
@@ -0,0 +1,17 @@
+/* Implementation details */
+#include <math.h>
+#include <complex.h>
+
+#if __STDC_VERSION__ >= 20110101L
+#define __tg(fn, x) _Generic((x), long double: fn##l, \
+ float: fn##f, \
+ default: fn)(x)
+#else
+#define __tg(fn, x) (sizeof(x) == sizeof(long double) ? fn##l(x) : \
+ (sizeof(x) == sizeof(float) ? fn##f(x) : \
+ fn(x)))
+#endif
+
+#define cos(x) __tg(cos, x)
+
+/*c 99:??;tgmath.h c*/