mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-08-09 08:59:32 +02:00
result: always prefer diag::Abort to fatal
This commit is contained in:
parent
f7863af736
commit
7c377daaa4
@ -15,25 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
#include <stratosphere.hpp>
|
#include <stratosphere.hpp>
|
||||||
|
|
||||||
namespace ams::result {
|
|
||||||
|
|
||||||
extern bool CallFatalOnResultAssertion;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ams::result::impl {
|
namespace ams::result::impl {
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAbort(const char *file, int line, const char *func, const char *expr, Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAbort(const char *file, int line, const char *func, const char *expr, Result result) {
|
||||||
/* Assert that we should call fatal on result assertion. */
|
::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription());
|
||||||
/* If we shouldn't fatal, this will abort(); */
|
|
||||||
/* If we should, we'll continue onwards. */
|
|
||||||
if (!ams::result::CallFatalOnResultAssertion) {
|
|
||||||
::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: ams::fatal:: */
|
|
||||||
fatalThrow(result.GetValue());
|
|
||||||
AMS_INFINITE_LOOP();
|
AMS_INFINITE_LOOP();
|
||||||
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAbort(Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAbort(Result result) {
|
||||||
@ -41,16 +28,9 @@ namespace ams::result::impl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAssertion(const char *file, int line, const char *func, const char *expr, Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAssertion(const char *file, int line, const char *func, const char *expr, Result result) {
|
||||||
/* Assert that we should call fatal on result assertion. */
|
::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription());
|
||||||
/* If we shouldn't fatal, this will assert(); */
|
|
||||||
/* If we should, we'll continue onwards. */
|
|
||||||
if (!ams::result::CallFatalOnResultAssertion) {
|
|
||||||
::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: ams::fatal:: */
|
|
||||||
fatalThrow(result.GetValue());
|
|
||||||
AMS_INFINITE_LOOP();
|
AMS_INFINITE_LOOP();
|
||||||
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAssertion(Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAssertion(Result result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user