Skip to content

Commit 0c38c92

Browse files
committed
Emit withPlatformString as an availability workaround for open
1 parent 2ac0cdc commit 0c38c92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/System/FilePath/FilePathString.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,15 @@ extension FilePath {
3232
/// The pointer passed as an argument to `body` is valid
3333
/// only during the execution of this method.
3434
/// Don't try to store the pointer for later use.
35+
@_alwaysEmitIntoClient
3536
public func withPlatformString<Result>(
3637
_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result
3738
) rethrows -> Result {
39+
#if !os(Windows)
40+
try withCString(body)
41+
#else
3842
try _withPlatformString(body)
43+
#endif
3944
}
4045
}
4146

0 commit comments

Comments
 (0)