This commit is contained in:
Andreas Rumpf
2017-06-13 13:51:33 +02:00
parent 210955c3b6
commit 91a3cb67ec

View File

@@ -470,7 +470,12 @@ proc genRecordFieldsAux(m: BModule, n: PNode,
let a = genRecordFieldsAux(m, k, "$1.$2" % [ae, sname], rectype,
check)
if a != nil:
add(unionBody, "struct {")
if tfPacked notin rectype.flags:
add(unionBody, "struct {")
else:
addf(unionBody, CC[cCompiler].structStmtFmt,
[rope"struct", nil, rope(CC[cCompiler].packedPragma)])
add(unionBody, "{")
add(unionBody, a)
addf(unionBody, "} $1;$n", [sname])
else: