Skip to content

Commit

Permalink
fix #pragma pack generation in packed case objects
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Nov 21, 2024
1 parent e28d2f4 commit c6f62af
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 c6f62af

Please sign in to comment.