summary refs log tree commit diff stats
path: root/tests/misc/tdllvar.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-04-09 22:56:18 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-04-09 22:56:18 +0200
commita690e7b26772a9bb8367acb451a6250449e666ab (patch)
tree9aca0024db9c75970c4dfac10c55f1961c21ca25 /tests/misc/tdllvar.nim
parentd0f013477b16520eefff69b861d2f26744463880 (diff)
parenta157985e01cbf80383d5e50836072d70678c9de3 (diff)
downloadNim-a690e7b26772a9bb8367acb451a6250449e666ab.tar.gz
Merge pull request #1075 from flaviut/inlinedocs
Add some documentations and code examples in system
Diffstat (limited to 'tests/misc/tdllvar.nim')
-rw-r--r--tests/misc/tdllvar.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/misc/tdllvar.nim b/tests/misc/tdllvar.nim
new file mode 100644
index 000000000..ab767770c
--- /dev/null
+++ b/tests/misc/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)
+
+