From ed6fc176a1ef6afd43eaa198c43eb813c3a81d99 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 8 Sep 2025 12:06:30 -0400 Subject: build: Option for asserts in release builds - Define NDEBUG in release builds. - loccount -> sloccount. Signed-off-by: Andrew Opalach --- include/al/lib.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/al') diff --git a/include/al/lib.h b/include/al/lib.h index 73861a8..5e65149 100644 --- a/include/al/lib.h +++ b/include/al/lib.h @@ -43,7 +43,13 @@ #include #include #include +#if !defined AL_DEBUG && defined AL_RELEASE_ASSERTS +#undef NDEBUG #include +#define NDEBUG +#else +#include +#endif #include #ifdef AL_MEMORY_TRACKING @@ -94,7 +100,7 @@ static inline void *al_realloc(void *ptr, size_t n) { return ptr ? realloc(ptr, #define al_snprintf snprintf #define al_vsnprintf vsnprintf #define al_fflush fflush -#ifdef AL_DEBUG +#if defined AL_DEBUG || defined AL_RELEASE_ASSERTS #define al_assert assert #else #define al_assert(expr) do { (void)sizeof(expr); } while (0) // NOLINT(bugprone-sizeof-expression) -- cgit v1.2.3-101-g0448