aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-08-29 18:37:37 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-08-29 18:37:37 +0000
commit2c8f0515bbed378f1e87e1b52e2913d058cbed16 (patch)
tree7f03453e92f612da7c6531488d3878a73dbda657 /gcc/cpplex.c
parent5c5d1cd68a748299a244a6b9fd7c3fce2f09d582 (diff)
downloadgcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.zip
gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.gz
gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.bz2
cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename.
* cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename. * cpplex.c (_cpp_run_directive): Add additional argument, the name to give the synthetic buffer. This defaults to translated "<command line>". * cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert): Adjust to match. (_cpp_define_builtin): New function. * cppinit.c (initialize_builtins): Use _cpp_define_builtin. * cpphash.h: Update prototypes. * tradcpp.c (main): Process -D and -U simultaneously, in the order they appeared on the command line. From-SVN: r36043
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index ba53e5c..37d1de8 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -3565,16 +3565,23 @@ _cpp_skip_rest_of_line (pfile)
/* Directive handler wrapper used by the command line option
processor. */
void
-_cpp_run_directive (pfile, dir, buf, count)
+_cpp_run_directive (pfile, dir, buf, count, name)
cpp_reader *pfile;
const struct directive *dir;
const char *buf;
size_t count;
+ const char *name;
{
if (cpp_push_buffer (pfile, (const U_CHAR *)buf, count) != NULL)
{
unsigned int prev_lvl = 0;
+ if (name)
+ CPP_BUFFER (pfile)->nominal_fname = name;
+ else
+ CPP_BUFFER (pfile)->nominal_fname = _("<command line>");
+ CPP_BUFFER (pfile)->lineno = (unsigned int)-1;
+
/* Scan the line now, else prevent_macro_expansion won't work. */
lex_next (pfile, 1);
if (! (dir->flags & EXPAND))