genbindings: remove special-case qreal handling

This commit is contained in:
mappu 2024-08-18 18:56:09 +12:00
parent d5eeb64c86
commit 6d09ef795b
3 changed files with 3 additions and 4 deletions

View File

@ -465,9 +465,6 @@ func parseSingleTypeString(p string) CppParameter {
insert.ByRef = true insert.ByRef = true
} else if tok == "*" { } else if tok == "*" {
insert.Pointer = true insert.Pointer = true
} else if tok == "qreal" {
// Transform typedef
insert.ParameterType += " double"
} else if tok == "WId" { } else if tok == "WId" {
// Transform typedef // Transform typedef
insert.ParameterType += " uintptr_t" insert.ParameterType += " uintptr_t"

View File

@ -35,6 +35,8 @@ func (p CppParameter) RenderTypeCpp() string {
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": case "qsizetype":
ret = "size_t" ret = "size_t"
case "qreal":
ret = "double"
case "qintptr": case "qintptr":
ret = "uintptr_t" ret = "uintptr_t"
case "QRgb": case "QRgb":

View File

@ -78,7 +78,7 @@ func (p CppParameter) RenderTypeGo() string {
ret += "uint64" ret += "uint64"
case "float": case "float":
ret += "float32" ret += "float32"
case "double": case "double", "qreal":
ret += "float64" ret += "float64"
case "qsizetype": case "qsizetype":
if C.sizeof_size_t == 4 { if C.sizeof_size_t == 4 {