mirror of
https://github.com/apple/swift-system
synced 2026-11-28 05:14:33 +00:00
Emit withPlatformString as an availability workaround for open
This commit is contained in:
1 parent
2ac0cdc24b
commit
8031239cef
1 file changed
+7
-2
@@ -32,10 +32,15 @@ extension FilePath {
|
||||
/// The pointer passed as an argument to `body` is valid
|
||||
/// only during the execution of this method.
|
||||
/// Don't try to store the pointer for later use.
|
||||
@_alwaysEmitIntoClient
|
||||
public func withPlatformString<Result>(
|
||||
_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result
|
||||
) rethrows -> Result {
|
||||
try _withPlatformString(body)
|
||||
#if !os(Windows)
|
||||
return try withCString(body)
|
||||
#else
|
||||
return try _withPlatformString(body)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,7 +417,7 @@ extension FilePath {
|
||||
#if os(Windows)
|
||||
fatalError("FilePath.withCString() unsupported on Windows ")
|
||||
#else
|
||||
return try withPlatformString(body)
|
||||
return try _withPlatformString(body)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user