From e41d510eece6c01e44b6de3d6c2d8254f54e375a Mon Sep 17 00:00:00 2001
From: xflywind <43030857+ringabout@users.noreply.github.com>
Date: Tue, 1 Nov 2022 12:13:21 +0800
Subject: [PATCH] public `rawQuit` since it's a dep of sysFatal
---
lib/system.nim | 9 ++++++---
lib/system/fatal.nim | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/system.nim b/lib/system.nim
index 24b5343d9fca3..1c5ebad6ddd6b 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -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
@@ -1100,12 +1100,15 @@ elif defined(genode):
proc rawQuit(env: GenodeEnv; errorcode: int) {.magic: "Exit", noreturn,
importcpp: "#->parent().exit(@); Genode::sleep_forever()", header: "".}
+ 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: "", noreturn.}
diff --git a/lib/system/fatal.nim b/lib/system/fatal.nim
index 1d6860bbf3eb8..a55af2dc3989b 100644
--- a/lib/system/fatal.nim
+++ b/lib/system/fatal.nim
@@ -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".}