diff options
author | kan <kan@FreeBSD.org> | 2003-11-07 02:43:04 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-11-07 02:43:04 +0000 |
commit | 1f79a7c5d02f19d3b84a4c966a52df954df090ec (patch) | |
tree | fe235f72e674c6a360d502ea52089d3d6f2035e2 /contrib/gcc/cpplib.c | |
parent | 81a2c9c441dc3231499d48ad9c0871b075ef6aa0 (diff) | |
parent | b09448931ae541a7a60fd1cf0ebac14b627fba69 (diff) | |
download | FreeBSD-src-1f79a7c5d02f19d3b84a4c966a52df954df090ec.zip FreeBSD-src-1f79a7c5d02f19d3b84a4c966a52df954df090ec.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r122180,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/gcc/cpplib.c')
-rw-r--r-- | contrib/gcc/cpplib.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/contrib/gcc/cpplib.c b/contrib/gcc/cpplib.c index 818451d..e18564e 100644 --- a/contrib/gcc/cpplib.c +++ b/contrib/gcc/cpplib.c @@ -1,6 +1,6 @@ /* CPP Library. (Directive handling.) Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Per Bothner, 1994-95. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -1094,7 +1094,7 @@ do_pragma (pfile) cpp_reader *pfile; { const struct pragma_entry *p = NULL; - const cpp_token *token; + const cpp_token *token, *pragma_token = pfile->cur_token; unsigned int count = 1; pfile->state.prevent_expansion++; @@ -1114,16 +1114,18 @@ do_pragma (pfile) } } - /* FIXME. This is an awful kludge to get the front ends to update - their notion of line number for diagnostic purposes. The line - number should be passed to the handler and they should do it - themselves. Stand-alone CPP must ignore us, otherwise it will - prefix the directive with spaces, hence the 1. Ugh. */ - if (pfile->cb.line_change) - (*pfile->cb.line_change)(pfile, token, 1); - if (p) - (*p->u.handler) (pfile); + { + /* Since the handler below doesn't get the line number, that it + might need for diagnostics, make sure it has the right + numbers in place. */ + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pragma_token, false); + (*p->u.handler) (pfile); + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pfile->cur_token, false); + + } else if (pfile->cb.def_pragma) { _cpp_backup_tokens (pfile, count); |