system refactorings (#10559)

* move IO subsystem into its own module; refs #10385
* make standalone test compile again
* make C++ examples compile again
* make more tests green
* make sysAssert and gcAssert work again
This commit is contained in:
Andreas Rumpf 2019-02-06 21:00:00 +01:00 • committed by GitHub
commit 0036014727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 822 additions and 830 deletions

View file

@ -19,11 +19,11 @@ const
proc nimLoadLibraryError(path: string) =
# carefully written to avoid memory allocation:
stderr.rawWrite("could not load: ")
stderr.rawWrite(path)
stderr.rawWrite("\n")
cstderr.rawWrite("could not load: ")
cstderr.rawWrite(path)
cstderr.rawWrite("\n")
when not defined(nimDebugDlOpen) and not defined(windows):
stderr.rawWrite("compile with -d:nimDebugDlOpen for more information\n")
cstderr.rawWrite("compile with -d:nimDebugDlOpen for more information\n")
when defined(windows) and defined(guiapp):
# Because console output is not shown in GUI apps, display error as message box:
const prefix = "could not load: "
@ -35,9 +35,9 @@ proc nimLoadLibraryError(path: string) =
proc procAddrError(name: cstring) {.noinline.} =
# carefully written to avoid memory allocation:
stderr.rawWrite("could not import: ")
stderr.rawWrite(name)
stderr.rawWrite("\n")
cstderr.rawWrite("could not import: ")
cstderr.rawWrite(name)
cstderr.rawWrite("\n")
quit(1)
# this code was inspired from Lua's source code:
@ -79,8 +79,8 @@ when defined(posix):
when defined(nimDebugDlOpen):
let error = dlerror()
if error != nil:
stderr.rawWrite(error)
stderr.rawWrite("\n")
cstderr.rawWrite(error)
cstderr.rawWrite("\n")
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
result = dlsym(lib, name)
@ -162,20 +162,20 @@ elif defined(genode):
elif defined(nintendoswitch):
proc nimUnloadLibrary(lib: LibHandle) =
stderr.rawWrite("nimUnLoadLibrary not implemented")
stderr.rawWrite("\n")
cstderr.rawWrite("nimUnLoadLibrary not implemented")
cstderr.rawWrite("\n")
quit(1)
proc nimLoadLibrary(path: string): LibHandle =
stderr.rawWrite("nimLoadLibrary not implemented")
stderr.rawWrite("\n")
cstderr.rawWrite("nimLoadLibrary not implemented")
cstderr.rawWrite("\n")
quit(1)
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
stderr.rawWrite("nimGetProAddr not implemented")
stderr.rawWrite(name)
stderr.rawWrite("\n")
cstderr.rawWrite("nimGetProAddr not implemented")
cstderr.rawWrite(name)
cstderr.rawWrite("\n")
quit(1)
else: