2022-06-02 05:18:26 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
2022-06-03 02:02:19 +00:00
|
|
|
#include <string.h>
|
2022-06-06 10:49:19 +00:00
|
|
|
#include <stdio.h>
|
2022-06-02 05:18:26 +00:00
|
|
|
|
2022-06-06 10:49:19 +00:00
|
|
|
#include <_compiler.h>
|
|
|
|
#include <_os.h>
|
2022-06-02 05:18:26 +00:00
|
|
|
|
2022-06-06 10:49:19 +00:00
|
|
|
// TODO: use abort() to break
|
2022-06-02 05:18:26 +00:00
|
|
|
|
2022-06-06 10:49:19 +00:00
|
|
|
extern void _assert_error(
|
|
|
|
char *cond,
|
|
|
|
char const *func,
|
|
|
|
char const *file,
|
|
|
|
char const *line
|
|
|
|
) {
|
|
|
|
printf("Assertion failed: %s\n", cond);
|
|
|
|
if(*func != 0) {
|
|
|
|
printf("\tFunction: %s\n", func);
|
2022-06-02 05:18:26 +00:00
|
|
|
}
|
2022-06-06 10:49:19 +00:00
|
|
|
printf("\tFile: %s\n", file);
|
|
|
|
printf("\tLine: %s\n", line);
|
2022-06-07 06:02:23 +00:00
|
|
|
abort();
|
2022-06-03 02:02:19 +00:00
|
|
|
}
|