From ec1a23e60be615ad0d491952df1dad0a96b2b1e5 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Wed, 31 Jan 2001 07:48:54 +0000 Subject: [PATCH] cpphash.h (struct cpp_reader): New saved_flags. * cpphash.h (struct cpp_reader): New saved_flags. * cppmacro.c (cpp_get_token): Use saved_flags to remember to avoid a paste after a pasted token. From-SVN: r39366 --- gcc/ChangeLog | 6 ++++++ gcc/cpphash.h | 3 +++ gcc/cppmacro.c | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0dfe8d657f3..e4016f13138 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-01-31 Neil Booth + + * cpphash.h (struct cpp_reader): New saved_flags. + * cppmacro.c (cpp_get_token): Use saved_flags to remember + to avoid a paste after a pasted token. + 2001-01-31 Alexandre Oliva * libgcc2.h (Wtype_MAX, Wtype_MIN): Define. diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 380f12581e6..6874c21d41c 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -331,6 +331,9 @@ struct cpp_reader /* We're printed a warning recommending against using #import. */ unsigned char import_warning; + /* Used to flag the token after a paste AVOID_LPASTE. */ + unsigned char saved_flags; + /* True after cpp_start_read completes. Used to inhibit some warnings while parsing the command line. */ unsigned char done_initializing; diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index aea7e5dab6d..2d4663d4671 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -906,7 +906,9 @@ cpp_get_token (pfile, token) cpp_reader *pfile; cpp_token *token; { - unsigned char flags = 0; + unsigned char flags = pfile->saved_flags; + + pfile->saved_flags = 0; for (;;) { @@ -922,7 +924,10 @@ cpp_get_token (pfile, token) *token = *context->list.first++; /* PASTE_LEFT tokens can only appear in macro expansions. */ if (token->flags & PASTE_LEFT) - paste_all_tokens (pfile, token); + { + paste_all_tokens (pfile, token); + pfile->saved_flags = AVOID_LPASTE; + } } else { -- 2.30.2