SectrPrototype/code/assert.odin
Ed_ 4deee942a8 General codebase refactor & cleanup
Renamed HashTable to HMapZPL, with procs having the zpl_ namespace prefix.
(I want to eventually get away from using it)

Started to use the grime pattern for library aliasing better.
2024-02-27 07:50:57 -05:00

32 lines
643 B
Odin

package sectr
import "base:runtime"
import "core:os"
ensure :: proc( condition : b32, msg : string, location := #caller_location )
{
if condition {
return
}
log( msg, LogLevel.Warning, location )
runtime.debug_trap()
}
// TODO(Ed) : Setup exit codes!
fatal :: proc( msg : string, exit_code : int = -1, location := #caller_location )
{
log( msg, LogLevel.Fatal, location )
runtime.debug_trap()
os.exit( exit_code )
}
verify :: proc( condition : b32, msg : string, exit_code : int = -1, location := #caller_location )
{
if condition {
return
}
log( msg, LogLevel.Fatal, location )
runtime.debug_trap()
os.exit( exit_code )
}