diff options
Diffstat (limited to 'asm/preproc.c')
-rw-r--r-- | asm/preproc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/asm/preproc.c b/asm/preproc.c index 14a73885..785d6e30 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -4027,10 +4027,6 @@ issue_error: free_tlist(tt); tmpl.alias = true; } else { - /* Expand the macro definition now for %xdefine and %ixdefine */ - if (i == PP_XDEFINE) - tline = expand_smacro(tline); - /* Reverse expansion list and mark parameter tokens */ macro_start = NULL; t = tline; @@ -4051,6 +4047,18 @@ issue_error: macro_start = t; t = tt; } + + /* + * Expand the macro definition now for %xdefine and %ixdefine. + * This is done AFTER marking of parameter tokens: this is the + * only way in which %xdefine(xxx) yyyy zzzz differs from + * %define(xxx) yyyy %[zzzz] + */ + if (i == PP_XDEFINE) { + tline = reverse_tokens(tline); + tline = expand_smacro(tline); + tline = reverse_tokens(tline); + } } /* |