From ad2dfd72d78c5390c29defdc79b9e60a7429cd11 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald <matthias@ringwald.ch> Date: Thu, 5 Dec 2024 15:33:05 +0100 Subject: [PATCH] btstack_debug: avoid unused warnings with NDEBUG --- src/btstack_debug.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/btstack_debug.h b/src/btstack_debug.h index 5410e78ca..142e7dcfa 100644 --- a/src/btstack_debug.h +++ b/src/btstack_debug.h @@ -72,7 +72,11 @@ extern "C" { // allow to override btstack_assert in btstack_config.h #ifndef btstack_assert // map to libc assert +#ifdef NDEBUG +#define btstack_assert(condition) {(void)(condition);} +#else #define btstack_assert(condition) assert(condition) +#endif #endif /* btstack_assert */ #else /* HAVE_ASSERT */ #ifdef ENABLE_BTSTACK_ASSERT