diff --git a/Sources/System/FilePath/FilePathString.swift b/Sources/System/FilePath/FilePathString.swift index 842367c..9f43a9c 100644 --- a/Sources/System/FilePath/FilePathString.swift +++ b/Sources/System/FilePath/FilePathString.swift @@ -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( _ body: (UnsafePointer) 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 } }