Make a Go Interface instead of a struct for top level objects.

Use a new struct Id as a concrete version of that type.
This commit is contained in:
gmp
2019-04-29 11:46:48 -04:00
parent c0c17e88d1
commit c03e37bd54
8 changed files with 94 additions and 19 deletions
+5 -1
View File
@@ -35,6 +35,10 @@ func NewWrapper(debug bool) *Wrapper {
ret.cCode.WriteString(`/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation
`)
ret.goTypes.WriteString(`
type Id struct { ptr unsafe.Pointer }
func (o *Id) Ptr() unsafe.Pointer { return o.ptr }
`)
return ret
}
@@ -331,12 +335,12 @@ func (w *Wrapper) processType(tp *types.Type) {
if bt.IsFunction() {
return
}
w.goTypes.WriteString(bt.GoTypeDecl())
super := types.Super(gt)
if super != "" {
types.Wrap(super)
w.processType(types.NewTypeFromString(super,""))
}
w.goTypes.WriteString(bt.GoTypeDecl())
}
func (w *Wrapper) CharHelpers() {