mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 20:58:15 +00:00
#alias type declarations; core library additions; _global import name for the global scope
This commit is contained in:
+5
-5
@@ -14,9 +14,9 @@ new_c_string :: proc(s: string) -> ^u8 {
|
||||
return &c[0];
|
||||
}
|
||||
|
||||
to_odin_string :: proc(c: ^u8) -> string {
|
||||
if c == nil do return "";
|
||||
len := 0;
|
||||
for (c+len)^ != 0 do len+=1;
|
||||
return string(mem.slice_ptr(c, len));
|
||||
to_odin_string :: proc(str: ^u8) -> string {
|
||||
if str == nil do return "";
|
||||
end := str;
|
||||
for end^ != 0 do end+=1;
|
||||
return string(mem.slice_ptr(str, end-str));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user