| 1 |
dnl Get type kind from filename. |
| 2 |
define(kind,regexp(file, `_.\([0-9]+\).c$', `\1'))dnl |
| 3 |
define(complex_type, `GFC_COMPLEX_'kind)dnl |
| 4 |
define(real_type, `GFC_REAL_'kind)dnl |
| 5 |
define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl |
| 6 |
define(q,ifelse(kind,4,f,ifelse(kind,8,`',ifelse(kind,10,l,ifelse(kind,16,l,`_'kind)))))dnl |
| 7 |
define(Q,translit(q,`a-z',`A-Z'))dnl |
| 8 |
define(hasmathfunc,dnl |
| 9 |
`ifelse(kind,4,`defined (HAVE_'upcase($1)`F)',dnl |
| 10 |
ifelse(kind,8,`defined (HAVE_'upcase($1)`)',dnl |
| 11 |
ifelse(kind,10,`defined (HAVE_'upcase($1)`L)',dnl |
| 12 |
ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_'upcase($1)`L))',dnl |
| 13 |
ifelse(kind,17,`1 /* FIXME: figure this out later. */',dnl |
| 14 |
`error out')))))') |
| 15 |
define(mathfunc_macro,`ifelse(kind,17,dnl |
| 16 |
`#if defined(POWER_IEEE128) |
| 17 |
#define MATHFUNC(funcname) __ ## funcname ## ieee128 |
| 18 |
#elif defined(GFC_REAL_17_USE_IEC_60559) |
| 19 |
#define MATHFUNC(funcname) funcname ## f128 |
| 20 |
#else |
| 21 |
#define MATHFUNC(funcname) funcname ## q |
| 22 |
#endif',dnl |
| 23 |
`ifelse(kind,16,dnl |
| 24 |
`#if defined(GFC_REAL_16_IS_FLOAT128) |
| 25 |
#if defined(GFC_REAL_16_USE_IEC_60559) |
| 26 |
#define MATHFUNC(funcname) funcname ## f128 |
| 27 |
#else |
| 28 |
#define MATHFUNC(funcname) funcname ## q |
| 29 |
#endif |
| 30 |
#else |
| 31 |
#define MATHFUNC(funcname) funcname ## l |
| 32 |
#endif',dnl |
| 33 |
ifelse(kind,8,``#''`define MATHFUNC(funcname) funcname',dnl |
| 34 |
```#'''`define MATHFUNC(funcname) funcname '```#'''```#'''` 'q))')')dnl |