From 8ba2ba61b7a83950476db317b2cd90f0a6691161 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 10 Jun 2024 15:55:20 -0400 Subject: [PATCH 1/2] Add NDEBUG --- include/raylib-nuklear.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/raylib-nuklear.h b/include/raylib-nuklear.h index 03f33a8..f9b86df 100644 --- a/include/raylib-nuklear.h +++ b/include/raylib-nuklear.h @@ -52,7 +52,11 @@ #endif // NK_INCLUDE_FIXED_TYPES #ifndef NK_ASSERT -#define NK_ASSERT(condition) do { if (!(condition)) { TraceLog(LOG_WARNING, "NUKLEAR: Failed assert \"%s\" (%s:%i)", #condition, "nuklear.h", __LINE__); }} while (0) +#ifdef NDEBUG +#define NK_ASSERT(condition) (void)0 +#else +#define NK_ASSERT(condition) do { if (!(condition)) { TraceLog(LOG_ERROR, "NUKLEAR: Failed assert \"%s\" (%s:%i)", #condition, "nuklear.h", __LINE__); }} while (0) +#endif // NDEBUG #endif // NK_ASSERT #include "nuklear.h" From c350f8ffd9f3eac28d8a3866329f5ac2fd50bbac Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 10 Jun 2024 21:14:14 -0400 Subject: [PATCH 2/2] Wrap the case with brackets --- include/raylib-nuklear.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/raylib-nuklear.h b/include/raylib-nuklear.h index f9b86df..f6fba2b 100644 --- a/include/raylib-nuklear.h +++ b/include/raylib-nuklear.h @@ -53,7 +53,7 @@ #ifndef NK_ASSERT #ifdef NDEBUG -#define NK_ASSERT(condition) (void)0 +#define NK_ASSERT(condition) ((void)0) #else #define NK_ASSERT(condition) do { if (!(condition)) { TraceLog(LOG_ERROR, "NUKLEAR: Failed assert \"%s\" (%s:%i)", #condition, "nuklear.h", __LINE__); }} while (0) #endif // NDEBUG