Skip to content

Commit

Permalink
Enabled assertions support for bsdmodule.
Browse files Browse the repository at this point in the history
  • Loading branch information
srcman committed Jul 12, 2011
1 parent 61b2c7a commit c23afb3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion config-bsdmodule.h.in
Expand Up @@ -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

Expand All @@ -33,7 +37,19 @@
#include <sys/types.h>

/* 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)
Expand Down

0 comments on commit c23afb3

Please sign in to comment.