aboutsummaryrefslogtreecommitdiff
path: root/tccasm.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-08-25 16:40:50 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:11 +0100
commitdd57a348664d0fac46a0f4c822f70c80bbf97774 (patch)
tree6925b44de13fdeed66eca1bce75fa6c618ef9da8 /tccasm.c
parente7ef087598d74e3329a7f0b24af8430faf639606 (diff)
downloadtinycc-dd57a348664d0fac46a0f4c822f70c80bbf97774.tar.gz
tinycc-dd57a348664d0fac46a0f4c822f70c80bbf97774.tar.bz2
tccasm: Don't ignore # in preprocessor directives
Our preprocessor throws away # line-comments in asm mode. It did so also inside preprocessor directives, thereby removing stringification. Parse defines in non-asm mode (but retain '.' as identifier character inside macro definitions).
Diffstat (limited to 'tccasm.c')
-rw-r--r--tccasm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccasm.c b/tccasm.c
index 192e485..1819950 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -916,6 +916,7 @@ static int tcc_assemble_internal(TCCState *s1, int do_preprocess)
ch = file->buf_ptr[0];
tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF;
parse_flags = PARSE_FLAG_ASM_FILE | PARSE_FLAG_TOK_STR;
+ set_idnum('.', IS_ID);
if (do_preprocess)
parse_flags |= PARSE_FLAG_PREPROCESS;
next();
@@ -1036,6 +1037,7 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len)
tcc_close();
parse_flags = saved_parse_flags;
+ set_idnum('.', (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0);
macro_ptr = saved_macro_ptr;
}