Merge pull request #9015 from LemonBoy/fix-9013
Fix linking issue in cpp codegen
This commit is contained in:
commit
a19d2f76f6
2 changed files with 14 additions and 1 deletions
|
|
@ -103,6 +103,10 @@ type
|
||||||
PNimType = ptr TNimType
|
PNimType = ptr TNimType
|
||||||
|
|
||||||
when defined(nimTypeNames):
|
when defined(nimTypeNames):
|
||||||
|
# Declare this variable only once in system.nim
|
||||||
|
when declared(ThisIsSystem):
|
||||||
var nimTypeRoot {.compilerProc.}: PNimType
|
var nimTypeRoot {.compilerProc.}: PNimType
|
||||||
|
else:
|
||||||
|
var nimTypeRoot {.importc.}: PNimType
|
||||||
|
|
||||||
# node.len may be the ``first`` element of a set
|
# node.len may be the ``first`` element of a set
|
||||||
|
|
|
||||||
9
tests/cpp/t9013.nim
Normal file
9
tests/cpp/t9013.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
discard """
|
||||||
|
targets: "cpp"
|
||||||
|
cmd: "nim $target --debugger:native $options $file"
|
||||||
|
"""
|
||||||
|
|
||||||
|
# The --debugger switch is needed in order to enable the defined(nimTypeNames)
|
||||||
|
# code path in hti.nim
|
||||||
|
import typeinfo
|
||||||
|
var tt: Any
|
||||||
Loading…
Add table
Add a link
Reference in a new issue