diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index 881a3e48..3a3f95b0 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -96,8 +96,8 @@ func parseHeader(topLevel []interface{}) (*CppParsedHeader, error) { if typ, ok := node["type"].(map[string]interface{}); ok { if qualType, ok := typ["qualType"].(string); ok { ret.Typedefs = append(ret.Typedefs, CppTypedef{ - Name: nodename, - Typedef: qualType, + Alias: nodename, + UnderlyingType: qualType, }) } } diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index ead75dd9..49706c93 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -239,6 +239,12 @@ func getReferencedTypes(src *CppParsedHeader) []string { } } + // Some types (e.g. QRgb) are found but are typedefs, not classes + for _, td := range src.Typedefs { + delete(foundTypes, td.Alias) + } + + // Convert to sorted list foundTypesList := make([]string, 0, len(foundTypes)) for ft := range foundTypes { if strings.HasPrefix(ft, "QList<") { diff --git a/cmd/genbindings/intermediate.go b/cmd/genbindings/intermediate.go index b59bfbb1..be0355df 100644 --- a/cmd/genbindings/intermediate.go +++ b/cmd/genbindings/intermediate.go @@ -109,8 +109,8 @@ type CppClass struct { } type CppTypedef struct { - Name string - Typedef string + Alias string + UnderlyingType string } type CppParsedHeader struct {