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:
+5
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user