Merge pull request #4848 from flyx/fix-debugdlopen

Fixed compilation error with -d:nimDebugDlOpen
This commit is contained in:
Andreas Rumpf 2016-10-06 10:39:47 +02:00 • committed by GitHub
commit 754b99e435

View file

@ -26,6 +26,8 @@ proc nimLoadLibraryError(path: string) =
stderr.rawWrite("could not load: ") stderr.rawWrite("could not load: ")
stderr.rawWrite(path) stderr.rawWrite(path)
stderr.rawWrite("\n") stderr.rawWrite("\n")
when not(defined(nimDebugDlOpen)):
stderr.rawWrite("compile with -d:nimDebugDlOpen for more information\n")
quit(1) quit(1)
proc procAddrError(name: cstring) {.noinline.} = proc procAddrError(name: cstring) {.noinline.} =
@ -74,7 +76,8 @@ when defined(posix):
when defined(nimDebugDlOpen): when defined(nimDebugDlOpen):
let error = dlerror() let error = dlerror()
if error != nil: if error != nil:
c_fprintf(c_stderr, "%s\n", error) stderr.write(error)
stderr.rawWrite("\n")
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr = proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
result = dlsym(lib, name) result = dlsym(lib, name)