Skip to content

Commit 1a5a6d1

Browse files
swegenerdpgeorge
authored andcommitted
bare-arm: Add dummy __assert_func and __fatal_error
Required to build bare-arm with debugging. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
1 parent 238ab50 commit 1a5a6d1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

bare-arm/main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
7878
void nlr_jump_fail(void *val) {
7979
}
8080

81+
void NORETURN __fatal_error(const char *msg) {
82+
while (1);
83+
}
84+
85+
#ifndef NDEBUG
86+
void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
87+
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
88+
__fatal_error("Assertion failed");
89+
}
90+
#endif
91+
8192
/*
8293
int _lseek() {return 0;}
8394
int _read() {return 0;}

0 commit comments

Comments
 (0)