From c001e14f9deeb8f64618289d4448d2ef2cb9186d Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser <kaspar@schleiser.de> Date: Thu, 24 Mar 2016 10:20:46 +0100 Subject: [PATCH] core: debug: rely on optimizer to kick out unused debug code --- core/include/debug.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/include/debug.h b/core/include/debug.h index 7b4c77bdb0..21a3a7a25f 100644 --- a/core/include/debug.h +++ b/core/include/debug.h @@ -67,7 +67,9 @@ extern "C" { * @name Debugging defines * @{ */ -#if ENABLE_DEBUG +#ifndef ENABLE_DEBUG +#define ENABLE_DEBUG (0) +#endif /** * @def DEBUG_FUNC @@ -92,10 +94,7 @@ extern "C" { * * @note Another name for ::DEBUG_PRINT */ -#define DEBUG(...) DEBUG_PRINT(__VA_ARGS__) -#else -#define DEBUG(...) -#endif +#define DEBUG(...) if (ENABLE_DEBUG) DEBUG_PRINT(__VA_ARGS__) /** @} */ /** -- GitLab