mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 14:03:23 +00:00
@@ -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()
|
||||
Reference in New Issue
Block a user