common/config: disable ASSERT() by default
authorBrian Norris <banorris@uci.edu>
Fri, 2 Nov 2012 19:46:35 +0000 (12:46 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 2 Nov 2012 19:50:42 +0000 (12:50 -0700)
common.h
config.h

index 50410ea..81b2672 100644 (file)
--- 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__)
 
index 109e8d8..227c9a9 100644 (file)
--- 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