Move the noreturn pragma to sysFatal
Now you can choose to implement sysFatal with --os:standalone so that it returns.
This commit is contained in:
parent
a9fe618756
commit
c5db4fc3a2
4 changed files with 20 additions and 19 deletions
|
|
@ -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.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue