ams: revamp assertion system

This commit is contained in:
Michael Scire
2020-02-22 23:05:14 -08:00
parent 9572fb2ce3
commit 40400aee1f
168 changed files with 1014 additions and 696 deletions

View File

@@ -21,12 +21,12 @@ namespace ams::pm::bm {
/* Both functions should be weakly linked, so that they can be overridden by ams::boot2 as needed. */
BootMode WEAK_SYMBOL GetBootMode() {
PmBootMode boot_mode = PmBootMode_Normal;
R_ASSERT(pmbmGetBootMode(&boot_mode));
R_ABORT_UNLESS(pmbmGetBootMode(&boot_mode));
return static_cast<BootMode>(boot_mode);
}
void WEAK_SYMBOL SetMaintenanceBoot() {
R_ASSERT(pmbmSetMaintenanceBoot());
R_ABORT_UNLESS(pmbmSetMaintenanceBoot());
}
}

View File

@@ -69,7 +69,7 @@ namespace ams::pm::info {
bool HasLaunchedProgram(ncm::ProgramId program_id) {
bool has_launched = false;
R_ASSERT(HasLaunchedProgram(&has_launched, program_id));
R_ABORT_UNLESS(HasLaunchedProgram(&has_launched, program_id));
return has_launched;
}