Added Windows support for the hello example
All checks were successful
/ test (push) Successful in 16s
All checks were successful
/ test (push) Successful in 16s
This commit is contained in:
parent
e833268061
commit
47b4b1f1dd
7 changed files with 92 additions and 55 deletions
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue