when hostOS=="windows":
proc loopStepWait(): cint {.importc: "IupLoopStepWait", cdecl, dynlib:"iup.dll", discardable.}
else:
proc loopStepWait(): cint {.importc: "IupLoopStepWait", cdecl, dynlib:"libiup.so", discardable.}
And, no, I do not want to generate my own version of iup using c2nim - I saw the posts on doing that.
when defined(windows):
const
libname* = "iup.dll"
elif defined(macosx):
const
libname* = "libiup.dylib"
else:
const
libname* = "libiup.so"
proc loopStepWait(): cint {.importc: "IupLoopStepWait", cdecl, dynlib: libname, discardable.}
I was assuming that the compiler had some way to automatically define some variable like the libname used above - since importing iup must use that information. I was hoping there was some way for my nim code to use that information as well.
I'll use the libname scheme above, once I need more than one extra iup name.
Thanks