Merge pull request #255 from red031000/master

cleanup error handling
This commit is contained in:
Adrienn Tindall 2023-10-08 08:46:29 -05:00 committed by GitHub
commit dc2edc222d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,8 @@
#ifndef POKEHEARTGOLD_ASSERT_H
#define POKEHEARTGOLD_ASSERT_H
#include "error_handling.h"
/*
* Assert statements. If the expression evaluates false,
* the software will terminate.
@ -13,13 +15,4 @@
#define GF_ASSERT(...) ((void)0)
#endif //PM_KEEP_ASSERTS
/*
* void GF_AssertFail(void)
*
* Called when an assertion fails.
* Do not use this directly.
* Instead, use the GF_ASSERT macro defined above.
*/
void GF_AssertFail(void);
#endif //POKEHEARTGOLD_ASSERT_H

View File

@ -1,6 +1,13 @@
#ifndef POKEHEARTGOLD_ERROR_HANDLING_H
#define POKEHEARTGOLD_ERROR_HANDLING_H
void PrintErrorMessageAndReset(void);
/*
* void GF_AssertFail(void)
*
* Called when an assertion fails.
* Do not use this directly.
* Instead, use the GF_ASSERT macro defined above.
*/
void GF_AssertFail(void);
#endif //POKEHEARTGOLD_ERROR_HANDLING_H

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "unk_02037C94.h"
#include "error_handling.h"
#include "error_message_reset.h"
#include "unk_02037C94.h"
void GF_AssertFail(void) {
if (!sub_02037D78()) {

View File

@ -2,6 +2,7 @@
#include "heap.h"
#include "unk_02037C94.h"
#include "error_handling.h"
#include "error_message_reset.h"
struct HeapInfo {
NNSFndHeapHandle *heapHandles;