mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
colored error messages that tell the source file
This commit is contained in:
1 parent
31cf43de54
commit
257cf09472
16 files changed
+240
-113
No files matched your search
+10
-4
@@ -3,9 +3,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Buf *buf_sprintf(const char *format, ...) {
|
||||
va_list ap, ap2;
|
||||
va_start(ap, format);
|
||||
Buf *buf_vprintf(const char *format, va_list ap) {
|
||||
va_list ap2;
|
||||
va_copy(ap2, ap);
|
||||
|
||||
int len1 = vsnprintf(nullptr, 0, format, ap);
|
||||
@@ -19,11 +18,18 @@ Buf *buf_sprintf(const char *format, ...) {
|
||||
assert(len2 == len1);
|
||||
|
||||
va_end(ap2);
|
||||
va_end(ap);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
Buf *buf_sprintf(const char *format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
Buf *result = buf_vprintf(format, ap);
|
||||
va_end(ap);
|
||||
return result;
|
||||
}
|
||||
|
||||
void buf_appendf(Buf *buf, const char *format, ...) {
|
||||
assert(buf->list.length);
|
||||
va_list ap, ap2;
|
||||
|
||||
Reference in new issue
Block a user