File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1212
1313import PackageDescription
1414
15- let targets : [ PackageDescription . Target ] = [
15+ var windowsPlatform : [ Platform ] = [ ]
16+ #if os(Windows)
17+ windowsPlatform. append ( . windows)
18+ #endif
19+
20+ let targets : [ Target ] = [
1621 . target(
1722 name: " SystemPackage " ,
1823 dependencies: [ " CSystem " ] ,
1924 path: " Sources/System " ,
25+ cSettings: [
26+ . define( " _CRT_SECURE_NO_WARNINGS " , . when( platforms: windowsPlatform) ) ,
27+ ] ,
2028 swiftSettings: [
2129 . define( " SYSTEM_PACKAGE " ) ,
2230 . define( " ENABLE_MOCKING " , . when( configuration: . debug) )
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ private func originalSyscallName(_ function: String) -> String {
146146
147147private func mockImpl(
148148 name: String ,
149- path: UnsafePointer < CChar > ? ,
149+ path: UnsafePointer < CInterop . PlatformChar > ? ,
150150 _ args: [ AnyHashable ]
151151) -> CInt {
152152 precondition ( mockingEnabled)
@@ -177,18 +177,18 @@ private func mockImpl(
177177}
178178
179179internal func _mock(
180- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
180+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
181181) -> CInt {
182182 return mockImpl ( name: name, path: path, args)
183183}
184184internal func _mockInt(
185- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
185+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
186186) -> Int {
187187 Int ( mockImpl ( name: name, path: path, args) )
188188}
189189
190190internal func _mockOffT(
191- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
191+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
192192) -> _COffT {
193193 _COffT ( mockImpl ( name: name, path: path, args) )
194194}
You can’t perform that action at this time.
0 commit comments