Skip to content

Commit a04664b

Browse files
authored
Merge pull request #84747 from hnrklssn/swiftify-import-android-ndk
[Swiftify] Support std::span in Android NDK
2 parents e0dc53b + fa252fd commit a04664b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,11 @@ func isRawPointerType(text: String) -> Bool {
262262

263263
// Remove std. or std.__1. prefix
264264
func getUnqualifiedStdName(_ type: String) -> String? {
265-
if type.hasPrefix("std.") {
266-
var ty = type.dropFirst(4)
267-
if ty.hasPrefix("__1.") {
268-
ty = ty.dropFirst(4)
265+
let prefixes = ["std.__1.", "std.__ndk1.", "std."]
266+
for prefix in prefixes {
267+
if type.hasPrefix(prefix) {
268+
return String(type.dropFirst(prefix.count))
269269
}
270-
return String(ty)
271270
}
272271
return nil
273272
}

0 commit comments

Comments
 (0)