mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-30 07:49:46 +00:00
parent
caad308a21
commit
83266db30b
@ -17,7 +17,14 @@
|
|||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/printf.h>
|
#include <base/printf.h>
|
||||||
|
|
||||||
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
|
* Make an assertion
|
||||||
@ -34,7 +41,7 @@ enum { CHECK_ASSERTIONS = 0 };
|
|||||||
*/
|
*/
|
||||||
#define assert(expression) \
|
#define assert(expression) \
|
||||||
do { \
|
do { \
|
||||||
if (CHECK_ASSERTIONS) { \
|
if (DO_ASSERT) { \
|
||||||
if (!(expression)) { \
|
if (!(expression)) { \
|
||||||
PERR("Assertion failed: "#expression""); \
|
PERR("Assertion failed: "#expression""); \
|
||||||
PERR(" File: %s:%d", __FILE__, __LINE__); \
|
PERR(" File: %s:%d", __FILE__, __LINE__); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user