genbindings: minimal handling for metacast() returning void*

This commit is contained in:
mappu 2024-08-10 11:46:07 +12:00
parent 5321074f99
commit 05804f837e

View File

@ -44,8 +44,6 @@ func emitParametersGo2CABIForwarding(m CppMethod) (preamble string, fowarding st
preamble += "defer C.free(" + p.ParameterName + "_Cstring)\n"
tmp = append(tmp, p.ParameterName+"_Cstring, len("+p.ParameterName+")")
// TODO handle the return type as a pointer parameter
} else if p.Pointer && p.ParameterType == "char" {
// Single char* argument
preamble += p.ParameterName + "_Cstring := C.CString(" + p.ParameterName + ")\n"
@ -129,6 +127,9 @@ import "C"
shouldReturn = ""
returnTypeDecl = ""
} else if m.ReturnType.ParameterType == "void" && m.ReturnType.Pointer {
returnTypeDecl = "interface{}"
} else if m.ReturnType.ParameterType == "QString" {
shouldReturn = ""
returnTypeDecl = "string"