From 90de7178f218fec8aa9c36417312cce39da9b899 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 19 Nov 2024 19:59:55 +1300 Subject: [PATCH] genbindings: fix some cases of missing :: escaping --- cmd/genbindings/emitcabi.go | 6 +++--- cmd/genbindings/emitgo.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 46b9377c..616d00f9 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -759,14 +759,14 @@ func emitParametersCabiConstructor(c *CppClass, ctor *CppMethod) string { plist := slice_copy(ctor.Parameters) // semi-shallow copy plist = append(plist, CppParameter{ - ParameterName: cabiClassName("outptr_" + c.ClassName), + ParameterName: cabiClassName("outptr_" + cabiClassName(c.ClassName)), ParameterType: c.ClassName, Pointer: true, PointerCount: 2, }) for _, baseClass := range c.AllInherits() { plist = append(plist, CppParameter{ - ParameterName: cabiClassName("outptr_" + baseClass), + ParameterName: cabiClassName("outptr_" + cabiClassName(baseClass)), ParameterType: baseClass, Pointer: true, PointerCount: 2, @@ -986,7 +986,7 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { "\t*outptr_" + cabiClassName(c.ClassName) + " = ret;\n", // Original class name ) for _, baseClass := range c.AllInherits() { - ret.WriteString("\t*outptr_" + baseClass + " = static_cast<" + baseClass + "*>(ret);\n") + ret.WriteString("\t*outptr_" + cabiClassName(baseClass) + " = static_cast<" + baseClass + "*>(ret);\n") } ret.WriteString( diff --git a/cmd/genbindings/emitgo.go b/cmd/genbindings/emitgo.go index 4ad60ec4..03f69ff0 100644 --- a/cmd/genbindings/emitgo.go +++ b/cmd/genbindings/emitgo.go @@ -862,7 +862,7 @@ import "C" ret.WriteString(`var outptr_` + cabiClassName(c.ClassName) + ` *C.` + goClassName + " = nil\n") outptrs = append(outptrs, "outptr_"+cabiClassName(c.ClassName)) for _, baseClass := range c.AllInherits() { - ret.WriteString(`var outptr_` + cabiClassName(baseClass) + ` *C.` + baseClass + " = nil\n") + ret.WriteString(`var outptr_` + cabiClassName(baseClass) + ` *C.` + cabiClassName(baseClass) + " = nil\n") outptrs = append(outptrs, "outptr_"+cabiClassName(baseClass)) }