From 2358b378b3cd526956713f033f5a0ecaa5f63951 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 6 Jan 2013 17:20:44 +0100 Subject: tccpp: alternative fix for #include_next infinite loop bug This replaces commit 3d409b08893873b917ccb8c34398bc41a4e84d7c - revert old fix in libtcc.c - #include_next: look up the file in the include stack to see if it is already included. Also: - streamline include code - remove 'type' from struct CachedInclude (obsolete because we check full filename anyway) - remove inc_type & inc_filename from struct Bufferedfile (obsolete) - fix bug with TOK_FLAG_ENDIF not being reset - unrelated: get rid of an 'variable potentially uninitialized' warning --- tcc.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 8e79430..5489b49 100644 --- a/tcc.h +++ b/tcc.h @@ -422,9 +422,7 @@ typedef struct BufferedFile { int ifndef_macro; /* #ifndef macro / #endif search */ int ifndef_macro_saved; /* saved ifndef_macro */ int *ifdef_stack_ptr; /* ifdef_stack value at the start of the file */ - char inc_type; /* type of include */ - char inc_filename[512]; /* filename specified by the user */ - char filename[1024]; /* current filename - here to simplify code */ + char filename[1024]; /* filename */ unsigned char buffer[IO_BUF_SIZE + 1]; /* extra size for CH_EOB char */ } BufferedFile; @@ -460,7 +458,6 @@ typedef struct InlineFunc { typedef struct CachedInclude { int ifndef_macro; int hash_next; /* -1 if none */ - char type; /* '"' or '>' to give include type */ char filename[1]; /* path specified in #include */ } CachedInclude; -- cgit v1.3.1