From 9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 9 Jul 2017 12:07:40 +0200 Subject: unsorted adjustments - configure * use aarch64 instead of arm64 - Makefile * rename the custom include file to "config-extra.mak" * Also avoid "rm -r /*" if $(tccdir) is empty - pp/Makefile * fix .expect generation with gcc - tcc.h * cleanup #defines for _MSC_VER - tccgen.c: * fix const-propagation for &,| * fix anonymous named struct (ms-extension) and enable -fms-extension by default - i386-gen.c * clear VT_DEFSIGN - x86_64-gen.c/win64: * fix passing structs in registers * fix alloca (need to keep "func_scratch" below each alloca area on stack) (This allows to compile a working gnu-make on win64) - tccpp.c * alternative approach to 37999a4fbf3487b363fd0c2f9b7ab622401b202a This is to avoid some slowdown with ## token pasting. * get_tok_str() : return for TOK_EOF * -funsigned-char: apply to "string" literals as well - tccpe/tools.c: -impdef: support both 32 and 64 bit dlls anyway --- tccpp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tccpp.c') diff --git a/tccpp.c b/tccpp.c index b81b4b5..99d3c0a 100644 --- a/tccpp.c +++ b/tccpp.c @@ -531,7 +531,6 @@ ST_FUNC const char *get_tok_str(int v, CValue *cv) break; /* above tokens have value, the ones below don't */ - case TOK_LT: v = '<'; goto addv; @@ -544,6 +543,8 @@ ST_FUNC const char *get_tok_str(int v, CValue *cv) return strcpy(p, "<<="); case TOK_A_SAR: return strcpy(p, ">>="); + case TOK_EOF: + return strcpy(p, ""); default: if (v < TOK_IDENT) { /* search in two bytes table */ @@ -1791,7 +1792,7 @@ ST_FUNC void preprocess(int is_bof) if (c != '\"') continue; /* https://savannah.nongnu.org/bugs/index.php?50847 */ - path = file->filename2; + path = file->true_filename; pstrncpy(buf1, path, tcc_basename(path) - path); } else { @@ -1921,9 +1922,11 @@ include_done: _line_num: next(); if (tok != TOK_LINEFEED) { - if (tok == TOK_STR) + if (tok == TOK_STR) { + if (file->true_filename == file->filename) + file->true_filename = tcc_strdup(file->filename); pstrcpy(file->filename, sizeof(file->filename), (char *)tokc.str.data); - else if (parse_flags & PARSE_FLAG_ASM_FILE) + } else if (parse_flags & PARSE_FLAG_ASM_FILE) break; else goto _line_err; -- cgit v1.3.1