mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-09-22 10:43:39 -04:00
preproc.c: %include: use expand_smacros() not expand_smacros_in_string()
Call expand_smacros() early instead of expand_smacros_in_string() late. expand_smacros_in_string() seems like a prodigiously bad idea and a sheer brainfart in my opinion.
This commit is contained in:
@@ -2061,7 +2061,7 @@ static int do_directive(Token * tline)
|
|||||||
return DIRECTIVE_FOUND;
|
return DIRECTIVE_FOUND;
|
||||||
|
|
||||||
case PP_INCLUDE:
|
case PP_INCLUDE:
|
||||||
tline = tline->next;
|
tline = expand_smacros(tline->next);
|
||||||
skip_white_(tline);
|
skip_white_(tline);
|
||||||
if (!tline || (tline->type != TOK_STRING &&
|
if (!tline || (tline->type != TOK_STRING &&
|
||||||
tline->type != TOK_INTERNAL_STRING)) {
|
tline->type != TOK_INTERNAL_STRING)) {
|
||||||
@@ -2077,7 +2077,6 @@ static int do_directive(Token * tline)
|
|||||||
p[strlen(p) - 1] = '\0'; /* remove the trailing quote */
|
p[strlen(p) - 1] = '\0'; /* remove the trailing quote */
|
||||||
} else
|
} else
|
||||||
p = tline->text; /* internal_string is easier */
|
p = tline->text; /* internal_string is easier */
|
||||||
expand_macros_in_string(&p);
|
|
||||||
inc = nasm_malloc(sizeof(Include));
|
inc = nasm_malloc(sizeof(Include));
|
||||||
inc->next = istk;
|
inc->next = istk;
|
||||||
inc->conds = NULL;
|
inc->conds = NULL;
|
||||||
|
Reference in New Issue
Block a user