panicoverride.nim 493 B

1234567891011121314151617181920
  1. proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.}
  2. proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}
  3. {.push stack_trace: off, profiler:off.}
  4. proc rawoutput(s: string) =
  5. printf("%s\n", s)
  6. proc panic(s: string) {.noreturn.} =
  7. rawoutput(s)
  8. exit(1)
  9. # Alternatively we also could implement these 2 here:
  10. #
  11. # proc sysFatal(exceptn: typeDesc, message: string) {.noReturn.}
  12. # proc sysFatal(exceptn: typeDesc, message, arg: string) {.noReturn.}
  13. {.pop.}