@@ -66,6 +66,12 @@ public extension WritableByteStream {
6666// Public alias to the old name to not introduce API compatibility.
6767public typealias OutputByteStream = WritableByteStream
6868
69+ #if os(Android)
70+ public typealias FILEPointer = OpaquePointer
71+ #else
72+ public typealias FILEPointer = UnsafeMutablePointer < FILE >
73+ #endif
74+
6975extension WritableByteStream {
7076 /// Write a sequence of bytes to the buffer.
7177 public func write< S: Sequence > ( sequence: S ) where S. Iterator. Element == UInt8 {
@@ -670,7 +676,7 @@ public class FileOutputByteStream: _WritableByteStreamBase {
670676public final class LocalFileOutputByteStream : FileOutputByteStream {
671677
672678 /// The pointer to the file.
673- let filePointer : UnsafeMutablePointer < FILE >
679+ let filePointer : FILEPointer
674680
675681 /// Set to an error value if there were any IO error during writing.
676682 private var error : FileSystemError ?
@@ -682,7 +688,7 @@ public final class LocalFileOutputByteStream: FileOutputByteStream {
682688 private let path : AbsolutePath ?
683689
684690 /// 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 {
686692 self . filePointer = filePointer
687693 self . closeOnDeinit = closeOnDeinit
688694 self . path = nil
0 commit comments