change error strings to an enumerated array in rodata; print_error takes a file argument
This commit is contained in:
1 parent
f24f72c280
commit
a15cbc474d
4 files changed
+142
-139
No files matched your search
@@ -100,7 +100,7 @@ error_string :: proc(ferr: Error) -> string {
|
||||
return "unknown error"
|
||||
}
|
||||
|
||||
print_error :: proc(ferr: Error, msg: string) {
|
||||
print_error :: proc(f: ^File, ferr: Error, msg: string) {
|
||||
TEMP_ALLOCATOR_GUARD()
|
||||
err_str := error_string(ferr)
|
||||
|
||||
@@ -113,5 +113,5 @@ print_error :: proc(ferr: Error, msg: string) {
|
||||
buf[len(msg) + 1] = ' '
|
||||
copy(buf[len(msg) + 2:], err_str)
|
||||
buf[length - 1] = '\n'
|
||||
write(stderr, buf)
|
||||
write(f, buf)
|
||||
}
|
||||
Reference in new issue
Block a user