genbindings: fix some cases of missing :: escaping

This commit is contained in:
mappu 2024-11-19 19:59:55 +13:00
parent 0884f371c1
commit 90de7178f2
2 changed files with 4 additions and 4 deletions

View File

@ -759,14 +759,14 @@ func emitParametersCabiConstructor(c *CppClass, ctor *CppMethod) string {
plist := slice_copy(ctor.Parameters) // semi-shallow copy plist := slice_copy(ctor.Parameters) // semi-shallow copy
plist = append(plist, CppParameter{ plist = append(plist, CppParameter{
ParameterName: cabiClassName("outptr_" + c.ClassName), ParameterName: cabiClassName("outptr_" + cabiClassName(c.ClassName)),
ParameterType: c.ClassName, ParameterType: c.ClassName,
Pointer: true, Pointer: true,
PointerCount: 2, PointerCount: 2,
}) })
for _, baseClass := range c.AllInherits() { for _, baseClass := range c.AllInherits() {
plist = append(plist, CppParameter{ plist = append(plist, CppParameter{
ParameterName: cabiClassName("outptr_" + baseClass), ParameterName: cabiClassName("outptr_" + cabiClassName(baseClass)),
ParameterType: baseClass, ParameterType: baseClass,
Pointer: true, Pointer: true,
PointerCount: 2, PointerCount: 2,
@ -986,7 +986,7 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
"\t*outptr_" + cabiClassName(c.ClassName) + " = ret;\n", // Original class name "\t*outptr_" + cabiClassName(c.ClassName) + " = ret;\n", // Original class name
) )
for _, baseClass := range c.AllInherits() { 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( ret.WriteString(

View File

@ -862,7 +862,7 @@ import "C"
ret.WriteString(`var outptr_` + cabiClassName(c.ClassName) + ` *C.` + goClassName + " = nil\n") ret.WriteString(`var outptr_` + cabiClassName(c.ClassName) + ` *C.` + goClassName + " = nil\n")
outptrs = append(outptrs, "outptr_"+cabiClassName(c.ClassName)) outptrs = append(outptrs, "outptr_"+cabiClassName(c.ClassName))
for _, baseClass := range c.AllInherits() { 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)) outptrs = append(outptrs, "outptr_"+cabiClassName(baseClass))
} }