This commit is contained in:
parent
f357285045
commit
0ece1b092e
23 changed files with 274 additions and 113 deletions
|
@ -1,12 +0,0 @@
|
|||
init() {
|
||||
main.main()
|
||||
exit()
|
||||
}
|
||||
|
||||
exit() {
|
||||
syscall(93, 0)
|
||||
}
|
||||
|
||||
crash() {
|
||||
syscall(93, 1)
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
init() {
|
||||
main.main()
|
||||
exit()
|
||||
}
|
||||
|
||||
exit() {
|
||||
syscall(60, 0)
|
||||
}
|
||||
|
||||
crash() {
|
||||
syscall(60, 1)
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
init() {
|
||||
main.main()
|
||||
exit()
|
||||
}
|
||||
|
||||
exit() {
|
||||
syscall(0x2000001, 0)
|
||||
}
|
||||
|
||||
crash() {
|
||||
syscall(0x2000001, 1)
|
||||
}
|
3
lib/os/os_linux_arm.q
Normal file
3
lib/os/os_linux_arm.q
Normal file
|
@ -0,0 +1,3 @@
|
|||
exit(code int) {
|
||||
syscall(93, code)
|
||||
}
|
3
lib/os/os_linux_x86.q
Normal file
3
lib/os/os_linux_x86.q
Normal file
|
@ -0,0 +1,3 @@
|
|||
exit(code int) {
|
||||
syscall(60, code)
|
||||
}
|
3
lib/os/os_mac.q
Normal file
3
lib/os/os_mac.q
Normal file
|
@ -0,0 +1,3 @@
|
|||
exit(code int) {
|
||||
syscall(0x2000001, code)
|
||||
}
|
9
lib/os/os_windows.q
Normal file
9
lib/os/os_windows.q
Normal file
|
@ -0,0 +1,9 @@
|
|||
exit(code int) {
|
||||
kernel32.ExitProcess(code)
|
||||
}
|
||||
|
||||
extern {
|
||||
kernel32 {
|
||||
ExitProcess(code uint)
|
||||
}
|
||||
}
|
10
lib/run/run_unix.q
Normal file
10
lib/run/run_unix.q
Normal file
|
@ -0,0 +1,10 @@
|
|||
import os
|
||||
|
||||
init() {
|
||||
main.main()
|
||||
os.exit(0)
|
||||
}
|
||||
|
||||
crash() {
|
||||
os.exit(1)
|
||||
}
|
|
@ -1,23 +1,20 @@
|
|||
import os
|
||||
|
||||
init() {
|
||||
utf8 := 65001
|
||||
kernel32.SetConsoleCP(utf8)
|
||||
kernel32.SetConsoleOutputCP(utf8)
|
||||
main.main()
|
||||
exit()
|
||||
}
|
||||
|
||||
exit() {
|
||||
kernel32.ExitProcess(0)
|
||||
os.exit(0)
|
||||
}
|
||||
|
||||
crash() {
|
||||
kernel32.ExitProcess(1)
|
||||
os.exit(1)
|
||||
}
|
||||
|
||||
extern {
|
||||
kernel32 {
|
||||
SetConsoleCP(cp uint)
|
||||
SetConsoleOutputCP(cp uint)
|
||||
ExitProcess(code uint)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue