completes #12799, fixes #12216 (#12870)

This commit is contained in:
Andreas Rumpf 2019-12-10 12:09:48 +01:00 • committed by GitHub
commit 61d89aae11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -539,6 +539,7 @@ proc assignGlobalVar(p: BProc, n: PNode; value: Rope) =
decl.addf "NIM_ALIGN($1) ", [rope(s.alignment)] decl.addf "NIM_ALIGN($1) ", [rope(s.alignment)]
if p.hcrOn: decl.add("static ") if p.hcrOn: decl.add("static ")
elif sfImportc in s.flags: decl.add("extern ") elif sfImportc in s.flags: decl.add("extern ")
if s.kind == skLet and value != nil: decl.add("NIM_CONST ")
decl.add(td) decl.add(td)
if p.hcrOn: decl.add("*") if p.hcrOn: decl.add("*")
if sfRegister in s.flags: decl.add(" register") if sfRegister in s.flags: decl.add(" register")