Skip to content

Commit 603718e

Browse files
authored
FilePath: enable building on Windows (#41)
When building on Windows, we rely on the `withPlatformString` to convert the strings to the native platform encoding (UTF-16). The public `FilePath.withPlatformString` is marked as `@_alwaysEmitIntoClient` and references the `_withPlatformString` which is marked as `internal`. Annotate the function as `@usableFromInline` to enable the inlined method to reference this function.
1 parent 65a906b commit 603718e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/System/FilePath/FilePathComponents.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ extension FilePath.Root: _PathSlice {
190190
}
191191
}
192192
extension FilePath: _PlatformStringable {
193+
@usableFromInline
193194
func _withPlatformString<Result>(_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result) rethrows -> Result {
194195
try _storage.withPlatformString(body)
195196
}

0 commit comments

Comments
 (0)