From d02b7fbf76ba77d9511f68a56ea07700b97c4aae Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Tue, 28 Jan 2025 12:57:41 -0500 Subject: [PATCH] Ensure the `ObjectiveC` module is visible to Discovery.swift With recent work to rewrite our C++ code in Swift, we've wound up not including any Objective-C headers in `_TestingInternals`, but they are included transitively on some Apple platforms including macOS. Ensure the `ObjectiveC` module is included in Discovery.swift when available so that platforms that don't transitively include the libobjc headers can see (in particular) the `objc_addLoadImageFunc()` function. --- Sources/Testing/Discovery+Platform.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Testing/Discovery+Platform.swift b/Sources/Testing/Discovery+Platform.swift index a42800577..3f66b62ad 100644 --- a/Sources/Testing/Discovery+Platform.swift +++ b/Sources/Testing/Discovery+Platform.swift @@ -9,6 +9,9 @@ // internal import _TestingInternals +#if _runtime(_ObjC) +private import ObjectiveC +#endif /// A structure describing the bounds of a Swift metadata section. struct SectionBounds: Sendable {