]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/cpplex.c
cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename.
[gcc.git] / gcc / cpplex.c
index ba53e5cd6161c0d30503addedaeac62765656391..37d1de8c4408e7e4e01a610b44498a2addc692f3 100644 (file)
@@ -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))
This page took 0.025634 seconds and 5 git commands to generate.