summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-16 17:01:40 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-16 17:01:40 -0800
commit134b94665d0eebfaa8c6c46058eb76188d42582e (patch)
tree82444f5f344685badc9341a73edffdf59c0479fb /preproc.c
parent3f3bd41de017db8e7449f5b1345cd80ab77d2571 (diff)
downloadnasm-2.02rc2.tar.gz
Add %ifempty and variantsnasm-2.02rc2
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/preproc.c b/preproc.c
index b8b6ff2f..3a12fc84 100644
--- a/preproc.c
+++ b/preproc.c
@@ -1584,8 +1584,7 @@ static bool if_condition(Token * tline, enum preproc_token ct)
goto iftype;
iftype:
- tline = expand_smacro(tline);
- t = tline;
+ t = tline = expand_smacro(tline);
while (tok_type_(t, TOK_WHITESPACE) ||
(needtype == TOK_NUMBER &&
@@ -1611,6 +1610,14 @@ static bool if_condition(Token * tline, enum preproc_token ct)
}
break;
+ case PPC_IFEMPTY:
+ t = tline = expand_smacro(tline);
+ while (tok_type_(t, TOK_WHITESPACE))
+ t = t->next;
+
+ j = !t; /* Should be empty */
+ break;
+
case PPC_IF:
t = tline = expand_smacro(tline);
tptr = &t;