summary refs log tree commit diff stats
path: root/tests/misc/tdllvar.nim
blob: 68029ddf4490e18a9ee83cfcbe3a40527e5ee51a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
disabled: true
"""

import os

proc getDllName: string =
  result = "mylib.dll"
  if fileExists(result): return
  result = "mylib2.dll"
  if fileExists(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)