From 8da51d61f5e81f3fac20841dcaf64a5836252422 Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 28 Aug 2024 18:47:44 +1200 Subject: [PATCH] genbindings: misc fixes --- cmd/genbindings/clang2il.go | 6 ++++++ cmd/genbindings/emitcabi.go | 1 + cmd/genbindings/transformtypedefs_test.go | 5 +---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index c4b4d559..4dd2d707 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -166,6 +166,12 @@ func processClassType(node map[string]interface{}, addNamePrefix string) (CppCla return CppClass{}, ErrNoContent // errors.New("node has no name") } nodename = addNamePrefix + nodename + + // Hacks: + if nodename == "FromBase64Result" { + nodename = "QByteArray::FromBase64Result" + } + ret.ClassName = nodename log.Printf("-> Processing class %q...\n", nodename) diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 2453faf7..bdd040d3 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -594,6 +594,7 @@ extern "C" { nonConst.Const = false nonConst.ByRef = false nonConst.Pointer = true + nonConst.PointerCount = 1 afterCall += "\treturn const_cast<" + nonConst.RenderTypeQtCpp() + ">(&ret);\n" } else { afterCall += "\treturn &ret;\n" diff --git a/cmd/genbindings/transformtypedefs_test.go b/cmd/genbindings/transformtypedefs_test.go index 87ed5518..dcce7270 100644 --- a/cmd/genbindings/transformtypedefs_test.go +++ b/cmd/genbindings/transformtypedefs_test.go @@ -17,10 +17,7 @@ func TestTransformTypedefs(t *testing.T) { CppMethod{ Parameters: []CppParameter{ - CppParameter{ - ParameterName: "foo", - ParameterType: typeName, - }, + parseSingleTypeString(typeName), }, IsStatic: true, },