diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-11-29 21:13:02 +0100 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-11-29 21:13:02 +0100 |
commit | 7a5154bfab6c641a2878db4159e268a75a292c54 (patch) | |
tree | 261493afb5357226bd2529f6f610b80415039da0 | |
parent | 5e9adabfcfc229372b7186b3a7cc87352e69a155 (diff) |
assert: ensure DEBUG_LEVEL is set before it is used
When enabling DEBUG, assert.h is parsed before debug.h, so DEBUG_LEVEL is not
set.
Change-Id: I90219ea8c5c7806d41c2261389a6f383e61ea6d0
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r-- | include/assert.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/assert.h b/include/assert.h index ecdfaca6..052cc0ab 100644 --- a/include/assert.h +++ b/include/assert.h @@ -26,6 +26,12 @@ #include <compiler.h> #include <debug.h> +#if defined(DEBUG) +#define DEBUGLEVEL DEBUG +#else +#define DEBUGLEVEL 2 +#endif + #define ASSERT(x) \ do { if (unlikely(!(x))) { panic("ASSERT FAILED at (%s:%d): %s\n", __FILE__, __LINE__, #x); } } while (0) #define assert(x) ASSERT(x) |