Skip to content

Commit

Permalink
Add noQuit option (#19419) [backport:1.6]
Browse files Browse the repository at this point in the history
* Add noQuit option

* Add nim prefix in case of conflicts

Co-authored-by: flywind <[email protected]>

Co-authored-by: flywind <[email protected]>
(cherry picked from commit ce44cf0)
  • Loading branch information
tjpalmer authored and narimiran committed Jan 20, 2022
1 parent fc0aec6 commit 3d3b344
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ proc align(address, alignment: int): int =
else:
result = (address + (alignment - 1)) and not (alignment - 1)

when defined(nimdoc):
proc quit*(errorcode: int = QuitSuccess) {.magic: "Exit", noreturn.}
when defined(nimNoQuit):
proc quit*(errorcode: int = QuitSuccess) = discard "ignoring quit"
## Stops the program immediately with an exit code.
##
## Before stopping the program the "exit procedures" are called in the
Expand All @@ -1214,6 +1214,9 @@ when defined(nimdoc):
## It does *not* call the garbage collector to free all the memory,
## unless an `addExitProc` proc calls `GC_fullCollect <#GC_fullCollect>`_.

elif defined(nimdoc):
proc quit*(errorcode: int = QuitSuccess) {.magic: "Exit", noreturn.}

elif defined(genode):
include genode/env

Expand Down

0 comments on commit 3d3b344

Please sign in to comment.