Skip to content

Commit 36c2e4c

Browse files
committed
[Backtracing] Fix OS conditionals so iOS builds work.
Some of the `TARGET` and `os()` conditionals needed to be updated. rdar://104336548
1 parent fb830e0 commit 36c2e4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: stdlib/public/Backtracing/Context.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ extension arm_gprs {
831831

832832
// .. Darwin specifics .........................................................
833833

834-
#if os(macOS)
834+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
835835
private func mach_thread_get_state<T>(_ thread: thread_t,
836836
_ flavor: CInt,
837837
_ result: inout T) -> kern_return_t {

Diff for: stdlib/public/SwiftShims/swift/shims/_SwiftBacktracing.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <TargetConditionals.h>
2424
#endif
2525

26-
#if TARGET_OS_OSX
26+
#if TARGET_OS_OSX || TARGET_OS_IPHONE
2727
#include <mach/machine.h>
2828
#include <mach/task.h>
2929

@@ -76,7 +76,7 @@ struct arm_gprs {
7676

7777
// .. Darwin specifics .........................................................
7878

79-
#if TARGET_OS_OSX
79+
#if TARGET_OS_OSX || TARGET_OS_IPHONE
8080

8181
/* Darwin thread states. We can't import these from the system header because
8282
it uses all kinds of macros and the Swift importer can't cope with that.
@@ -258,7 +258,7 @@ enum {
258258
kCRSanitizePathKeepFile = 0x100 << 1,
259259
};
260260

261-
#endif // TARGET_OS_OSX
261+
#endif // TARGET_OS_OSX || TARGET_OS_IPHONE
262262

263263
#ifdef __cplusplus
264264
} // extern "C"

0 commit comments

Comments
 (0)