Skip to content

Commit 6409804

Browse files
committed
Foundation: fix a couple of compile errors
FoundationErrors does not depend on NSSwiftRuntime and thus does not transitively get the WinSDK import when not building in whole program mode. Add an import to get a definition of `DWORD`. Remoe the `private(set)` from the computed `processIdentifier` property which is already readonly due to the definition of the computed property.
1 parent 3c2fc82 commit 6409804

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Foundation/FoundationErrors.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10+
#if os(Windows)
11+
import WinSDK
12+
#endif
13+
1014
/// File-system operation attempted on non-existent file.
1115
public var NSFileNoSuchFileError: Int { return CocoaError.Code.fileNoSuchFile.rawValue }
1216

Foundation/Process.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ open class Process: NSObject {
777777
// status
778778
#if os(Windows)
779779
open private(set) var processHandle: HANDLE = INVALID_HANDLE_VALUE
780-
open private(set) var processIdentifier: Int32 {
780+
open var processIdentifier: Int32 {
781781
return Int32(GetProcessId(processHandle))
782782
}
783783
open private(set) var isRunning: Bool = false

0 commit comments

Comments
 (0)