summary refs log blame commit diff stats
path: root/tests/misc/tdllvar.nim
blob: 5a31dfbbb793bc253eb37bd850cba4e78be277c0 (plain) (tree)
1
2
3
4
5
6
7



                          
                               
                       
                               








                                                                  
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)