allow packed union (#14868)
Co-authored-by: Arne Döring <arne.doering@gmx.net>
This commit is contained in:
parent
1edb9a6178
commit
1440e70c62
2 changed files with 17 additions and 9 deletions
|
|
@ -694,3 +694,13 @@ type
|
|||
|
||||
doAssert sizeof(O0) == 1
|
||||
doAssert sizeof(T0) == 1
|
||||
|
||||
|
||||
type
|
||||
# this thing may not have padding bytes at the end
|
||||
PackedUnion* {.union, packed.} = object
|
||||
a*: array[11, byte]
|
||||
b*: int64
|
||||
|
||||
doAssert sizeof(PackedUnion) == 11
|
||||
doAssert alignof(PackedUnion) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue