| ... | @@ -107,7 +107,7 @@ pub const OutStream = struct { | ... | @@ -107,7 +107,7 @@ pub const OutStream = struct { |
| 107 | } else if (is_windows) { | 107 | } else if (is_windows) { |
| 108 | @compileError("TODO: windows OutStream.openMode"); | 108 | @compileError("TODO: windows OutStream.openMode"); |
| 109 | } else { | 109 | } else { |
| 110 | @compileError("Unsupported OS"); | 110 | unreachable; |
| 111 | } | 111 | } |
| 112 | | 112 | |
| 113 | } | 113 | } |
| ... | @@ -174,8 +174,14 @@ pub const OutStream = struct { | ... | @@ -174,8 +174,14 @@ pub const OutStream = struct { |
| 174 | } | 174 | } |
| 175 | | 175 | |
| 176 | pub fn close(self: &OutStream) { | 176 | pub fn close(self: &OutStream) { |
| 177 | assert(self.index == 0); | 177 | assert(self.index == 0); // unflushed buffer |
| 178 | os.posixClose(self.fd); | 178 | if (is_posix) { |
| | 179 | os.posixClose(self.fd); |
| | 180 | } else if (is_windows) { |
| | 181 | os.windowsClose(%%self.getHandle()); |
| | 182 | } else { |
| | 183 | unreachable; |
| | 184 | } |
| 179 | } | 185 | } |
| 180 | | 186 | |
| 181 | pub fn isTty(self: &OutStream) -> %bool { | 187 | pub fn isTty(self: &OutStream) -> %bool { |
| ... | @@ -188,7 +194,7 @@ pub const OutStream = struct { | ... | @@ -188,7 +194,7 @@ pub const OutStream = struct { |
| 188 | } else if (is_windows) { | 194 | } else if (is_windows) { |
| 189 | return os.windowsIsTty(%return self.getHandle()); | 195 | return os.windowsIsTty(%return self.getHandle()); |
| 190 | } else { | 196 | } else { |
| 191 | @compileError("Unsupported OS"); | 197 | unreachable; |
| 192 | } | 198 | } |
| 193 | } | 199 | } |
| 194 | | 200 | |