From c204d45f6621818bf1db92bf470baa531f0a3980 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 2 Nov 2012 12:46:35 -0700 Subject: [PATCH] common/config: disable ASSERT() by default --- common.h | 5 +++++ config.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/common.h b/common.h index 50410ea7..81b26728 100644 --- a/common.h +++ b/common.h @@ -20,6 +20,7 @@ void assert_hook(void); +#ifdef CONFIG_ASSERT #define ASSERT(expr) \ do { \ if (!(expr)) { \ @@ -30,6 +31,10 @@ do { \ exit(EXIT_FAILURE); \ } \ } while (0) +#else +#define ASSERT(expr) \ + do { } while (0) +#endif /* CONFIG_ASSERT */ #define error_msg(...) fprintf(stderr, "Error: " __VA_ARGS__) diff --git a/config.h b/config.h index 109e8d86..227c9a9c 100644 --- a/config.h +++ b/config.h @@ -9,6 +9,10 @@ /* #ifndef CONFIG_DEBUG #define CONFIG_DEBUG #endif + + #ifndef CONFIG_ASSERT + #define CONFIG_ASSERT + #endif */ /** Turn on support for dumping cyclegraphs as dot files at each -- 2.34.1