genbindings: fixes for qintptr

This commit is contained in:
mappu 2024-08-18 19:01:36 +12:00
parent 33b26204f8
commit b3d55cc17f
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"log" "log"
"sort" "sort"
"strings" "strings"
"unsafe"
) )
func goReservedWord(s string) bool { func goReservedWord(s string) bool {
@ -86,6 +87,13 @@ func (p CppParameter) RenderTypeGo() string {
} else { } else {
ret += "uint64" ret += "uint64"
} }
case "qintptr":
var ptr *int
if unsafe.Sizeof(ptr) == 8 {
ret += "uint64"
} else {
ret += "uint32"
}
default: default:
// Do not transform this type // Do not transform this type
ret += p.ParameterType ret += p.ParameterType

View File

@ -48,6 +48,7 @@ func (p CppParameter) IntType() bool {
"long", "unsigned long", "ulong", "qint32", "quint32", "long", "unsigned long", "ulong", "qint32", "quint32",
"longlong", "ulonglong", "qlonglong", "qulonglong", "qint64", "quint64", "int64_t", "uint64_t", "long long", "unsigned long long", "longlong", "ulonglong", "qlonglong", "qulonglong", "qint64", "quint64", "int64_t", "uint64_t", "long long", "unsigned long long",
"QRgb", // unsigned int "QRgb", // unsigned int
"qintptr",
"double", "float", "qreal": "double", "float", "qreal":
return true return true
default: default: