diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/al/lib.h | 8 |
1 files changed, 7 insertions, 1 deletions
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 <wchar.h> #include <stdio.h> #include <stdarg.h> +#if !defined AL_DEBUG && defined AL_RELEASE_ASSERTS +#undef NDEBUG #include <assert.h> +#define NDEBUG +#else +#include <assert.h> +#endif #include <ctype.h> #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) |