mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18:37 +00:00
genbindings: minimal handling for metacast() returning void*
This commit is contained in:
parent
5321074f99
commit
05804f837e
@ -44,8 +44,6 @@ func emitParametersGo2CABIForwarding(m CppMethod) (preamble string, fowarding st
|
|||||||
preamble += "defer C.free(" + p.ParameterName + "_Cstring)\n"
|
preamble += "defer C.free(" + p.ParameterName + "_Cstring)\n"
|
||||||
tmp = append(tmp, p.ParameterName+"_Cstring, len("+p.ParameterName+")")
|
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" {
|
} else if p.Pointer && p.ParameterType == "char" {
|
||||||
// Single char* argument
|
// Single char* argument
|
||||||
preamble += p.ParameterName + "_Cstring := C.CString(" + p.ParameterName + ")\n"
|
preamble += p.ParameterName + "_Cstring := C.CString(" + p.ParameterName + ")\n"
|
||||||
@ -129,6 +127,9 @@ import "C"
|
|||||||
shouldReturn = ""
|
shouldReturn = ""
|
||||||
returnTypeDecl = ""
|
returnTypeDecl = ""
|
||||||
|
|
||||||
|
} else if m.ReturnType.ParameterType == "void" && m.ReturnType.Pointer {
|
||||||
|
returnTypeDecl = "interface{}"
|
||||||
|
|
||||||
} else if m.ReturnType.ParameterType == "QString" {
|
} else if m.ReturnType.ParameterType == "QString" {
|
||||||
shouldReturn = ""
|
shouldReturn = ""
|
||||||
returnTypeDecl = "string"
|
returnTypeDecl = "string"
|
||||||
|
Loading…
Reference in New Issue
Block a user