mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-15 09:09:58 +08:00
a1a844697d
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>
7 lines
121 B
NASM
7 lines
121 B
NASM
%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)
|