示例#1
0
文件: parse.go 项目: sbinet/cwrap
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),
	}
}
示例#2
0
文件: parse.go 项目: h12w/cwrap
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
}