prefer consts to importing #defines from headers
to be completed - better would be to have a libc wrapper that deals with all pesky C ABI details
This commit is contained in:
parent
fe2b39f007
commit
8d7a45f205
6 changed files with 65 additions and 39 deletions
|
|
@ -52,11 +52,14 @@ when defined(posix):
|
|||
#
|
||||
|
||||
# c stuff:
|
||||
var
|
||||
RTLD_NOW {.importc: "RTLD_NOW", header: "<dlfcn.h>".}: int
|
||||
when defined(linux) or defined(macosx):
|
||||
const RTLD_NOW = cint(2)
|
||||
else:
|
||||
var
|
||||
RTLD_NOW {.importc: "RTLD_NOW", header: "<dlfcn.h>".}: cint
|
||||
|
||||
proc dlclose(lib: LibHandle) {.importc, header: "<dlfcn.h>".}
|
||||
proc dlopen(path: cstring, mode: int): LibHandle {.
|
||||
proc dlopen(path: cstring, mode: cint): LibHandle {.
|
||||
importc, header: "<dlfcn.h>".}
|
||||
proc dlsym(lib: LibHandle, name: cstring): ProcAddr {.
|
||||
importc, header: "<dlfcn.h>".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue