#include #include #include #include static void print(const char *s) { write(2, s, strlen(s)); } static unsigned int fmt_uint(char *s, int n) { unsigned int l = 1, q = n; while (q > 9) { ++l; q /= 10; } if (s) { s += l; do { *--s = '0' + (n % 10); n /= 10; } while (n); } return l; } void __assert_fail(const char *expr, const char *file, int line, const char *func) { char buf[10]; print("Assertion failed: "); print(expr); print(" ("); print(file); print(": "); print(func); print(": "); write(2, buf, fmt_uint(buf, line)); print(")\n"); fflush(NULL); abort(); }