summaryrefslogtreecommitdiff
path: root/src/tgmath/__tgmath.h
blob: b4e5c5ac98e333498845c138b56f4d4d4e975996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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*/