if (first)
{
first = 0;
- /* N.B. The current line in each outer source file is one
- greater than the line of the #include, so we must
- subtract one to correct for that. */
+ /* The current line in each outer source file is now the
+ same as the line of the #include. */
fprintf (stderr, _("In file included from %s:%u"),
- ip->nominal_fname, CPP_BUF_LINE (ip) - 1);
+ ip->nominal_fname, CPP_BUF_LINE (ip));
}
else
/* Translators note: this message is used in conjunction
If it returns 0, this error has been suppressed. */
int
-_cpp_begin_message (pfile, code, file, line, col)
+_cpp_begin_message (pfile, code, file, pos)
cpp_reader *pfile;
enum error_type code;
const char *file;
- unsigned int line;
- unsigned int col;
+ const cpp_lexer_pos *pos;
{
cpp_buffer *ip = CPP_BUFFER (pfile);
int is_warning = 0;
{
if (file == NULL)
file = ip->nominal_fname;
- if (line == 0)
- line = _cpp_get_line (pfile, &col);
+ if (pos == 0)
+ pos = cpp_get_line (pfile);
print_containing_files (pfile, ip);
- print_file_and_line (file, line,
- CPP_OPTION (pfile, show_column) ? col : 0);
+ print_file_and_line (file, pos->line,
+ CPP_OPTION (pfile, show_column) ? pos->col : 0);
}
else
fprintf (stderr, "%s: ", progname);
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, ICE, NULL, 0, 0))
+ if (_cpp_begin_message (pfile, ICE, NULL, 0))
v_message (msgid, ap);
va_end(ap);
}
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, FATAL, NULL, 0, 0))
+ if (_cpp_begin_message (pfile, FATAL, NULL, 0))
v_message (msgid, ap);
va_end(ap);
}
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, ERROR, NULL, 0, 0))
+ if (_cpp_begin_message (pfile, ERROR, NULL, 0))
v_message (msgid, ap);
va_end(ap);
}
const char *msgid;
#endif
va_list ap;
+ cpp_lexer_pos pos;
VA_START (ap, msgid);
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, ERROR, NULL, line, column))
+ pos.line = line;
+ pos.col = column;
+ if (_cpp_begin_message (pfile, ERROR, NULL, &pos))
v_message (msgid, ap);
va_end(ap);
}
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, WARNING, NULL, 0, 0))
+ if (_cpp_begin_message (pfile, WARNING, NULL, 0))
v_message (msgid, ap);
va_end(ap);
}
const char *msgid;
#endif
va_list ap;
+ cpp_lexer_pos pos;
VA_START (ap, msgid);
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, WARNING, NULL, line, column))
+ pos.line = line;
+ pos.col = column;
+ if (_cpp_begin_message (pfile, WARNING, NULL, &pos))
v_message (msgid, ap);
va_end(ap);
}
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, PEDWARN, NULL, 0, 0))
+ if (_cpp_begin_message (pfile, PEDWARN, NULL, 0))
v_message (msgid, ap);
va_end(ap);
}
const char *msgid;
#endif
va_list ap;
+ cpp_lexer_pos pos;
VA_START (ap, msgid);
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, PEDWARN, NULL, line, column))
+ pos.line = line;
+ pos.col = column;
+ if (_cpp_begin_message (pfile, PEDWARN, NULL, &pos))
v_message (msgid, ap);
va_end(ap);
}
const char *msgid;
#endif
va_list ap;
+ cpp_lexer_pos pos;
VA_START (ap, msgid);
msgid = va_arg (ap, const char *);
#endif
- if (_cpp_begin_message (pfile, PEDWARN, file, line, col))
+ pos.line = line;
+ pos.col = col;
+ if (_cpp_begin_message (pfile, PEDWARN, file, &pos))
v_message (msgid, ap);
va_end(ap);
}
name = "stdout";
cpp_notice (pfile, "%s: %s", name, xstrerror (errno));
}
-
-const char *
-cpp_type2name (type)
- enum cpp_ttype type;
-{
- return (const char *) _cpp_token_spellings[type].name;
-}
-