@@ -66,6 +66,12 @@ public extension WritableByteStream {
66
66
// Public alias to the old name to not introduce API compatibility.
67
67
public typealias OutputByteStream = WritableByteStream
68
68
69
+ #if os(Android)
70
+ public typealias FILEPointer = OpaquePointer
71
+ #else
72
+ public typealias FILEPointer = UnsafeMutablePointer < FILE >
73
+ #endif
74
+
69
75
extension WritableByteStream {
70
76
/// Write a sequence of bytes to the buffer.
71
77
public func write< S: Sequence > ( sequence: S ) where S. Iterator. Element == UInt8 {
@@ -670,7 +676,7 @@ public class FileOutputByteStream: _WritableByteStreamBase {
670
676
public final class LocalFileOutputByteStream : FileOutputByteStream {
671
677
672
678
/// The pointer to the file.
673
- let filePointer : UnsafeMutablePointer < FILE >
679
+ let filePointer : FILEPointer
674
680
675
681
/// Set to an error value if there were any IO error during writing.
676
682
private var error : FileSystemError ?
@@ -682,7 +688,7 @@ public final class LocalFileOutputByteStream: FileOutputByteStream {
682
688
private let path : AbsolutePath ?
683
689
684
690
/// Instantiate using the file pointer.
685
- public init ( filePointer: UnsafeMutablePointer < FILE > , closeOnDeinit: Bool = true , buffered: Bool = true ) throws {
691
+ public init ( filePointer: FILEPointer , closeOnDeinit: Bool = true , buffered: Bool = true ) throws {
686
692
self . filePointer = filePointer
687
693
self . closeOnDeinit = closeOnDeinit
688
694
self . path = nil
0 commit comments