From 9b71889a69c932571a425cf271a77e4c7aa145a3 Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 1 May 2019 13:58:20 -0400 Subject: [PATCH] Include type qualifiers and nullability attributes in Objective-C function return types. Add NSEnumerator to examples/foundation. --- examples/foundation/nswrap.toml | 1 + types/convert.go | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/foundation/nswrap.toml b/examples/foundation/nswrap.toml index b434e6b..2681f82 100644 --- a/examples/foundation/nswrap.toml +++ b/examples/foundation/nswrap.toml @@ -5,6 +5,7 @@ Classes = [ "NSArray", "NSMutableArray", "NSDictionary", + "NSEnumerator", "NSSet", "NSDate", "NSTimeZone", diff --git a/types/convert.go b/types/convert.go index 2e7c474..2bdfc23 100644 --- a/types/convert.go +++ b/types/convert.go @@ -220,8 +220,7 @@ func (t *Type) _CType(attrib bool) string { //fmt.Println("nil sent to _CType()") return "" } - //if !attrib && c.ctype != "" ... FIXME? - if t.ctype != "" { // cache + if !attrib && t.ctype != "" { // cache return t.ctype } var ct string @@ -372,7 +371,6 @@ func GoToC(name string, pnames []string, rtype *Type, ptypes []*Type) string { if rtype.IsPointer() { ret.WriteString(")") } - ret.WriteString("\n") } return ret.String() }