normalize inc dirs, symplify include_next

include dirs are prepared as in gcc
    - for each duplicate path keep just the first one
    - remove each include_path that exists in sysinclude_paths

    include_next streamlined by introducing inc_path_index
    in the BufferedFile
This commit is contained in:
seyko
2015-11-05 19:52:49 +03:00
parent 45bc505968
commit a6276b7a78
3 changed files with 97 additions and 71 deletions

1
tcc.h
View File

@ -501,6 +501,7 @@ typedef struct BufferedFile {
struct BufferedFile *prev;
int line_num; /* current line number - here to simplify code */
int line_ref; /* tcc -E: last printed line */
int inc_path_index;
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 */