Skip to content

Commit 82fdf9a

Browse files
committed
[Reflection] Include TargetConditionals.h for WatchOS detection, not Availability.h.
While we're in there, make SwiftReflectionTest's debugLog function take an @autoclosure so we don't waste a ton of time constructing log messages that are never logged.
1 parent bbc0396 commit 82fdf9a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/SwiftRemoteMirror/SwiftRemoteMirrorTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" {
2828
// compatibility. Everywhere else, they are 64-bit so 32-bit processes can
2929
// potentially read from 64-bit processes.
3030
#if defined(__APPLE__) && defined(__MACH__)
31-
#include <Availability.h>
31+
#include <TargetConditionals.h>
3232
#if TARGET_OS_WATCH
3333
#define SWIFT_REFLECTION_NATIVE_POINTERS 1
3434
#endif

stdlib/private/SwiftReflectionTest/SwiftReflectionTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ let RequestStringLength = "l"
3131
let RequestDone = "d"
3232
let RequestPointerSize = "p"
3333

34-
internal func debugLog(_ message: String) {
34+
internal func debugLog(_ message: @autoclosure () -> String) {
3535
#if DEBUG_LOG
36-
fputs("Child: \(message)\n", stderr)
36+
fputs("Child: \(message())\n", stderr)
3737
fflush(stderr)
3838
#endif
3939
}

0 commit comments

Comments
 (0)