1 #ifndef _ddekit_assert_h
2 #define _ddekit_assert_h
3 #include <ddekit/ddekit.h>
5 #include <ddekit/printf.h>
6 #include <ddekit/panic.h>
8 /** \file ddekit/assert.h */
10 /** Assert that an expression is true and panic if not.
11 * \ingroup DDEKit_util
13 #define ddekit_assert(expr) do \
16 ddekit_print("\033[31;1mDDE: Assertion failed: "#expr"\033[0m\n"); \
17 ddekit_printf(" File: %s:%d\n",__FILE__,__LINE__); \
18 ddekit_printf(" Function: %s()\n", __FUNCTION__); \
19 ddekit_panic("Assertion failed."); \
21 #define Assert ddekit_assert