Internals: use CInterop.PlatformUnicodeString on Windows (#34)

The typealias was renamed but the Windows side of the build was not
updated.  This prevents building System on Windows.
This commit is contained in:
Saleem Abdulrasool authored and GitHub committed 2021-03-16 19:24:10 -06:00
1 parent b761517c25
commit 83875613ec
1 file changed
+3 -3
+3 -3
View File
@@ -85,7 +85,7 @@ extension String {
) rethrows -> Result {
// Need to #if because CChar may be signed
#if os(Windows)
return try withCString(encodedAs: _PlatformUnicodeEncoding.self, body)
return try withCString(encodedAs: CInterop.PlatformUnicodeEncoding.self, body)
#else
return try withCString(body)
#endif
@@ -96,7 +96,7 @@ extension String {
#if os(Windows)
guard let strRes = String.decodeCString(
platformString,
as: _PlatformUnicodeEncoding.self,
as: CInterop.PlatformUnicodeEncoding.self,
repairingInvalidCodeUnits: false
) else { return nil }
assert(strRes.repairsMade == false)
@@ -115,7 +115,7 @@ extension String {
#if os(Windows)
let strRes = String.decodeCString(
platformString,
as: _PlatformUnicodeEncoding.self,
as: CInterop.PlatformUnicodeEncoding.self,
repairingInvalidCodeUnits: true)
self = strRes!.result
return