deprecated attribute for procedure declarations

This commit is contained in:
gingerBill
2018-03-03 11:16:48 +00:00
parent 08c87e57f8
commit 9274f29ca9
10 changed files with 89 additions and 24 deletions
+1
View File
@@ -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
View File
@@ -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);
}