From 83266db30bd57f83d652f6f7f361f59f3047875b Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 26 Feb 2014 11:18:22 +0100 Subject: [PATCH] hw: disable assertions if release spec is set only Fix #1071 --- base-hw/src/core/include/assert.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base-hw/src/core/include/assert.h b/base-hw/src/core/include/assert.h index 97a3d94cc6..992444a78b 100644 --- a/base-hw/src/core/include/assert.h +++ b/base-hw/src/core/include/assert.h @@ -17,7 +17,14 @@ /* Genode includes */ #include -enum { CHECK_ASSERTIONS = 0 }; +/** + * Suppress assertions in release version + */ +#ifdef GENODE_RELEASE +#define DO_ASSERT false +#else +#define DO_ASSERT true +#endif /* GENODE_RELEASE */ /** * Make an assertion @@ -34,7 +41,7 @@ enum { CHECK_ASSERTIONS = 0 }; */ #define assert(expression) \ do { \ - if (CHECK_ASSERTIONS) { \ + if (DO_ASSERT) { \ if (!(expression)) { \ PERR("Assertion failed: "#expression""); \ PERR(" File: %s:%d", __FILE__, __LINE__); \