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
commit 72f804671d

View file

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