From 572f1c985c04b0d72fee71fc39168c3b662038f7 Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Wed, 10 Jul 2024 17:14:35 +0100 Subject: [PATCH] Assertions: Add preprocessor definitions for checking when assertions are enabled --- modules/juce_core/system/juce_PlatformDefs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index dacbfa9e95..3312736598 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -179,12 +179,15 @@ namespace juce */ #define jassertquiet(expression) JUCE_BLOCK_WITH_FORCED_SEMICOLON (if (! (expression)) jassertfalse;) + #define JUCE_ASSERTIONS_ENABLED 1 + #else //============================================================================== // If debugging is disabled, these dummy debug and assertion macros are used.. #define DBG(textToWrite) #define jassertfalse JUCE_BLOCK_WITH_FORCED_SEMICOLON (JUCE_LOG_CURRENT_ASSERTION;) + #define JUCE_ASSERTIONS_ENABLED 0 #if JUCE_LOG_ASSERTIONS #define jassert(expression) JUCE_BLOCK_WITH_FORCED_SEMICOLON (if (! (expression)) jassertfalse;) @@ -196,6 +199,8 @@ namespace juce #endif +#define JUCE_ASSERTIONS_ENABLED_OR_LOGGED JUCE_ASSERTIONS_ENABLED || JUCE_LOG_ASSERTIONS + //============================================================================== #ifndef DOXYGEN #define JUCE_JOIN_MACRO_HELPER(a, b) a ## b