diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-08-31 19:21:52 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-08-31 19:21:52 +0200 |
| commit | 4ccdd78294694dcc56fa186d1532b285d72a4384 (patch) | |
| tree | 55ee8d412bb3d8897e8180b49669380150004ec2 /sys/decl.go | |
| parent | 5a093b74f6098caf00949dcf2c2ba4c2cd9ff255 (diff) | |
sys: export struct/union attributes
Export struct/union attributes so that they can be filled in
by a different package.
Diffstat (limited to 'sys/decl.go')
| -rw-r--r-- | sys/decl.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/decl.go b/sys/decl.go index d7a1765c0..7a7c95dbd 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -343,9 +343,9 @@ func (t *PtrType) Align() uint64 { type StructType struct { TypeCommon Fields []Type + IsPacked bool + AlignAttr uint64 padded bool - packed bool - align uint64 varlen bool varlenAssigned bool } @@ -383,10 +383,10 @@ func (t *StructType) Size() uint64 { } func (t *StructType) Align() uint64 { - if t.align != 0 { - return t.align // overrided by user attribute + if t.AlignAttr != 0 { + return t.AlignAttr // overrided by user attribute } - if t.packed { + if t.IsPacked { return 1 } var align uint64 @@ -400,12 +400,12 @@ func (t *StructType) Align() uint64 { type UnionType struct { TypeCommon - Options []Type - varlen bool // provided by user + Options []Type + IsVarlen bool // provided by user } func (t *UnionType) Varlen() bool { - return t.varlen + return t.IsVarlen } func (t *UnionType) Size() uint64 { |
