Skip to content

Commit d00da02

Browse files
committed
dont do transparent on non-apple platforms
1 parent ec0626e commit d00da02

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ format:
3232
--in-place \
3333
--recursive \
3434
.
35+
test-linux:
36+
docker run \
37+
--rm \
38+
-v "$(PWD):$(PWD)" \
39+
-w "$(PWD)" \
40+
swift:5.10 \
41+
bash -c 'swift test'

Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ extension IssueReporter where Self == RuntimeWarningReporter {
1212
///
1313
/// If this issue reporter receives an expected issue, it will log an info-level message to the
1414
/// console, instead.
15+
#if canImport(Darwin)
1516
@_transparent
17+
#endif
1618
public static var runtimeWarning: Self { Self() }
1719
}
1820

@@ -23,10 +25,14 @@ extension IssueReporter where Self == RuntimeWarningReporter {
2325
public struct RuntimeWarningReporter: IssueReporter {
2426
#if canImport(os)
2527
@UncheckedSendable
28+
#if canImport(Darwin)
2629
@_transparent
30+
#endif
2731
@usableFromInline var dso: UnsafeRawPointer
2832

33+
#if canImport(Darwin)
2934
@_transparent
35+
#endif
3036
@usableFromInline
3137
init() {
3238
// NB: Xcode runtime warnings offer a much better experience than traditional assertions and
@@ -35,6 +41,7 @@ public struct RuntimeWarningReporter: IssueReporter {
3541
//
3642
// Feedback filed: https://gist.github.com/stephencelis/a8d06383ed6ccde3e5ef5d1b3ad52bbc
3743
let count = _dyld_image_count()
44+
self.dso = #dsohandle
3845
for i in 0..<count {
3946
if let name = _dyld_get_image_name(i) {
4047
let swiftString = String(cString: name)
@@ -46,7 +53,6 @@ public struct RuntimeWarningReporter: IssueReporter {
4653
}
4754
}
4855
}
49-
self.dso = #dsohandle
5056
}
5157
#endif
5258

0 commit comments

Comments
 (0)