From 81dd216f13acf4e732e287639837872762ce718d Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 4 Jan 2025 12:46:43 +1300 Subject: [PATCH] genbindings: add qfloat16 exceptions --- cmd/genbindings/config-allowlist.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/genbindings/config-allowlist.go b/cmd/genbindings/config-allowlist.go index 53d48d35..3b07a6db 100644 --- a/cmd/genbindings/config-allowlist.go +++ b/cmd/genbindings/config-allowlist.go @@ -293,6 +293,14 @@ func AllowMethod(className string, mm CppMethod) error { return ErrTooComplex } + if className == "qfloat16" && mm.MethodName == "operator float" { + // Present in Qt 5 and Qt 6.4, but in 6.5++ the declaration is conditional on QFLOAT16_IS_NATIVE + // In that case it becomes `operator std::float16_t` or `operator _Float16` depending on your + // compiler + // A proper fix here would be to reproject qfloat16 as std::float16_t (?) in all cases + return ErrTooComplex + } + return nil // OK, allow }