mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 11:50:07 +00:00
deprecated attribute for procedure declarations
This commit is contained in:
@@ -877,6 +877,7 @@ __cstring_len :: proc "contextless" (s: cstring) -> int {
|
||||
}
|
||||
|
||||
__cstring_to_string :: proc "contextless" (s: cstring) -> string {
|
||||
if s == nil do return "";
|
||||
ptr := (^byte)(s);
|
||||
n := __cstring_len(s);
|
||||
return transmute(string)raw.String{ptr, n};
|
||||
|
||||
+1
-1
@@ -15,8 +15,8 @@ new_cstring :: proc(s: string) -> cstring {
|
||||
return cstring(&c[0]);
|
||||
}
|
||||
|
||||
@(deprecated="Please use a standard cast for cstring to string")
|
||||
to_odin_string :: proc(str: cstring) -> string {
|
||||
if str == nil do return "";
|
||||
return string(str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user