Return Golang bools from Objective-C functions that return BOOL.
Move nswrap command to cmd/nswrap.
This commit is contained in:
+9
-1
@@ -350,7 +350,12 @@ func GoToC(name string, pnames []string, rtype *Type, ptypes []*Type) string {
|
||||
if IsGoInterface(rtgt) {
|
||||
rtgt = "*Id"
|
||||
}
|
||||
ret.WriteString("return (" + rtgt + ")(")
|
||||
if rtgt == "BOOL" {
|
||||
ret.WriteString("return (")
|
||||
rtgt = "bool"
|
||||
} else {
|
||||
ret.WriteString("return (" + rtgt + ")(")
|
||||
}
|
||||
if rtype.IsPointer() {
|
||||
ret.WriteString("unsafe.Pointer(")
|
||||
}
|
||||
@@ -382,6 +387,9 @@ func GoToC(name string, pnames []string, rtype *Type, ptypes []*Type) string {
|
||||
ret.WriteString(")")
|
||||
}
|
||||
}
|
||||
if rt == "BOOL" {
|
||||
ret.WriteString(" != 0")
|
||||
}
|
||||
return ret.String()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user