WIP(Untested, compiles): Grime progress

This commit is contained in:
2025-10-16 20:21:44 -04:00
parent b4f0806d1b
commit b46c790756
4 changed files with 57 additions and 58 deletions

View File

@@ -2,21 +2,24 @@ package grime
// Below should be defined per-package
@(disabled = ODIN_DEBUG == false)
ensure :: #force_inline proc( condition : b32, msg : string, location := #caller_location ) {
if condition do return
ensure :: #force_inline proc(condition: bool, msg: string, location := #caller_location) -> bool {
if condition do return true
log_print( msg, LoggerLevel.Warning, location )
debug_trap()
when ODIN_DEBUG == false do return false
else {
debug_trap()
return false
}
}
// TODO(Ed) : Setup exit codes!
fatal :: #force_inline proc( msg : string, exit_code : int = -1, location := #caller_location ) {
fatal :: #force_inline proc(msg: string, exit_code: int = -1, location := #caller_location) {
log_print( msg, LoggerLevel.Fatal, location )
debug_trap()
process_exit( exit_code )
}
// TODO(Ed) : Setup exit codes!
verify :: #force_inline proc( condition : b32, msg : string, exit_code : int = -1, location := #caller_location ) {
if condition do return
verify :: #force_inline proc(condition: bool, msg: string, exit_code: int = -1, location := #caller_location) -> bool {
if condition do return true
log_print( msg, LoggerLevel.Fatal, location )
debug_trap()
process_exit( exit_code )