diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-21 18:06:30 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-21 18:06:30 +0000 |
commit | 7825551f80daf55c4385294838137954942ae35a (patch) | |
tree | 4fb088465e0f2697e44b72ef804c30281053c4db /gcc/cpplib.c | |
parent | 28cda66b17a92205021042134cb99ea86230d099 (diff) | |
download | gcc-7825551f80daf55c4385294838137954942ae35a.tar.gz |
* cpphash.h (struct lexer_state): Add directive_wants_padding.
* cpplib.c (_cpp_handle_directive): Set directive_wants_padding
for directives of type INCL.
(glue_header_name, parse_include): Use get_token_no_padding.
* cppmacro.c (replace_args): If directive_wants_padding,
provide padding tokens.
* testsuite/gcc.dg/cpp/include3.c: New test.
* testsuite/gcc.dg/cpp/inc/foo.h: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63231 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index b63fd262339..ed2bc958751 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -414,6 +414,7 @@ _cpp_handle_directive (pfile, indented) skipping or not, we should lex angle-bracketed headers correctly, and maybe output some diagnostics. */ pfile->state.angled_headers = dir->flags & INCL; + pfile->state.directive_wants_padding = dir->flags & INCL; if (! CPP_OPTION (pfile, preprocessed)) directive_diagnostics (pfile, dir, indented); if (pfile->state.skipping && !(dir->flags & COND)) @@ -582,7 +583,7 @@ glue_header_name (pfile) buffer = (unsigned char *) xmalloc (capacity); for (;;) { - token = cpp_get_token (pfile); + token = get_token_no_padding (pfile); if (token->type == CPP_GREATER || token->type == CPP_EOF) break; @@ -634,7 +635,7 @@ parse_include (pfile) dir = pfile->directive->name; /* Allow macro expansion. */ - header = cpp_get_token (pfile); + header = get_token_no_padding (pfile); if (header->type != CPP_STRING && header->type != CPP_HEADER_NAME) { if (header->type != CPP_LESS) |