mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
typeid as keyword (ready to implement polymorphic name parameters)
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ ptr_to_bytes :: proc "contextless" (ptr: ^$T, len := 1) -> []byte {
|
||||
}
|
||||
|
||||
any_to_bytes :: proc "contextless" (val: any) -> []byte {
|
||||
ti := type_info_of(val.typeid);
|
||||
ti := type_info_of(val.id);
|
||||
size := ti != nil ? ti.size : 0;
|
||||
return transmute([]byte)Raw_Slice{val.data, size};
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package mem
|
||||
|
||||
Raw_Any :: struct {
|
||||
data: rawptr,
|
||||
typeid: typeid,
|
||||
data: rawptr,
|
||||
id: typeid,
|
||||
}
|
||||
|
||||
Raw_String :: struct {
|
||||
|
||||
Reference in New Issue
Block a user