diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-03-15 07:57:13 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-03-15 07:57:13 +0000 |
commit | ba133c968c260e4f4c9623630812846202b5e54f (patch) | |
tree | 8a4a56e335e3fea702888b8f8de7fa5ee14ec72e /gcc/cppinit.c | |
parent | a3eab6194fe9c17e2609882621404955cb03c662 (diff) | |
download | gcc-ba133c968c260e4f4c9623630812846202b5e54f.zip gcc-ba133c968c260e4f4c9623630812846202b5e54f.tar.gz gcc-ba133c968c260e4f4c9623630812846202b5e54f.tar.bz2 |
cpp.texi: Update documentation for -include and -imacros.
* cpp.texi: Update documentation for -include and -imacros.
* cppfiles.c (struct include_file): Remove "defined" memeber.
(find_or_create_entry): Make a copy of the file name, and
simplify it.
(open_file): Update to ensure we use the simplified filename.
(stack_include_file): Don't set search_from.
(cpp_included): Don't simplify the path name here.
(find_include_file): New prototype. Call search_from to
get the start of the "" include chain. Don't simplify the
filenames here.
(_cpp_execute_include): New prototype. Move diagnostics to
do_include_common. Update.
(_cpp_pop_file_buffer): Don't set defined.
(search_from): New prototype. Use the preprocessor's cwd
for files included from the command line.
(read_name_map): Don't simplify the pathname here.
* cpphash.h (enum include_type): New.
(struct buffer): Delete search from. New search_cached.
(_cpp_execute_include): Update prototype.
* cppinit.c (do_includes): Use _cpp_execute_include.
* cpplib.c (do_include_common): New function.
(do_include, do_include_next, do_import): Use it.
From-SVN: r40486
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 457d266..13a0e64 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -885,8 +885,15 @@ do_includes (pfile, p, scan) use the #include "" search path if cpp_read_file fails. */ if (CPP_OPTION (pfile, preprocessed)) cpp_error (pfile, "-include and -imacros cannot be used with -fpreprocessed"); - else if (_cpp_read_file (pfile, p->arg) && scan) - cpp_scan_buffer_nooutput (pfile, 0); + else + { + cpp_token header; + header.type = CPP_STRING; + header.val.str.text = (const unsigned char *) p->arg; + header.val.str.len = strlen (p->arg); + if (_cpp_execute_include (pfile, &header, IT_CMDLINE) && scan) + cpp_scan_buffer_nooutput (pfile, 0); + } q = p->next; free (p); p = q; |