parent
efeee326f8
commit
e749fc08e7
3 changed files with 17 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
6
tests/constr/a_module.nim
Normal file
6
tests/constr/a_module.nim
Normal 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
7
tests/constr/tglobal.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
discard """
|
||||
output: "0"
|
||||
"""
|
||||
|
||||
# b.nim
|
||||
import a_module
|
||||
echo foo()
|
||||
Loading…
Add table
Add a link
Reference in a new issue