From dd57a348664d0fac46a0f4c822f70c80bbf97774 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 25 Aug 2016 16:40:50 +0200 Subject: 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). --- tcc.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index e4b5a0e..17c24a2 100644 --- a/tcc.h +++ b/tcc.h @@ -1175,10 +1175,16 @@ ST_DATA TokenSym **table_ident; #define PARSE_FLAG_ACCEPT_STRAYS 0x0020 /* next() returns '\\' token */ #define PARSE_FLAG_TOK_STR 0x0040 /* return parsed strings instead of TOK_PPSTR */ +/* isidnum_table flags: */ +#define IS_SPC 1 +#define IS_ID 2 +#define IS_NUM 4 + ST_FUNC TokenSym *tok_alloc(const char *str, int len); ST_FUNC const char *get_tok_str(int v, CValue *cv); ST_FUNC void begin_macro(TokenString *str, int alloc); ST_FUNC void end_macro(void); +ST_FUNC void set_idnum(int c, int val); ST_FUNC void save_parse_state(ParseState *s); ST_FUNC void restore_parse_state(ParseState *s); ST_INLN void tok_str_new(TokenString *s); -- cgit v1.3.1