diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-26 17:34:39 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-26 17:34:39 +0000 |
| commit | 070b4507686570335cb3624ef1ede6f442bd4866 (patch) | |
| tree | 3bd1c0084b242568e3c67875524ecd1594f76e40 /core/runtime | |
| parent | 74174eb4ae796d6c161839d91c301229a1884713 (diff) | |
Add `ODIN_ERROR_POS_STYLE` constant and change `runtime.print_caller_location` based on that constant
Diffstat (limited to 'core/runtime')
| -rw-r--r-- | core/runtime/print.odin | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/runtime/print.odin b/core/runtime/print.odin index 8a14eba08..8c0b65864 100644 --- a/core/runtime/print.odin +++ b/core/runtime/print.odin @@ -143,11 +143,21 @@ print_int :: proc "contextless" (x: int) { print_i64(i64(x)) } print_caller_location :: proc "contextless" (using loc: Source_Code_Location) { print_string(file_path) - print_byte('(') - print_u64(u64(line)) - print_byte(':') - print_u64(u64(column)) - print_byte(')') + when ODIN_ERROR_POS_STYLE == .Default { + print_byte('(') + print_u64(u64(line)) + print_byte(':') + print_u64(u64(column)) + print_byte(')') + } else when ODIN_ERROR_POS_STYLE == .Unix { + print_byte(':') + print_u64(u64(line)) + print_byte(':') + print_u64(u64(column)) + print_byte(':') + } else { + #panic("unhandled ODIN_ERROR_POS_STYLE") + } } print_typeid :: proc "contextless" (id: typeid) { if id == nil { |