mirror of
https://github.com/mappu/miqt.git
synced 2025-02-02 03:20:25 +00:00
genbindings: fixes for qintptr
This commit is contained in:
parent
33b26204f8
commit
b3d55cc17f
@ -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
|
||||||
|
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user