Beispiel #1
0
func newUnionWithoutFields(t *gcc.Union) *Union {
	u := &Union{
		baseCNamer: newExported(t),
		baseEqualType: baseEqualType{
			cgoName: cgoName(t.CName()),
			size:    t.Size(),
			conv:    ValConv,
		},
	}
	return u
}
Beispiel #2
0
func (pac *Package) newUnionNamer(t *gcc.Union) Union {
	return Union{
		exported: exported{
			cName: t.CName(),
			file:  t.File(),
		},
		Conv: Value{namer{
			goName:  pac.globalName(t),
			cgoName: "C." + t.CName(),
		}},
		baseGoName: sprint("[", t.Size()/8, "]byte"),
	}
}
Beispiel #3
0
func (pac *Package) newUnion(t *gcc.Union) Union {
	s := pac.newUnionNamer(t)
	s.Fields = pac.newUnionFields(t.Fields(), s.GoName())
	return s
}