This commit is contained in:
cooldome
2019-04-05 13:50:57 +01:00
committed by Andreas Rumpf
parent efeee326f8
commit e749fc08e7
3 changed files with 17 additions and 1 deletions

View File

@@ -1619,7 +1619,10 @@ proc genModule(m: BModule, cfile: Cfile): Rope =
add(result, m.s[cfsHeaders])
add(result, genSectionEnd(cfsHeaders, m.config))
add(result, genSectionStart(cfsFrameDefines, m.config))
add(result, m.s[cfsFrameDefines])
if m.s[cfsFrameDefines].len > 0:
add(result, m.s[cfsFrameDefines])
else:
add(result, "#define nimfr_(x, y)\n#define nimln_(x, y)\n")
add(result, genSectionEnd(cfsFrameDefines, m.config))
for i in countup(cfsForwardTypes, cfsProcs):

View File

@@ -0,0 +1,6 @@
# a.nim
{.push stackTrace: off.}
proc foo*(): int =
var a {.global.} = 0
result = a
{.pop.}

7
tests/constr/tglobal.nim Normal file
View File

@@ -0,0 +1,7 @@
discard """
output: "0"
"""
# b.nim
import a_module
echo foo()