genbindings: allow void* as unsafe.Pointer

This commit is contained in:
mappu 2024-09-20 19:30:32 +12:00
parent 172b6e850e
commit aadc37eb2d
2 changed files with 4 additions and 4 deletions

View File

@ -35,6 +35,10 @@ func (p CppParameter) RenderTypeGo() string {
return "map[" + t.RenderTypeGo() + "]struct{}" return "map[" + t.RenderTypeGo() + "]struct{}"
} }
if p.ParameterType == "void" && p.Pointer {
return "unsafe.Pointer"
}
ret := "" ret := ""
if p.ByRef || p.Pointer { if p.ByRef || p.Pointer {
ret += "*" ret += "*"

View File

@ -236,10 +236,6 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
return ErrTooComplex return ErrTooComplex
} }
if p.ParameterType == "void" && p.Pointer {
return ErrTooComplex // e.g. qobjectdefs.h QMetaObject->InvokeOnGadget(). TODO represent as uintptr
}
// Should be OK // Should be OK
return nil return nil
} }