Beispiel #1
0
func newEnum(t *gcc.Enumeration) *Enum {
	e := &Enum{
		baseEqualType: baseEqualType{
			cgoName: cgoName(t.CName()),
			size:    t.Size(),
			conv:    NumConv,
		},
		baseCNamer: newExported(t),
		baseGoName: goNumMap[gcc.NumInfo{gcc.SignedInt, t.Size() * 8}],
		Values:     newEnumValues(t.EnumValues),
	}
	return e
}
Beispiel #2
0
func (pac *Package) newEnum(t *gcc.Enumeration) Enum {
	return Enum{
		exported: exported{
			cName: t.CName(),
			file:  t.File(),
		},
		Conv: Simple{namer{
			goName:  pac.globalName(t),
			cgoName: "C." + t.CName(),
		}},
		baseGoName: goNumMap[gcc.NumInfo{gcc.SignedInt, t.Size()}],
		Values:     pac.newEnumValues(t.EnumValues),
	}
}