Skip to content

Commit

Permalink
fix #pragma pack generation regression in packed case objects (#24461)
Browse files Browse the repository at this point in the history
Regression in #24145
  • Loading branch information
metagn authored Nov 21, 2024
1 parent e28d2f4 commit b7b1003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/cbuilderdecls.nim
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ template addFieldWithStructType(obj: var Builder; m: BModule; parentTyp: PType;
obj.add(fieldName)
obj.add(";\n")
if tfPacked in parentTyp.flags and hasAttribute notin CC[m.config.cCompiler].props:
result.add("#pragma pack(pop)\n")
obj.add("#pragma pack(pop)\n")

template addAnonUnion(obj: var Builder; body: typed) =
## adds an anonymous union i.e. `union { ... };` with fields according to `body`
Expand Down

0 comments on commit b7b1003

Please sign in to comment.