Commit | Line | Data |
---|---|---|
4ee41178 | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
4ee41178 | 3 | * |
0235b0db | 4 | * Copyright 2019 EfficiOS Inc. |
4ee41178 SM |
5 | */ |
6 | ||
91d81473 MJ |
7 | #include <stdio.h> |
8 | ||
578e048b MJ |
9 | #include "common/assert.h" |
10 | #include "common/common.h" | |
4ee41178 | 11 | |
5a5b944d FD |
12 | void bt_common_assert_failed(const char *file, int line, const char *func, |
13 | const char *assertion) | |
14 | { | |
4ee41178 | 15 | fprintf(stderr, |
da18f496 | 16 | "%s\n%s%s%s (╯°□°)╯︵ ┻━┻ %s %s%s%s%s:%s%d%s: %s%s()%s: " |
04609487 | 17 | "%sAssertion %s%s`%s`%s%s failed.%s\n", |
da18f496 PP |
18 | bt_common_color_reset(), |
19 | bt_common_color_bold(), | |
20 | bt_common_color_bg_yellow(), | |
04609487 | 21 | bt_common_color_fg_bright_red(), |
da18f496 PP |
22 | bt_common_color_reset(), |
23 | bt_common_color_bold(), | |
04609487 | 24 | bt_common_color_fg_bright_magenta(), |
da18f496 PP |
25 | file, |
26 | bt_common_color_reset(), | |
27 | bt_common_color_fg_green(), | |
28 | line, | |
29 | bt_common_color_reset(), | |
30 | bt_common_color_fg_cyan(), | |
31 | func, | |
32 | bt_common_color_reset(), | |
33 | bt_common_color_fg_red(), | |
34 | bt_common_color_bold(), | |
04609487 | 35 | bt_common_color_fg_bright_red(), |
da18f496 PP |
36 | assertion, |
37 | bt_common_color_reset(), | |
38 | bt_common_color_fg_red(), | |
39 | bt_common_color_reset()); | |
498e7994 | 40 | bt_common_abort(); |
da18f496 | 41 | } |