mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18:37 +00:00
genbindings/ints: ssize_t support
This commit is contained in:
parent
6eb60232a9
commit
60600530c6
@ -51,15 +51,13 @@ func (p CppParameter) RenderTypeCabi() string {
|
|||||||
ret = "uint64_t"
|
ret = "uint64_t"
|
||||||
case "qfloat16":
|
case "qfloat16":
|
||||||
ret = "_Float16" // No idea where this typedef comes from, but it exists
|
ret = "_Float16" // No idea where this typedef comes from, but it exists
|
||||||
case "qsizetype":
|
|
||||||
ret = "size_t"
|
|
||||||
case "qreal":
|
case "qreal":
|
||||||
ret = "double"
|
ret = "double"
|
||||||
case "qintptr", "QIntegerForSizeof<void *>::Signed":
|
case "qintptr", "QIntegerForSizeof<void *>::Signed":
|
||||||
ret = "intptr_t"
|
ret = "intptr_t"
|
||||||
case "quintptr", "uintptr", "QIntegerForSizeof<void *>::Unsigned":
|
case "quintptr", "uintptr", "QIntegerForSizeof<void *>::Unsigned":
|
||||||
ret = "uintptr_t"
|
ret = "uintptr_t"
|
||||||
case "qptrdiff":
|
case "qsizetype", "qptrdiff", "QIntegerForSizeof<std::size_t>::Signed":
|
||||||
ret = "ptrdiff_t"
|
ret = "ptrdiff_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,12 +80,19 @@ func (p CppParameter) RenderTypeGo() string {
|
|||||||
ret += "float32"
|
ret += "float32"
|
||||||
case "double", "qreal":
|
case "double", "qreal":
|
||||||
ret += "float64"
|
ret += "float64"
|
||||||
case "qsizetype", "size_t", "qptrdiff", "ptrdiff_t":
|
case "size_t": // size_t is unsigned
|
||||||
if C.sizeof_size_t == 4 {
|
if C.sizeof_size_t == 4 {
|
||||||
ret += "uint32"
|
ret += "uint32"
|
||||||
} else {
|
} else {
|
||||||
ret += "uint64"
|
ret += "uint64"
|
||||||
}
|
}
|
||||||
|
case "qsizetype", "QIntegerForSizeof<std::size_t>::Signed", "qptrdiff", "ptrdiff_t": // all signed
|
||||||
|
if C.sizeof_size_t == 4 {
|
||||||
|
ret += "int32"
|
||||||
|
} else {
|
||||||
|
ret += "int64"
|
||||||
|
}
|
||||||
|
|
||||||
case "qintptr", "uintptr_t", "intptr_t", "quintptr", "QIntegerForSizeof<void *>::Unsigned", "QIntegerForSizeof<void *>::Signed":
|
case "qintptr", "uintptr_t", "intptr_t", "quintptr", "QIntegerForSizeof<void *>::Unsigned", "QIntegerForSizeof<void *>::Signed":
|
||||||
ret += "uintptr"
|
ret += "uintptr"
|
||||||
default:
|
default:
|
||||||
|
@ -160,6 +160,7 @@ func (p CppParameter) IntType() bool {
|
|||||||
"qsizetype", "size_t",
|
"qsizetype", "size_t",
|
||||||
"QIntegerForSizeof<void *>::Unsigned",
|
"QIntegerForSizeof<void *>::Unsigned",
|
||||||
"QIntegerForSizeof<void *>::Signed",
|
"QIntegerForSizeof<void *>::Signed",
|
||||||
|
"QIntegerForSizeof<std::size_t>::Signed",
|
||||||
"qptrdiff", "ptrdiff_t",
|
"qptrdiff", "ptrdiff_t",
|
||||||
"double", "float", "qreal":
|
"double", "float", "qreal":
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user