From 8a620a7c60e5745f5f38aaa1547a66a2d0dc9926 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 1 Feb 2024 17:00:40 -0500 Subject: first draft of script to generate the macros --- scripts/tgmath-macro.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/tgmath-macro.sh diff --git a/scripts/tgmath-macro.sh b/scripts/tgmath-macro.sh new file mode 100644 index 00000000..a201610f --- /dev/null +++ b/scripts/tgmath-macro.sh @@ -0,0 +1,20 @@ +printf '#define %s(__x) _Generic((__x), \\\n' $1 +printf '\tlong double complex: c%sl, \\\n' $1 +printf '\tdouble complex: c%s, \\\n' $1 +printf '\tfloat complex: c%sf, \\\n' $1 +printf '\tlong double: $sl, \\\n' $1 +printf '\tdouble: %s, \\\n' $1 +printf '\tunsigned long long: %s, \\\n' $1 +printf '\tlong long: %s, \\\n' $1 +printf '\tunsigned long: %s, \\\n' $1 +printf '\tlong: %s, \\\n' $1 +printf '\tunsigned int: %s, \\\n' $1 +printf '\tint: %s, \\\n' $1 +printf '\tunsigned short: %s, \\\n' $1 +printf '\tshort: %s, \\\n' $1 +printf '\tunsigned char: %s, \\\n' $1 +printf '\tsigned char: %s, \\\n' $1 +printf '\tchar: %s, \\\n' $1 +printf '\tfloat: %s \\\n' $1 +printf '\t)(__x)\\n\n' $1 + -- cgit v1.2.1