Gave panicoverride a C implementation for now.

This commit is contained in:
neviyn 2017-10-22 00:49:02 +01:00
parent 7f426b5f25
commit 0da0bc40dd

View File

@ -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: "<stdio.h>", cdecl.}
proc exit(code: int) {.importc, header: "<stdlib.h>", 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.}