Merge pull request #2657 from def-/noreturn

Pass noReturn pragma to C code.
This commit is contained in:
Andreas Rumpf 2015-05-08 02:08:32 +02:00
commit 9422dbf337
6 changed files with 31 additions and 25 deletions

View file

@ -7,13 +7,13 @@ proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}
proc rawoutput(s: string) =
printf("%s\n", s)
proc panic(s: string) =
proc panic(s: string) {.noreturn.} =
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)
# proc sysFatal(exceptn: typeDesc, message: string) {.noReturn.}
# proc sysFatal(exceptn: typeDesc, message, arg: string) {.noReturn.}
{.pop.}