From 09fbcb4be345a96fea55c664610353db320ddbf2 Mon Sep 17 00:00:00 2001 From: bumbread Date: Sun, 7 Aug 2022 20:41:49 +1100 Subject: [PATCH] add underscore to _DEBUG user macro --- doc/assert.md | 6 +++--- inc/assert.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/assert.md b/doc/assert.md index 329e52a..1dee247 100644 --- a/doc/assert.md +++ b/doc/assert.md @@ -14,16 +14,16 @@ The macro checks whether `expr` is true, and if not, prints the diagnostic information and then aborts execution in a way equivalent to calling abort() function (See SIGABRT). -If DEBUG macro is defined, assert does not print a diagnostic message, and +If `_DEBUG` macro is defined, assert does not print a diagnostic message, and instead simply causes a debug break. If NDEBUG macro is defined assert expands to an empty statement. If both NDEBUG -and DEBUG are defined, then DEBUG macro is ignored. +and `_DEBUG` are defined, then `_DEBUG` macro is ignored. ```c #if defined(NDEBUG) #define assert(expr) ((void)0) -#elif defined(DEBUG) +#elif defined(`_DEBUG`) #define assert(expr) /* debug break */ #else #define assert(expr) /* print diagnostic, then abort */ diff --git a/inc/assert.h b/inc/assert.h index f1c5507..8b9200f 100644 --- a/inc/assert.h +++ b/inc/assert.h @@ -14,7 +14,7 @@ void _assert( #if defined(NDEBUG) #define assert(ignore) ((void)0) -#elif defined(DEBUG) +#elif defined(_DEBUG) #if __GNUC__ #define assert(c) if (!(c)) __builtin_trap() #elif _MSC_VER