fixes #21195; std/assertions continue to use sysFatal when nimPreviewSlimSystem is not defined (#21196)
* fixes #21195; `std/assertions` continue to use `sysFatal` * try includes * make `std/assertions` self-contained * fixes tests * fixes tests
This commit is contained in:
parent
705da9d452
commit
ebd1c678be
7 changed files with 63 additions and 30 deletions
27
lib/system/rawquits.nim
Normal file
27
lib/system/rawquits.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import system/ctypes
|
||||
|
||||
when defined(nimNoQuit):
|
||||
proc rawQuit(errorcode: int = QuitSuccess) = discard "ignoring quit"
|
||||
|
||||
elif defined(genode):
|
||||
import genode/env
|
||||
|
||||
var systemEnv {.exportc: runtimeEnvSym.}: GenodeEnvPtr
|
||||
|
||||
type GenodeEnv = GenodeEnvPtr
|
||||
## Opaque type representing Genode environment.
|
||||
|
||||
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",
|
||||
importc: "process.exit", noreturn.}
|
||||
|
||||
else:
|
||||
proc rawQuit(errorcode: cint) {.
|
||||
magic: "Exit", importc: "exit", header: "<stdlib.h>", noreturn.}
|
||||
Loading…
Add table
Add a link
Reference in a new issue