genbindings/typedefs: refactor extract single method helper

This commit is contained in:
mappu 2024-11-15 14:23:41 +13:00
parent 0ffb24d11a
commit 6ae2235cb4

View File

@ -34,12 +34,7 @@ func applyTypedefs(p CppParameter) CppParameter {
return p
}
// astTransformTypedefs replaces the ParameterType with any known typedef value.
func astTransformTypedefs(parsed *CppParsedHeader) {
for i, c := range parsed.Classes {
for j, m := range c.Methods {
func applyTypedefs_Method(m *CppMethod) {
for k, p := range m.Parameters {
transformed := applyTypedefs(p)
@ -56,21 +51,22 @@ func astTransformTypedefs(parsed *CppParsedHeader) {
if LinuxWindowsCompatCheck(m.ReturnType) {
m.LinuxOnly = true
}
}
// astTransformTypedefs replaces the ParameterType with any known typedef value.
func astTransformTypedefs(parsed *CppParsedHeader) {
for i, c := range parsed.Classes {
for j, m := range c.Methods {
applyTypedefs_Method(&m)
c.Methods[j] = m
}
for j, m := range c.Ctors {
for k, p := range m.Parameters {
transformed := applyTypedefs(p)
m.Parameters[k] = transformed
if LinuxWindowsCompatCheck(transformed) {
m.LinuxOnly = true
}
}
applyTypedefs_Method(&m)
c.Ctors[j] = m
}
parsed.Classes[i] = c