Add constants for C enum types. Add NSEnumerator helper. Fix

bugs in Go class names. Add "Frameworks" option to nswrap.toml.
Improve handling of ast.EnumDecl and ast.EnumConstantDecl.
This commit is contained in:
gmp
2019-05-02 14:14:29 -04:00
parent 9b71889a69
commit 758ea40679
7 changed files with 219 additions and 52 deletions
+3 -2
View File
@@ -157,7 +157,6 @@ func (t *Type) PointsTo() *Type {
}
func Wrap(s string) {
// it is the pointers to this type that get wrapped
wrapped[s] = true
}
@@ -270,11 +269,13 @@ type %s %s
}
func (t *Type) GoInterfaceDecl() string {
ct := t.CType()
gt := t.GoType()
if gt[0] == '*' {
gt = gt[1:] // dereference wrapped types
ct = ct[:len(ct)-1]
}
super := Super(gt)
super := Super(ct)
if super == "" {
goInterfaces[gt] = true
return fmt.Sprintf(`