summary refs log tree commit diff stats
path: root/lib/system/dyncalls.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2010-07-29 21:30:04 +0200
committerAndreas Rumpf <andreas@andreas-desktop>2010-07-29 21:30:04 +0200
commitff02ce2d50d8a4b445f9fba6076527c3db62425c (patch)
tree065d5ecddb38f871e516b49c333f565b6cba9b31 /lib/system/dyncalls.nim
parent804e2ac89d378b87e0ec8c723f607aa4271c57bb (diff)
downloadNim-ff02ce2d50d8a4b445f9fba6076527c3db62425c.tar.gz
handling of compiler procs improved for DLL generation
Diffstat (limited to 'lib/system/dyncalls.nim')
-rwxr-xr-xlib/system/dyncalls.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index 0946ee355..cb665c5cb 100755
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -24,7 +24,12 @@ proc nimUnloadLibrary(lib: TLibHandle) {.compilerproc.}
 proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr {.compilerproc.}
 
 proc nimLoadLibraryError(path: string) {.compilerproc, noinline.} =
-  raise newException(EInvalidLibrary, "could not load: " & path)
+  when true:
+    # carefully written to avoid memory allocation:
+    stdout.write("could not load: ")
+    quit(path)
+  else:
+    raise newException(EInvalidLibrary, "could not load: " & path)
 
 # this code was inspired from Lua's source code:
 # Lua - An Extensible Extension Language