3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-06 19:21:23 +00:00

Make log_file_error() use variadic templates.

This commit is contained in:
Robert O'Callahan 2025-07-22 04:35:30 +00:00
parent c368ce99c1
commit 5951d9d303
2 changed files with 14 additions and 12 deletions

View file

@ -361,20 +361,16 @@ static void log_error_with_prefix(std::string_view prefix, std::string str)
#endif
}
void log_formatted_file_error(std::string_view filename, int lineno, std::string str)
{
std::string prefix = stringf("%s:%d: ERROR: ", filename, lineno);
log_error_with_prefix(prefix, str);
}
void logv_file_error(const string &filename, int lineno,
const char *format, va_list ap)
{
std::string prefix = stringf("%s:%d: ERROR: ",
filename.c_str(), lineno);
log_error_with_prefix(prefix, vstringf(format, ap));
}
void log_file_error(const string &filename, int lineno,
const char *format, ...)
{
va_list ap;
va_start(ap, format);
logv_file_error(filename, lineno, format, ap);
log_formatted_file_error(filename, lineno, vstringf(format, ap));
}
void log_experimental(const std::string &str)