summary refs log tree commit diff stats
path: root/tests/cpp/amodule.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp/amodule.nim')
-rw-r--r--tests/cpp/amodule.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/cpp/amodule.nim b/tests/cpp/amodule.nim
new file mode 100644
index 000000000..2f3e34051
--- /dev/null
+++ b/tests/cpp/amodule.nim
@@ -0,0 +1,10 @@
+import os
+
+proc findlib: string =
+  let path = getEnv("MYLIB_DOES_NOT_EXIST_PATH")
+  if path.len > 0 and dirExists(path):
+    path / "alib_does_not_matter.dll"
+  else:
+    "alib_does_not_matter.dll"
+
+proc imported_func*(a: cint): cstring {.importc, dynlib: findlib().}
\ No newline at end of file