Windows: fixes a regression; codegen might not know about & at this point

This commit is contained in:
Araq
2016-03-29 16:39:05 +02:00
parent db2b215658
commit 13a83c7fdd
3 changed files with 3 additions and 2 deletions

0
bootstrap.sh Executable file → Normal file
View File

0
lib/pure/unittest.nim Executable file → Normal file
View File

View File

@@ -109,9 +109,10 @@ elif defined(windows) or defined(dos):
proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr =
result = getProcAddress(cast[THINSTANCE](lib), name)
if result != nil: return
var decorated: array[250, char]
for i in countup(0, 50):
var decorated = "_" & $name & "@" & $(i * 4)
result = getProcAddress(cast[THINSTANCE](lib), cstring(decorated))
discard csprintf(decorated, "_%s@%ld", name, i*4)
result = getProcAddress(cast[THINSTANCE](lib), decorated)
if result != nil: return
procAddrError(name)