Skip to content

Commit

Permalink
public rawQuit since it's a dep of sysFatal
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Nov 1, 2022
1 parent c04c3e0 commit e41d510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ proc align(address, alignment: int): int =
result = (address + (alignment - 1)) and not (alignment - 1)

when defined(nimNoQuit):
proc rawQuit(errorcode: int = QuitSuccess) = discard "ignoring quit"
proc rawQuit*(errorcode: int = QuitSuccess) = discard "ignoring quit"

elif defined(genode):
import genode/env
Expand All @@ -1100,12 +1100,15 @@ elif defined(genode):
proc rawQuit(env: GenodeEnv; errorcode: int) {.magic: "Exit", noreturn,
importcpp: "#->parent().exit(@); Genode::sleep_forever()", header: "<base/sleep.h>".}

proc rawQuit*(errorcode: int = QuitSuccess) {.inline, noreturn.} =
systemEnv.rawQuit(errorcode)

elif defined(js) and defined(nodejs) and not defined(nimscript):
proc rawQuit(errorcode: int = QuitSuccess) {.magic: "Exit",
proc rawQuit*(errorcode: int = QuitSuccess) {.magic: "Exit",
importc: "process.exit", noreturn.}

else:
proc rawQuit(errorcode: int = QuitSuccess) {.
proc rawQuit*(errorcode: int = QuitSuccess) {.
magic: "Exit", importc: "exit", header: "<stdlib.h>", noreturn.}


Expand Down
2 changes: 1 addition & 1 deletion lib/system/fatal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ when hostOS == "standalone":
rawoutput(message)
panic(arg)

elif (defined(nimQuirky) or defined(nimPanics)) and not defined(nimscript) and not defined(js):
elif (defined(nimQuirky) or defined(nimPanics)) and not defined(nimscript):
import ansi_c

func name(t: typedesc): string {.magic: "TypeTrait".}
Expand Down

0 comments on commit e41d510

Please sign in to comment.