Skip to content

Commit 88cb1a4

Browse files
authored
Ensure the ObjectiveC module is visible to Discovery.swift (#933)
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. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 0da75fa commit 88cb1a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Testing/Discovery+Platform.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
//
1010

1111
internal import _TestingInternals
12+
#if _runtime(_ObjC)
13+
private import ObjectiveC
14+
#endif
1215

1316
/// A structure describing the bounds of a Swift metadata section.
1417
struct SectionBounds: Sendable {

0 commit comments

Comments
 (0)