summaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-13 06:25:28 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-13 06:25:28 +0000
commit01628c3c60911f135446f30f05ed01008beb43ce (patch)
tree3e71956fa3f7d26102a5ef76e903e7afc02c749c /gcc/cpplib.c
parente72f9af859e8515878c4a6237c9e77e8a65c4580 (diff)
downloadgcc-01628c3c60911f135446f30f05ed01008beb43ce.tar.gz
* cpplib.c (end_directive): Handle line skipping. Only remove
the rest of the line if the directive was valid. * cppmacro.c (_cpp_push_text_context): Set NODE_DISABLED when expanding a traditional macro. * cpptrad.c (recursive_macro): New. (read_logical_line_trad): Handle skipping. (scan_out_logical_line): Continue after a successful directive. Don't expand macros whilst skipping, or if recursing. (_cpp_create_trad_definition): scan_out_logical_line now sets the output current position. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54573 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 73e12b7d8d5..acc71e7120a 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -256,7 +256,7 @@ end_directive (pfile, skip_line)
{
if (CPP_OPTION (pfile, traditional))
{
- if (pfile->directive == &dtable[T_DEFINE])
+ if (!pfile->directive || pfile->directive == &dtable[T_DEFINE])
skip_line = false;
else
_cpp_remove_overlay (pfile);
@@ -290,12 +290,15 @@ prepare_directive_trad (pfile)
else
{
bool no_expand = ! (pfile->directive->flags & EXPAND);
+ bool was_skipping = pfile->state.skipping;
+ pfile->state.skipping = false;
if (no_expand)
pfile->state.prevent_expansion++;
_cpp_read_logical_line_trad (pfile);
if (no_expand)
pfile->state.prevent_expansion--;
+ pfile->state.skipping = was_skipping;
_cpp_overlay_buffer (pfile, pfile->out.base,
pfile->out.cur - pfile->out.base);
}