From f90c4488596762dac250c55e3055244e59097ddb Mon Sep 17 00:00:00 2001 From: mquinson Date: Sun, 8 Aug 2004 04:34:33 +0000 Subject: [PATCH 1/1] kill gras_assertN when NDEBUG is defined git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@365 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/gras/error.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/gras/error.h b/include/gras/error.h index 8505083aca..029d26348e 100644 --- a/include/gras/error.h +++ b/include/gras/error.h @@ -145,6 +145,16 @@ typedef enum { #define gras_abort abort +#ifdef NDEBUG +#define gras_assert(cond) +#define gras_assert0(cond,msg) +#define gras_assert1(cond,msg,a) +#define gras_assert2(cond,msg,a,b) +#define gras_assert3(cond,msg,a,b,c) +#define gras_assert4(cond,msg,a,b,c,d) +#define gras_assert5(cond,msg,a,b,c,d,e) +#define gras_assert6(cond,msg,a,b,c,d,e,f) +#else #define gras_assert(cond) if (!(cond)) { CRITICAL1("Assertion %s failed", #cond); gras_abort(); } #define gras_assert0(cond,msg) if (!(cond)) { CRITICAL0(msg); gras_abort(); } #define gras_assert1(cond,msg,a) if (!(cond)) { CRITICAL1(msg,a); gras_abort(); } @@ -153,7 +163,7 @@ typedef enum { #define gras_assert4(cond,msg,a,b,c,d) if (!(cond)) { CRITICAL4(msg,a,b,c,d); gras_abort(); } #define gras_assert5(cond,msg,a,b,c,d,e) if (!(cond)) { CRITICAL5(msg,a,b,c,d,e); gras_abort(); } #define gras_assert6(cond,msg,a,b,c,d,e,f) if (!(cond)) { CRITICAL6(msg,a,b,c,d,e,f); gras_abort(); } - +#endif END_DECL #endif /* GRAS_ERROR_H */ -- 2.20.1