aboutsummaryrefslogtreecommitdiff
path: root/foo.c
diff options
context:
space:
mode:
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;
+}