[Swiftify] Support std::span in Android NDK

The Android NDK uses `std.__ndk.span` rather than `std.__1.span`.
This commit is contained in:
Henrik G. Olsson
2025-10-07 13:50:09 -07:00
parent 4f254950c1
commit fa252fd5b9

View File

@@ -262,12 +262,11 @@ func isRawPointerType(text: String) -> Bool {
// Remove std. or std.__1. prefix
func getUnqualifiedStdName(_ type: String) -> String? {
if type.hasPrefix("std.") {
var ty = type.dropFirst(4)
if ty.hasPrefix("__1.") {
ty = ty.dropFirst(4)
let prefixes = ["std.__1.", "std.__ndk1.", "std."]
for prefix in prefixes {
if type.hasPrefix(prefix) {
return String(type.dropFirst(prefix.count))
}
return String(ty)
}
return nil
}