/* libmisc/assert.h - More assertions * * Copyright (C) 2024 Luke T. Shumaker * SPDX-License-Identifier: AGPL-3.0-or-later */ #include /* for fprintf(), stderr */ #include /* for abort() */ #include #ifndef NDEBUG __attribute__((__noreturn__)) void __assert_msg_fail(const char *expr, const char *file, unsigned int line, const char *func, const char *msg) { fprintf(stderr, "error: %s:%u:%s(): assertion \"%s\" failed%s%s\n", file, line, func, expr, msg ? ": " : "", msg); abort(); } #endif