summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorTom <tom@contextfree.info>2022-01-19 09:41:11 -0700
committerGitHub <noreply@github.com>2022-01-19 17:41:11 +0100
commitce44cf03cc4a78741c423b2b3963b48b6d9e6755 (patch)
treedc3b46741f501f60df0cbe0591f2d8a378dc8fc3 /lib/system.nim
parent08261cb9e33445553144219023900b4ced0b0f55 (diff)
downloadNim-ce44cf03cc4a78741c423b2b3963b48b6d9e6755.tar.gz
Add noQuit option (#19419) [backport:1.6]
* Add noQuit option

* Add nim prefix in case of conflicts

Co-authored-by: flywind <xzsflywind@gmail.com>

Co-authored-by: flywind <xzsflywind@gmail.com>
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 09de9fcde..63cdc3ca8 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1198,8 +1198,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
@@ -1223,6 +1223,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