From 13a83c7fdd92af9cda38c0c9cfafe2d555b34206 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 29 Mar 2016 16:39:05 +0200 Subject: [PATCH] Windows: fixes a regression; codegen might not know about & at this point --- bootstrap.sh | 0 lib/pure/unittest.nim | 0 lib/system/dyncalls.nim | 5 +++-- 3 files changed, 3 insertions(+), 2 deletions(-) mode change 100755 => 100644 bootstrap.sh mode change 100755 => 100644 lib/pure/unittest.nim diff --git a/bootstrap.sh b/bootstrap.sh old mode 100755 new mode 100644 diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim old mode 100755 new mode 100644 diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim index ba5e4bbeb..3b3d1f87d 100644 --- a/lib/system/dyncalls.nim +++ b/lib/system/dyncalls.nim @@ -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)