aboutsummaryrefslogtreecommitdiff
path: root/foo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-04 15:23:59 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-04 15:23:59 -0500
commit98f0c51119f9d42d733f44cb516b1c2bcd9061af (patch)
tree39ab4fa635f858b76b9a8bbf84701c2788d5f498 /foo.c
Initial commit
Diffstat (limited to 'foo.c')
-rw-r--r--foo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/foo.c b/foo.c
new file mode 100644
index 00000000..0d78c720
--- /dev/null
+++ b/foo.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int main(void) {
+ int x = 23;
+ const char *s = "Hi";
+#define say(x) _Generic(x, int: printf("%d\n", x), char *: puts(s), default: puts("???"))
+ say(x);
+ say(s);
+#define all(...) { __VA_ARGS__; }
+ all(say("one"); say(2))
+ return 0;
+}