diff --git a/cmd/genbindings/emitgo.go b/cmd/genbindings/emitgo.go index b6c4944b..7163c040 100644 --- a/cmd/genbindings/emitgo.go +++ b/cmd/genbindings/emitgo.go @@ -6,6 +6,7 @@ import ( "log" "sort" "strings" + "unsafe" ) func goReservedWord(s string) bool { @@ -86,6 +87,13 @@ func (p CppParameter) RenderTypeGo() string { } else { ret += "uint64" } + case "qintptr": + var ptr *int + if unsafe.Sizeof(ptr) == 8 { + ret += "uint64" + } else { + ret += "uint32" + } default: // Do not transform this type ret += p.ParameterType diff --git a/cmd/genbindings/intermediate.go b/cmd/genbindings/intermediate.go index a0a764fc..79ee80a0 100644 --- a/cmd/genbindings/intermediate.go +++ b/cmd/genbindings/intermediate.go @@ -48,6 +48,7 @@ func (p CppParameter) IntType() bool { "long", "unsigned long", "ulong", "qint32", "quint32", "longlong", "ulonglong", "qlonglong", "qulonglong", "qint64", "quint64", "int64_t", "uint64_t", "long long", "unsigned long long", "QRgb", // unsigned int + "qintptr", "double", "float", "qreal": return true default: