You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to find a workaround to #9365, I find out that exportc doesn't find const variable in a template:
var i {.compileTime.} =0procgenSuffix(): staticint=result= i
inc i
templatefoo() =# Works if procconst
suffix =genSuffix()
ompsize_Csym ="ompsize_"&$suffix
static:
echo ompsize_Csym
let ompsize {.exportc: ompsize_Csym.} =100# Fails# let ompsize = 100 # works# let ompsize {.exportc: "ompsize_" & $genSuffix().} = 100 # worksecho ompsize
foo()
foo()
Error: undeclared identifier: 'ompsize_Csym'
The text was updated successfully, but these errors were encountered:
While trying to find a workaround to #9365, I find out that exportc doesn't find const variable in a template:
The text was updated successfully, but these errors were encountered: