mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-07 19:14:19 +00:00
Add runtime.print_strings
This commit is contained in:
@@ -42,6 +42,18 @@ print_string :: proc "contextless" (str: string) -> (int, _OS_Errno) {
|
||||
return os_write(transmute([]byte)str);
|
||||
}
|
||||
|
||||
print_strings :: proc "contextless" (args: ..string) -> (n: int, err: _OS_Errno) {
|
||||
for str in args {
|
||||
m: int;
|
||||
m, err = os_write(transmute([]byte)str);
|
||||
n += m;
|
||||
if err != nil {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
print_byte :: proc "contextless" (b: byte) -> (int, _OS_Errno) {
|
||||
return os_write([]byte{b});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user