diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim index 817f7d8a5f..d8ab0e6035 100644 --- a/lib/system/dyncalls.nim +++ b/lib/system/dyncalls.nim @@ -73,11 +73,18 @@ when defined(posix): # # c stuff: - when defined(linux) or defined(macosx): - const RTLD_NOW = cint(2) + when defined(linux): + const + RTLD_NOW = cint(2) + RTLD_GLOBAL = cint(0x100) + elif defined(macosx): + const + RTLD_NOW = cint(2) + RTLD_GLOBAL = cint(0x8) else: var RTLD_NOW {.importc: "RTLD_NOW", header: "".}: cint + RTLD_GLOBAL {.importc: "RTLD_GLOBAL", header: "".}: cint proc dlclose(lib: LibHandle) {.importc, header: "".} proc dlopen(path: cstring, mode: cint): LibHandle {.