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
|
|
@ -1081,31 +1081,9 @@ proc align(address, alignment: int): int =
|
|||
else:
|
||||
result = (address + (alignment - 1)) and not (alignment - 1)
|
||||
|
||||
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.}
|
||||
include system/rawquits
|
||||
when defined(genode):
|
||||
export GenodeEnv
|
||||
|
||||
template sysAssert(cond: bool, msg: string) =
|
||||
when defined(useSysAssert):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue