cpplex.c (output_line_command): Output correct #line if a header is including itself and is not protected...
* cpplex.c (output_line_command): Output correct #line if a header is including itself and is not protected against multiple inclusion. From-SVN: r34761
This commit is contained in:
parent
d4506961cd
commit
54bef41ddc
|
@ -1,3 +1,8 @@
|
||||||
|
2000-06-28 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* cpplex.c (output_line_command): Output correct #line if a header
|
||||||
|
is including itself and is not protected against multiple inclusion.
|
||||||
|
|
||||||
2000-06-28 Zack Weinberg <zack@wolery.cumb.org>
|
2000-06-28 Zack Weinberg <zack@wolery.cumb.org>
|
||||||
|
|
||||||
* cppfiles.c (open_include_file): If open(2) returns EMFILE or
|
* cppfiles.c (open_include_file): If open(2) returns EMFILE or
|
||||||
|
|
31
gcc/cpplex.c
31
gcc/cpplex.c
|
@ -289,25 +289,26 @@ output_line_command (pfile, print, line)
|
||||||
if (CPP_OPTION (pfile, no_line_commands))
|
if (CPP_OPTION (pfile, no_line_commands))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Determine whether the current filename has changed, and if so,
|
if (pfile->buffer_stack_depth == print->last_bsd)
|
||||||
how. 'nominal_fname' values are unique, so they can be compared
|
{
|
||||||
by comparing pointers. */
|
/* Determine whether the current filename has changed, and if so,
|
||||||
if (ip->nominal_fname == print->last_fname)
|
how. 'nominal_fname' values are unique, so they can be compared
|
||||||
change = same;
|
by comparing pointers. */
|
||||||
|
if (ip->nominal_fname == print->last_fname)
|
||||||
|
change = same;
|
||||||
|
else
|
||||||
|
change = rname;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pfile->buffer_stack_depth == print->last_bsd)
|
if (pfile->buffer_stack_depth > print->last_bsd)
|
||||||
change = rname;
|
change = enter;
|
||||||
else
|
else
|
||||||
{
|
change = leave;
|
||||||
if (pfile->buffer_stack_depth > print->last_bsd)
|
print->last_bsd = pfile->buffer_stack_depth;
|
||||||
change = enter;
|
|
||||||
else
|
|
||||||
change = leave;
|
|
||||||
print->last_bsd = pfile->buffer_stack_depth;
|
|
||||||
}
|
|
||||||
print->last_fname = ip->nominal_fname;
|
|
||||||
}
|
}
|
||||||
|
print->last_fname = ip->nominal_fname;
|
||||||
|
|
||||||
/* If the current file has not changed, we can output a few newlines
|
/* If the current file has not changed, we can output a few newlines
|
||||||
instead if we want to increase the line number by a small amount.
|
instead if we want to increase the line number by a small amount.
|
||||||
We cannot do this if print->lineno is zero, because that means we
|
We cannot do this if print->lineno is zero, because that means we
|
||||||
|
|
Loading…
Reference in New Issue