From 9143792d5951e73d9671874c964317df8f449fd2 Mon Sep 17 00:00:00 2001 From: Noam Preil Date: Thu, 18 Jun 2020 05:11:11 -0400 Subject: [PATCH] Make it possible to undefine --- assembler/assembler.c | 3 +++ assembler/directives.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/assembler/assembler.c b/assembler/assembler.c index 1502dbd..6dc7a53 100644 --- a/assembler/assembler.c +++ b/assembler/assembler.c @@ -172,6 +172,9 @@ int try_expand_macro(struct assembler_state *state, char **line) { if (strstr(*line, "macro") == *line + 1) { // Cannot expand macros while defining them return 0; } + if (strstr(*line, "undefine") == *line + 1) { // Should not expand while removing + return 0; + } if (strstr(*line, "ifdef") == *line + 1) { // Should not expand when testing for existence return 0; } diff --git a/assembler/directives.c b/assembler/directives.c index 3eb3303..d004dd2 100644 --- a/assembler/directives.c +++ b/assembler/directives.c @@ -433,6 +433,8 @@ int handle_undef(struct assembler_state *state, char **argv, int argc) { return 1; } + scas_log(L_DEBUG, "Looking for %s", argv[0]); + int i; for (i = 0; i < state->macros->length; i++) { macro_t *m = state->macros->items[i];