fix #pragma pack generation regression in packed case objects (#24461)

Regression in #24145
This commit is contained in:
metagn
2024-11-21 14:29:18 +03:00
committed by GitHub
parent e28d2f42e9
commit b7b1003e6a

View File

@@ -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`