|
| 1 | +#if canImport(System) && canImport(SystemPackage) |
| 2 | +import System |
| 3 | +import SystemPackage |
| 4 | + |
| 5 | +@available(System 0.0.2, *) |
| 6 | +extension SystemPackage.FilePath { |
| 7 | + @available(System 0.0.2, *) |
| 8 | + public init(converting path: System.FilePath) { |
| 9 | + self = path.withPlatformString(Self.init(platformString:)) |
| 10 | + } |
| 11 | +} |
| 12 | + |
| 13 | +@available(System 0.0.2, *) |
| 14 | +extension System.FilePath { |
| 15 | + @available(System 0.0.2, *) |
| 16 | + public init(converting path: SystemPackage.FilePath) { |
| 17 | + self = path.withPlatformString(Self.init(platformString:)) |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +@available(System 0.0.1, *) |
| 22 | +extension SystemPackage.FileDescriptor { |
| 23 | + @available(System 0.0.1, *) |
| 24 | + public init(converting descriptor: System.FileDescriptor) { |
| 25 | + self.init(rawValue: descriptor.rawValue) |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +@available(System 0.0.1, *) |
| 30 | +extension System.FileDescriptor { |
| 31 | + @available(System 0.0.1, *) |
| 32 | + public init(converting descriptor: SystemPackage.FileDescriptor) { |
| 33 | + self.init(rawValue: descriptor.rawValue) |
| 34 | + } |
| 35 | +} |
| 36 | +#endif // canImport(System) && canImport(SystemPackage) |
0 commit comments