Skip to content

Commit

Permalink
Merge pull request #73 from euanh/do-not-build-demangle-after-5.9
Browse files Browse the repository at this point in the history
Do not build Demangle on Swift 5.9 or above
  • Loading branch information
FranzBusch committed Jun 17, 2024
2 parents 525d450 + d4f33e7 commit 7277ee0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Sources/Backtrace/Demangle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
//
//===----------------------------------------------------------------------===//

// Swift 5.9 has its own built-in backtracing support in the runtime;
// we don't want to activate this library if we're using 5.9 or above.
#if !(swift(>=5.9) && !os(Windows))

#if os(Linux)
import Glibc
#elseif os(Windows)
Expand Down Expand Up @@ -55,3 +59,5 @@ internal func _stdlib_demangleName(_ mangledName: String) -> String {
}
}
#endif

#endif
4 changes: 3 additions & 1 deletion Sources/Sample/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import Backtrace
#if canImport(Darwin)
import Darwin
#elseif os(Linux)
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#endif

#if swift(<5.9) || os(Windows)
Expand Down

0 comments on commit 7277ee0

Please sign in to comment.