genbindings/emitcabi: merge the two qt forwarding cases

This commit is contained in:
mappu 2024-08-28 18:22:25 +12:00
parent 4ca4c0dd9e
commit 488e3cc6c4

View File

@ -153,16 +153,18 @@ func emitParametersCabi(m CppMethod, selfType string) string {
tmp = append(tmp, t.RenderTypeCabi()+"* "+p.ParameterName+", size_t "+p.ParameterName+"_len") tmp = append(tmp, t.RenderTypeCabi()+"* "+p.ParameterName+", size_t "+p.ParameterName+"_len")
} }
} else if (p.ByRef || p.Pointer) && p.QtClassType() { } else if p.QtClassType() {
if p.ByRef || p.Pointer {
// Pointer to Qt type // Pointer to Qt type
// Replace with taking our PQ typedef by value // Replace with taking our PQ typedef by value
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName) tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
} else {
} else if p.QtClassType() {
// Qt type passed by value // Qt type passed by value
// The CABI will unconditionally take these by pointer and dereference them // The CABI will unconditionally take these by pointer and dereference them
// when passing to C++ // when passing to C++
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName) tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
}
} else { } else {
// RenderTypeCabi renders both pointer+reference as pointers // RenderTypeCabi renders both pointer+reference as pointers