aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2003-02-21 18:06:30 +0000
committerZack Weinberg <zack@gcc.gnu.org>2003-02-21 18:06:30 +0000
commita8d0ddaf4c62bdc34262be64de2161a413391b8d (patch)
tree4fb088465e0f2697e44b72ef804c30281053c4db /gcc/cpplib.c
parent3a3f137e0de6ea3acab06f1b4b16ada378caec2b (diff)
downloadgcc-a8d0ddaf4c62bdc34262be64de2161a413391b8d.zip
gcc-a8d0ddaf4c62bdc34262be64de2161a413391b8d.tar.gz
gcc-a8d0ddaf4c62bdc34262be64de2161a413391b8d.tar.bz2
cpphash.h (struct lexer_state): Add directive_wants_padding.
* 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. From-SVN: r63231
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index b63fd26..ed2bc95 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)