mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58: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"
|
||||
case "qfloat16":
|
||||
ret = "_Float16" // No idea where this typedef comes from, but it exists
|
||||
case "qsizetype":
|
||||
ret = "size_t"
|
||||
case "qreal":
|
||||
ret = "double"
|
||||
case "qintptr", "QIntegerForSizeof<void *>::Signed":
|
||||
ret = "intptr_t"
|
||||
case "quintptr", "uintptr", "QIntegerForSizeof<void *>::Unsigned":
|
||||
ret = "uintptr_t"
|
||||
case "qptrdiff":
|
||||
case "qsizetype", "qptrdiff", "QIntegerForSizeof<std::size_t>::Signed":
|
||||
ret = "ptrdiff_t"
|
||||
}
|
||||
|
||||
|
@ -80,12 +80,19 @@ func (p CppParameter) RenderTypeGo() string {
|
||||
ret += "float32"
|
||||
case "double", "qreal":
|
||||
ret += "float64"
|
||||
case "qsizetype", "size_t", "qptrdiff", "ptrdiff_t":
|
||||
case "size_t": // size_t is unsigned
|
||||
if C.sizeof_size_t == 4 {
|
||||
ret += "uint32"
|
||||
} else {
|
||||
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":
|
||||
ret += "uintptr"
|
||||
default:
|
||||
|
@ -160,6 +160,7 @@ func (p CppParameter) IntType() bool {
|
||||
"qsizetype", "size_t",
|
||||
"QIntegerForSizeof<void *>::Unsigned",
|
||||
"QIntegerForSizeof<void *>::Signed",
|
||||
"QIntegerForSizeof<std::size_t>::Signed",
|
||||
"qptrdiff", "ptrdiff_t",
|
||||
"double", "float", "qreal":
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user