diff --git a/kernel/panicoverride.nim b/kernel/panicoverride.nim index 08cced0..b39f0c3 100644 --- a/kernel/panicoverride.nim +++ b/kernel/panicoverride.nim @@ -1,2 +1,22 @@ -proc rawoutput(s: string) = discard -proc panic(s: string) = discard + +{.push debugger:off, hints:off.} + +proc printf(frmt: cstring) {.varargs, importc, header: "", cdecl.} +proc exit(code: int) {.importc, header: "", cdecl.} + +{.push stack_trace: off, profiler:off.} + +proc rawoutput(s: string) = + printf("%s\n", s) + +proc panic(s: string) = + rawoutput(s) + exit(1) + +# Alternatively we also could implement these 2 here: +# +# template sysFatal(exceptn: typeDesc, message: string) +# template sysFatal(exceptn: typeDesc, message, arg: string) + +{.pop.} +{.pop.} \ No newline at end of file