C++ codegen: emit 'extern C' for importc'ed functions that we declare a prototype for
This commit is contained in:
parent
f0aef9f4e2
commit
57874ed9b8
2 changed files with 9 additions and 6 deletions
|
|
@ -57,8 +57,8 @@ proc generateThreadLocalStorage(m: BModule) =
|
|||
|
||||
proc generateThreadVarsSize(m: BModule) =
|
||||
if nimtv != nil:
|
||||
let externc = if gCmd != cmdCompileToCpp and
|
||||
sfCompileToCpp in m.module.flags: "extern \"C\""
|
||||
let externc = if gCmd == cmdCompileToCpp or
|
||||
sfCompileToCpp in m.module.flags: "extern \"C\" "
|
||||
else: ""
|
||||
addf(m.s[cfsProcs],
|
||||
"$#NI NimThreadVarsSize(){return (NI)sizeof(NimThreadVars);}$n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue