mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-01 17:51:48 -07:00
Add -disable-assert to disable the code generation of the built-in run-time 'assert' procedure
This commit is contained in:
@@ -710,6 +710,7 @@ void init_universal(void) {
|
||||
add_global_string_constant(str_lit("ODIN_VERSION"), bc->ODIN_VERSION);
|
||||
add_global_string_constant(str_lit("ODIN_ROOT"), bc->ODIN_ROOT);
|
||||
add_global_constant(str_lit("ODIN_DEBUG"), t_untyped_bool, exact_value_bool(bc->ODIN_DEBUG));
|
||||
add_global_constant(str_lit("ODIN_DISABLE_ASSERT"), t_untyped_bool, exact_value_bool(bc->ODIN_DISABLE_ASSERT));
|
||||
|
||||
|
||||
// Builtin Procedures
|
||||
@@ -2273,6 +2274,16 @@ DECL_ATTRIBUTE_PROC(proc_decl_attribute) {
|
||||
}
|
||||
ac->require_results = true;
|
||||
return true;
|
||||
} else if (name == "disabled") {
|
||||
ExactValue ev = check_decl_attribute_value(c, value);
|
||||
|
||||
if (ev.kind == ExactValue_Bool) {
|
||||
ac->has_disabled_proc = true;
|
||||
ac->disabled_proc = ev.value_bool;
|
||||
} else {
|
||||
error(elem, "Expected a boolean value for '%.*s'", LIT(name));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user