From aef64762c17e2581e589a62c7345067947b5b4f4 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 9 Oct 2022 01:40:18 +0200 Subject: [PATCH] tccpp: #define max(a,b) && max /= 8; This fixes 20a1ebf8544c9be86e0f22a760b7bbb907f923e1 where the '/' above was lost when max() was defined Also: ignore binary files with -E (for example 'tcc -lxxx -E ...') --- libtcc.c | 5 +++++ tccpp.c | 1 + 2 files changed, 6 insertions(+) diff --git a/libtcc.c b/libtcc.c index 5d06652b..01abdbc4 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1039,6 +1039,11 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags) filename = buf; #endif + /* ignore binary files with -E */ + if (s1->output_type == TCC_OUTPUT_PREPROCESS + && (flags & AFF_TYPE_BIN)) + return 0; + /* open the file */ fd = _tcc_open(s1, filename); if (fd < 0) { diff --git a/tccpp.c b/tccpp.c index 8100f887..92a747b8 100644 --- a/tccpp.c +++ b/tccpp.c @@ -3236,6 +3236,7 @@ static int next_argstream(Sym **nested_list, TokenString *ws_str) } else if (c == '/') { p = parse_line_comment(p) - 1; } else { + *--p = ch; break; } ch = ' ';