Closed markus-oberhumer closed 7 years ago
As @ephja said remove the the template and simply use the const name inside the dynlib pragma. While doing this i would name the const variable as dynLibName
Well, my proposed commit is simple and just works - without touching the 100+ calls of getDllName()
.
@markus-oberhumer and what's the problem in touching the 100+ calls? if you're not willing to do this i can do it for you (implies closing this pull)
@filcuc Of course I can provide a follow-up commit after merging this pull request.
Btw, the original code works because the compile time property of a proc can be inferred without annotating it with {.compileTime.}, so that makes it very similar to a const if the proc doesn't have any side effects. You can do a lot of things at compile time.
No, the current version does not work as you think - just have a look at the generated C code.
And then try using nim c --dynlibOverride:libDOtherSide.so.0.6
with both the current and my patched version.
Oh I see. I wonder why that is. I'll investigate.
Fixed in master
I would remove the template and instead refer to the constant directly.