summary refs log tree commit diff stats
path: root/tests/tdllvar.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2009-12-16 00:38:35 +0100
committerAndreas Rumpf <andreas@andreas-desktop>2009-12-16 00:38:35 +0100
commit10ab814fbae0a54151028efd42ee9f806cc6bacd (patch)
treed06000186a08fb7eacdf48516f46d9c1bb046c41 /tests/tdllvar.nim
parent7063670a2cfc9cccfa9078f2dc479cccd16f526e (diff)
downloadNim-10ab814fbae0a54151028efd42ee9f806cc6bacd.tar.gz
exprs for dynlib; indentation parsing
Diffstat (limited to 'tests/tdllvar.nim')
-rwxr-xr-xtests/tdllvar.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tdllvar.nim b/tests/tdllvar.nim
new file mode 100755
index 000000000..ab767770c
--- /dev/null
+++ b/tests/tdllvar.nim
@@ -0,0 +1,16 @@
+import os
+
+proc getDllName: string = 
+  result = "mylib.dll"
+  if ExistsFile(result): return
+  result = "mylib2.dll"
+  if ExistsFile(result): return
+  quit("could not load dynamic library")
+
+proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().}
+proc myImport2(s: int) {.cdecl, importc, dynlib: getDllName().}
+
+myImport("test2")
+myImport2(12)
+
+