do not print spurious warnings when dlopen fails; can be re-enabled with -d:nimDebugDlOpen

This commit is contained in:
Andreas Rumpf
2015-12-29 20:34:36 +01:00
parent deef047f27
commit 72f804671d

View File

@@ -68,9 +68,10 @@ when defined(posix):
proc nimLoadLibrary(path: string): LibHandle =
result = dlopen(path, RTLD_NOW)
let error = dlerror()
if error != nil:
c_fprintf(c_stdout, "%s\n", error)
when defined(nimDebugDlOpen):
let error = dlerror()
if error != nil:
c_fprintf(c_stdout, "%s\n", error)
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
result = dlsym(lib, name)