summaryrefslogtreecommitdiff
path: root/core/host/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/host/panic.c')
-rw-r--r--core/host/panic.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/host/panic.c b/core/host/panic.c
index 90ddf55dd7..ee815cb678 100644
--- a/core/host/panic.c
+++ b/core/host/panic.c
@@ -3,6 +3,9 @@
* found in the LICENSE file.
*/
+#include <stdio.h>
+#include <stdlib.h>
+
#include "common.h"
#include "panic.h"
#include "util.h"
@@ -11,3 +14,16 @@ struct panic_data *panic_get_data(void)
{
return NULL;
}
+
+void panic_assert_fail(const char *msg, const char *func, const char *fname,
+ int linenum)
+{
+ fprintf(stderr, "ASSERTION FAIL: %s:%d:%s - %s\n",
+ fname, linenum, func, msg);
+ fflush(stderr);
+
+ puts("Fail!"); /* Inform test runner */
+ fflush(stdout);
+
+ exit(1);
+}