mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
Merge pull request #3536 from jyelon/proc-addr
Add 'auto-decoration' to nimGetProcAddr
This commit is contained in:
@@ -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".}
|
||||
|
||||
Reference in New Issue
Block a user