summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/util.c b/src/util.c
index c219831..14a213a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,43 +1,12 @@
#include "util.h"
+#include "platform.h"
#include <stdarg.h>
#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef __3DS__
-
-#include <3ds.h>
-
-static void panic_begin(void) { consoleInit(GFX_TOP, NULL); }
-
-static noreturn void panic(void) {
- printf("\nPress Start to exit.\n");
-
- while (aptMainLoop()) {
- hidScanInput();
- u32 keys = hidKeysDown();
- if (keys & KEY_START)
- break;
- gfxFlushBuffers();
- gfxSwapBuffers();
- gspWaitForVBlank();
- }
-
- gfxExit();
- exit(1);
-}
-
-#else
-
-static void panic_begin(void) {}
-
-static noreturn void panic(void) { abort(); }
-
-#endif
noreturn void assume__failed(const char *file, int line, const char *expr) {
panic_begin();
fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
- panic();
+ panic_end();
}
noreturn void todo__impl(const char *file, int line, const char *fmt, ...) {
@@ -47,5 +16,5 @@ noreturn void todo__impl(const char *file, int line, const char *fmt, ...) {
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
- panic();
+ panic_end();
}