]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/pp_va_args.qc
Implement subscripting for __VA_ARGS__, and added test-case. This only works on...
[xonotic/gmqcc.git] / tests / pp_va_args.qc
index f73372cd8af784d0f20c1381ed3950457bc6d6ec..f54533b80f2e237a5eb97121f7fde1e54784b2c0 100644 (file)
@@ -1,9 +1,12 @@
 void print(...) = #1;
 
 #define NOPARENS(...) __VA_ARGS__
-#define callem(func, args) func(NOPARENS args)
+#define callem(func, args) func NOPARENS(args)
+
+#define callen(func, ...) func __VA_ARGS__##[0]
 
 void main() {
     print(NOPARENS("hello ", "world\n"));
     callem(print, ("Yay", ", there\n"));
+    callen(print, ("Woah",", there\n"));
 }