diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-08-20 01:32:28 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-08-20 01:32:28 -0700 |
commit | a1a844697daabe0e8c493c6abada8049431b7fd2 (patch) | |
tree | cea9617f7dfbf63ec5cfdfe4e0d272be5d18a736 /test/gsmacro.asm | |
parent | 62cf4aaef6a6216fd0921f1ced4671dee6053d9f (diff) | |
download | nasm-a1a844697daabe0e8c493c6abada8049431b7fd2.tar.gz |
preproc: fix varadic macros, add conditional comma operator
Fix the (severely broken handling of) varadic macros.
Add a conditional comma operator "%,". This expands to a comma unless
followed by a null expansion of some sort, which allows suppressing
the comma before an empty argument (usually varadic, but not
necessarily.)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'test/gsmacro.asm')
-rw-r--r-- | test/gsmacro.asm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/gsmacro.asm b/test/gsmacro.asm new file mode 100644 index 00000000..11e13b43 --- /dev/null +++ b/test/gsmacro.asm @@ -0,0 +1,6 @@ +%define greedy(a,b,c+) a + 66 %, b * 3 %, c + + db greedy(1,2) + db greedy(1,2,3) + db greedy(1,2,3,4) + db greedy(1,2,3,4,5) |