diff options
Diffstat (limited to 'lib/system/dyncalls.nim')
-rwxr-xr-x | lib/system/dyncalls.nim | 7 |
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 |