mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-19 21:08:07 +00:00
23 lines
475 B
C
23 lines
475 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "common.h"
|
|
|
|
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func)
|
|
{
|
|
printf("\nFATAL ERROR:\n");
|
|
if (expr) {
|
|
printf("expr: %s\n", expr);
|
|
}
|
|
if (msg) {
|
|
printf("msg : %s\n", msg);
|
|
}
|
|
if (file) {
|
|
printf("file: %s:%d\n", file, line);
|
|
}
|
|
if (func) {
|
|
printf("func: %s\n", func);
|
|
}
|
|
exit(1);
|
|
}
|