diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/err.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -72,13 +72,17 @@ static void err_vprint(Location where, const char *fmt, va_list args) { err_print_footer_(where.code); } -static void err_print(Location where, const char *fmt, ...) { - va_list args; +static void err_print_(int line, const char *file, Location where, const char *fmt, ...) { + va_list args; + if (file) + err_fprint("Generated by line %d of %s:\n", line, file); va_start(args, fmt); err_vprint(where, fmt, args); va_end(args); } +#define err_print(...) err_print_(__LINE__, __FILE__, __VA_ARGS__) + static void info_print(Location where, const char *fmt, ...) { va_list args; va_start(args, fmt); |