summary refs log blame commit diff stats
path: root/tests/accept/compile/tdllvar.nim
blob: ab767770c0bf2106899834cd325ae101f1993981 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)