Added Windows support for the hello example
All checks were successful
/ test (push) Successful in 16s

This commit is contained in:
Eduard Urbach 2025-07-02 21:56:20 +02:00
parent e833268061
commit 47b4b1f1dd
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
7 changed files with 92 additions and 55 deletions

View file

@ -1,10 +1,12 @@
write(_ string) -> (written int) {
return 0
write(buffer string) -> (written int) {
stdout := kernel32.GetStdHandle(-11)
kernel32.WriteConsoleA(stdout, buffer.ptr, buffer.len, 0)
return buffer.len
}
extern {
kernel32 {
GetStdHandle(handle int64) -> int64
WriteConsoleA(fd int64, buffer *byte, length uint32, written *uint32) -> bool
GetStdHandle(device int64) -> (handle int64)
WriteConsoleA(fd int64, buffer *byte, length uint32, written *uint32) -> (success bool)
}
}