mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
On -disable-assert, panic will still work but not print the caller location
This commit is contained in:
@@ -664,8 +664,10 @@ default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code
|
|||||||
when ODIN_OS == .Freestanding {
|
when ODIN_OS == .Freestanding {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else {
|
} else {
|
||||||
print_caller_location(loc)
|
when !ODIN_DISABLE_ASSERT {
|
||||||
print_string(" ")
|
print_caller_location(loc)
|
||||||
|
print_string(" ")
|
||||||
|
}
|
||||||
print_string(prefix)
|
print_string(prefix)
|
||||||
if len(message) > 0 {
|
if len(message) > 0 {
|
||||||
print_string(": ")
|
print_string(": ")
|
||||||
|
|||||||
@@ -817,7 +817,6 @@ assert :: proc(condition: bool, message := "", loc := #caller_location) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@builtin
|
@builtin
|
||||||
@(disabled=ODIN_DISABLE_ASSERT)
|
|
||||||
panic :: proc(message: string, loc := #caller_location) -> ! {
|
panic :: proc(message: string, loc := #caller_location) -> ! {
|
||||||
p := context.assertion_failure_proc
|
p := context.assertion_failure_proc
|
||||||
if p == nil {
|
if p == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user