Reimplement the Windows OS dependencies in package runtime

This commit is contained in:
gingerBill
2020-10-01 10:57:02 +01:00
parent 9513cf1ac6
commit 252a864308
6 changed files with 214 additions and 246 deletions
+1 -19
View File
@@ -1,21 +1,3 @@
//+build !freestanding
package runtime
import "core:os"
_OS_Errno :: distinct int;
_OS_Handle :: os.Handle;
os_stderr :: proc "contextless" () -> _OS_Handle {
return os.stderr;
}
// TODO(bill): reimplement `os.write`
os_write :: proc(fd: _OS_Handle, data: []byte) -> (int, _OS_Errno) {
n, err := os.write(fd, data);
return int(n), _OS_Errno(err);
}
current_thread_id :: proc "contextless" () -> int {
return os.current_thread_id();
}
_OS_Errno :: distinct int;