summary refs log tree commit diff stats
path: root/tests/manyloc/standalone/panicoverride.nim
blob: d9b3f43886f4da35dbbc4447205fbd6720649f9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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) {.noreturn.} =
  rawoutput(s)
  exit(1)

# Alternatively we also could implement these 2 here:
#
# proc sysFatal(exceptn: typeDesc, message: string) {.noReturn.}
# proc sysFatal(exceptn: typeDesc, message, arg: string) {.noReturn.}

{.pop.}