Add -disallow-rtti

This commit is contained in:
gingerBill
2022-02-28 13:35:29 +00:00
parent a7ae197a55
commit 01162e08b5
3 changed files with 172 additions and 141 deletions
+12 -4
View File
@@ -160,11 +160,19 @@ print_caller_location :: proc "contextless" (using loc: Source_Code_Location) {
}
}
print_typeid :: proc "contextless" (id: typeid) {
if id == nil {
print_string("nil")
when ODIN_DISALLOW_RTTI {
if id == nil {
print_string("nil")
} else {
print_string("<unknown type>")
}
} else {
ti := type_info_of(id)
print_type(ti)
if id == nil {
print_string("nil")
} else {
ti := type_info_of(id)
print_type(ti)
}
}
}
print_type :: proc "contextless" (ti: ^Type_Info) {