mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
Add __PASS__ builtin macro
Add a new builtin macro, __PASS__, which is either 1 (for a preparatory pass), 2 (for a final pass, including preprocessor only), or 0 (for dependency generation.) This might be useful in special contexts. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
917a3496f0
commit
7383b407d9
11
preproc.c
11
preproc.c
@ -4218,6 +4218,8 @@ static void
|
||||
pp_reset(char *file, int apass, efunc errfunc, evalfunc eval,
|
||||
ListGen * listgen, StrList **deplist)
|
||||
{
|
||||
Token *t;
|
||||
|
||||
_error = errfunc;
|
||||
cstk = NULL;
|
||||
istk = nasm_malloc(sizeof(Include));
|
||||
@ -4256,6 +4258,15 @@ pp_reset(char *file, int apass, efunc errfunc, evalfunc eval,
|
||||
*deptail = sl;
|
||||
deptail = &sl->next;
|
||||
}
|
||||
|
||||
/* Define the __PASS__ macro. This is defined here unlike
|
||||
all the other builtins, because it is special -- it varies between
|
||||
passes. */
|
||||
t = nasm_malloc(sizeof(*t));
|
||||
t->next = NULL;
|
||||
make_tok_num(t, pass);
|
||||
t->a.mac = NULL;
|
||||
define_smacro(NULL, "__PASS__", true, 0, t);
|
||||
}
|
||||
|
||||
static char *pp_getline(void)
|
||||
|
Loading…
Reference in New Issue
Block a user