Add stubs for flush on platforms that didn't have it

This commit is contained in:
gingerBill
2024-08-04 15:07:24 +01:00
parent acb1ebddf6
commit bf948ab8ae
8 changed files with 38 additions and 6 deletions
+2 -6
View File
@@ -17,13 +17,9 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
os_err: Error
switch mode {
case .Close:
close(fd)
os_err = close(fd)
case .Flush:
when ODIN_OS == .Windows || ODIN_OS == .Darwin || ODIN_OS == .JS {
flush(fd)
} else {
// TOOD(bill): other operating systems
}
os_err = flush(fd)
case .Read:
n_int, os_err = read(fd, p)
n = i64(n_int)