Merge pull request #3536 from jyelon/proc-addr
Add 'auto-decoration' to nimGetProcAddr
This commit is contained in:
commit
0f7fdd8bf4
1 changed files with 6 additions and 1 deletions
|
|
@ -105,7 +105,12 @@ elif defined(windows) or defined(dos):
|
|||
|
||||
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
|
||||
result = getProcAddress(cast[THINSTANCE](lib), name)
|
||||
if result == nil: procAddrError(name)
|
||||
if result != nil: return
|
||||
for i in countup(0, 50):
|
||||
var decorated = "_" & $name & "@" & $(i * 4)
|
||||
result = getProcAddress(cast[THINSTANCE](lib), cstring(decorated))
|
||||
if result != nil: return
|
||||
procAddrError(name)
|
||||
|
||||
else:
|
||||
{.error: "no implementation for dyncalls".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue