From 6cb0296e6d6e564d7bf2902f41b90ca34b6774c8 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 5 Apr 2025 21:18:37 +1300 Subject: [PATCH] genbindings: move exception from clang2il into standard config-allowlist --- cmd/genbindings/clang2il.go | 6 ------ cmd/genbindings/config-allowlist.go | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index 2c734b3f..3727d4b7 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -788,12 +788,6 @@ func parseTypeString(typeString string) (CppParameter, []CppParameter, bool, err returnType := parseSingleTypeString(strings.TrimSpace(typeString[0:opos])) - // Skip functions that return ints-by-reference since the ergonomics don't - // go through the binding - if returnType.IntType() && returnType.ByRef { - return CppParameter{}, nil, false, ErrTooComplex // e.g. QSize::rheight() - } - inner := typeString[opos+1 : epos] // Should be no more brackets diff --git a/cmd/genbindings/config-allowlist.go b/cmd/genbindings/config-allowlist.go index 60fce8f7..157c8c43 100644 --- a/cmd/genbindings/config-allowlist.go +++ b/cmd/genbindings/config-allowlist.go @@ -347,6 +347,12 @@ func AllowMethod(className string, mm CppMethod) error { return ErrTooComplex } + // Skip functions that return ints-by-reference since the ergonomics don't + // go through the binding + if mm.ReturnType.IntType() && mm.ReturnType.ByRef { + return ErrTooComplex // e.g. QSize::rheight() + } + return nil // OK, allow }