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 12
12
13
13
import PackageDescription
14
14
15
- let targets : [ PackageDescription . Target ] = [
15
+ var windowsPlatform : [ Platform ] = [ ]
16
+ #if os(Windows)
17
+ windowsPlatform. append ( . windows)
18
+ #endif
19
+
20
+ let targets : [ Target ] = [
16
21
. target(
17
22
name: " SystemPackage " ,
18
23
dependencies: [ " CSystem " ] ,
19
24
path: " Sources/System " ,
25
+ cSettings: [
26
+ . define( " _CRT_SECURE_NO_WARNINGS " , . when( platforms: windowsPlatform) ) ,
27
+ ] ,
20
28
swiftSettings: [
21
29
. define( " SYSTEM_PACKAGE " ) ,
22
30
. 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 {
146
146
147
147
private func mockImpl(
148
148
name: String ,
149
- path: UnsafePointer < CChar > ? ,
149
+ path: UnsafePointer < CInterop . PlatformChar > ? ,
150
150
_ args: [ AnyHashable ]
151
151
) -> CInt {
152
152
precondition ( mockingEnabled)
@@ -177,18 +177,18 @@ private func mockImpl(
177
177
}
178
178
179
179
internal func _mock(
180
- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
180
+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
181
181
) -> CInt {
182
182
return mockImpl ( name: name, path: path, args)
183
183
}
184
184
internal func _mockInt(
185
- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
185
+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
186
186
) -> Int {
187
187
Int ( mockImpl ( name: name, path: path, args) )
188
188
}
189
189
190
190
internal func _mockOffT(
191
- name: String = #function, path: UnsafePointer < CChar > ? = nil , _ args: AnyHashable ...
191
+ name: String = #function, path: UnsafePointer < CInterop . PlatformChar > ? = nil , _ args: AnyHashable ...
192
192
) -> _COffT {
193
193
_COffT ( mockImpl ( name: name, path: path, args) )
194
194
}
You can’t perform that action at this time.
0 commit comments