19 lines
336 B
C
19 lines
336 B
C
#include "diagnostics.h"
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
|
|
void diag_error(Loc loc, const char* fmt, ...)
|
|
{
|
|
va_list va;
|
|
va_start(va, fmt);
|
|
|
|
fprintf(stderr,
|
|
"\x1b[1;97m%s:%d:%d: \x1b[1;91merror: \x1b[0m\n",
|
|
loc.file,
|
|
loc.line,
|
|
loc.col);
|
|
vfprintf(stderr, fmt, va);
|
|
|
|
va_end(va);
|
|
}
|