Skip to content

Commit 70bc712

Browse files
author
Gleb Tarasov
committed
Add compile-time check for macho_arch_name_for_mach_header_reexported
1 parent 26b1906 commit 70bc712

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PerformanceSuite/Sources/HangInfo.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public struct HangInfo: Codable {
8080
/// because main binaries currently can have only arm64.
8181
/// System binaries can be arm64 or arm64e.
8282
private static let currentArchitecture: String? = {
83+
#if swift(>=5.9)
8384
if #available(iOS 16, *) {
8485
if let archName = macho_arch_name_for_mach_header_reexported() {
8586
return String(cString: archName)
@@ -90,6 +91,12 @@ public struct HangInfo: Codable {
9091
return String(cString: name)
9192
}
9293
}
94+
#else
95+
let info = NXGetLocalArchInfo()
96+
if let name = info?.pointee.name {
97+
return String(cString: name)
98+
}
99+
#endif
93100
return nil
94101
}()
95102

0 commit comments

Comments
 (0)