File tree 3 files changed +24
-2
lines changed
3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ fileprivate let _write = Glibc.write(_:_:_:)
24
24
fileprivate let _close = Glibc . close ( _: )
25
25
#endif
26
26
27
+ #if canImport(WinSDK)
28
+ // We used to get the copy that was re-exported by CoreFoundation
29
+ // but we want to explicitly depend on its types in this file,
30
+ // so we need to make sure Swift doesn't think it's @_implementationOnly.
31
+ import WinSDK
32
+ #endif
33
+
27
34
extension NSError {
28
35
internal var errnoIfAvailable : Int ? {
29
36
if domain == NSPOSIXErrorDomain {
Original file line number Diff line number Diff line change 13
13
import Darwin
14
14
#endif
15
15
16
+ #if canImport(WinSDK)
17
+ // We used to get the copy that was re-exported by CoreFoundation
18
+ // but we want to explicitly depend on its types in this file,
19
+ // so we need to make sure Swift doesn't think it's @_implementationOnly.
20
+ import WinSDK
21
+ #endif
22
+
16
23
extension Process {
17
24
public enum TerminationReason : Int {
18
25
case exit
Original file line number Diff line number Diff line change @@ -196,9 +196,17 @@ open class Thread : NSObject {
196
196
private var _thread : _swift_CFThreadRef ? = nil
197
197
198
198
#if os(Windows) && !CYGWIN
199
- internal var _attr : _CFThreadAttributes =
200
- _CFThreadAttributes ( dwSizeOfAttributes: DWORD ( MemoryLayout< _CFThreadAttributes> . size) ,
199
+ private class NonexportedAttrStorage {
200
+ var value = _CFThreadAttributes ( dwSizeOfAttributes: DWORD ( MemoryLayout< _CFThreadAttributes> . size) ,
201
201
dwThreadStackReservation: 0 )
202
+ }
203
+
204
+ private let _attrStorage = NonexportedAttrStorage ( )
205
+
206
+ internal var _attr : _CFThreadAttributes {
207
+ get { _attrStorage. value }
208
+ set { _attrStorage. value = newValue }
209
+ }
202
210
#elseif CYGWIN
203
211
internal var _attr : pthread_attr_t ? = nil
204
212
#else
You can’t perform that action at this time.
0 commit comments