Merge pull request #1534 from rbehrends/fix-importc-var
Avoid unnecessary #include triggered by importc vars.
This commit is contained in:
commit
9f047f4351
1 changed files with 4 additions and 0 deletions
|
|
@ -171,6 +171,10 @@ proc genSingleVar(p: BProc, a: PNode) =
|
||||||
if sfCompileTime in v.flags: return
|
if sfCompileTime in v.flags: return
|
||||||
var targetProc = p
|
var targetProc = p
|
||||||
if sfGlobal in v.flags:
|
if sfGlobal in v.flags:
|
||||||
|
if v.flags * {sfImportc, sfExportc} == {sfImportc} and
|
||||||
|
a.sons[2].kind == nkEmpty and
|
||||||
|
v.loc.flags * {lfHeader, lfNoDecl} != {}:
|
||||||
|
return
|
||||||
if sfPure in v.flags:
|
if sfPure in v.flags:
|
||||||
# v.owner.kind != skModule:
|
# v.owner.kind != skModule:
|
||||||
targetProc = p.module.preInitProc
|
targetProc = p.module.preInitProc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue