diff --git a/config-bsdmodule.h.in b/config-bsdmodule.h.in index 701206ea5..8e70b8c00 100644 --- a/config-bsdmodule.h.in +++ b/config-bsdmodule.h.in @@ -23,6 +23,10 @@ /* Define if 'int64_t' is typedefed to 'long long' in bsdmodule. */ #undef HAVE_INT64_IS_LONG_LONG_BSDMODULE +/* Define to enable assertion checking. Failed assertions will print a message + and optionally stop the router. */ +#undef HAVE_KERNEL_ASSERT + /* Define if NETISR scheduling should be used. */ #undef BSD_NETISRSCHED @@ -33,7 +37,19 @@ #include /* Define assert macro. */ -#define assert(x) /* nada */ +# ifdef __cplusplus +extern "C" { +# endif +void click_assert_failed(const char *file, int line, const char *problem_text); +# ifdef __cplusplus +} +# endif + +#ifdef HAVE_KERNEL_ASSERT +# define assert(x) ((x) ? (void)0 : click_assert_failed(__FILE__, __LINE__, #x)) +#else +# define assert(x) /* nada */ +#endif /* Define likely and unlikely macros. */ #define likely(x) __builtin_expect(!!(x), 1)