File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Sources/SwiftDocCUtilities/Utility Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
This source file is part of the Swift.org open source project
3
3
4
- Copyright (c) 2021 Apple Inc. and the Swift project authors
4
+ Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
5
5
Licensed under Apache License v2.0 with Runtime Library Exception
6
6
7
7
See https://swift.org/LICENSE.txt for license information
@@ -20,8 +20,10 @@ public struct Signal {
20
20
public static func on( _ signals: [ Int32 ] , callback: @convention ( c) @escaping ( Int32 ) -> Void ) {
21
21
var signalAction = sigaction ( )
22
22
23
- #if os(Linux)
24
- // This is where we get to use a triple underscore in a method name.
23
+ // Different libraries name the `sigaction` fields and handler type differently.
24
+ #if canImport(Musl)
25
+ signalAction. __sa_handler = unsafeBitCast ( callback, to: sigaction. __Unnamed_union___sa_handler. self)
26
+ #elseif os(Linux)
25
27
signalAction. __sigaction_handler = unsafeBitCast ( callback, to: sigaction. __Unnamed_union___sigaction_handler. self)
26
28
#elseif os(Android)
27
29
signalAction. sa_handler = callback
You can’t perform that action at this time.
0 commit comments