Fix linking issue in cpp codegen
Declare the root symbol only once and have the other modules depending on it emit an `extern` declaration. Fixes #9013
This commit is contained in:
parent
a892d519a6
commit
334032294f
2 changed files with 14 additions and 1 deletions
|
|
@ -103,6 +103,10 @@ type
|
|||
PNimType = ptr TNimType
|
||||
|
||||
when defined(nimTypeNames):
|
||||
var nimTypeRoot {.compilerProc.}: PNimType
|
||||
# Declare this variable only once in system.nim
|
||||
when declared(ThisIsSystem):
|
||||
var nimTypeRoot {.compilerProc.}: PNimType
|
||||
else:
|
||||
var nimTypeRoot {.importc.}: PNimType
|
||||
|
||||
# node.len may be the ``first`` element of a set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue