diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-24 01:54:48 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-24 02:00:19 +0300 |
commit | 9b5dda3b07496bda28970dfd23e4951a76d0f8ed (patch) | |
tree | 558aa4eb844ca8d965d6b3a29fc37447a5b8e7f1 | |
parent | 93de6b912f82dd22530a69af79c648cff0a4b6d6 (diff) |
GHOST: use GHOST_ASSERT for non-release builds
GHOST_ASSERT now matches BLI_assert, which is only ignored for release
builds. Otherwise it prints or asserts when WITH_ASSERT_ABORT is enabled.
-rw-r--r-- | intern/ghost/intern/GHOST_Debug.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h index e6bdf974d59..6b1bd3785ae 100644 --- a/intern/ghost/intern/GHOST_Debug.h +++ b/intern/ghost/intern/GHOST_Debug.h @@ -15,12 +15,12 @@ # endif #endif -#ifdef WITH_GHOST_DEBUG +#if defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG)) # include <iostream> # include <stdio.h> //for printf() #endif // WITH_GHOST_DEBUG -#ifdef WITH_GHOST_DEBUG +#if defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG)) # define GHOST_PRINT(x) \ { \ std::cout << x; \ @@ -31,10 +31,10 @@ printf(x, __VA_ARGS__); \ } \ (void)0 -#else // WITH_GHOST_DEBUG +#else # define GHOST_PRINT(x) # define GHOST_PRINTF(x, ...) -#endif // WITH_GHOST_DEBUG +#endif /* `defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG))` */ #ifdef WITH_ASSERT_ABORT # include <stdio.h> //for fprintf() @@ -49,7 +49,8 @@ } \ } \ (void)0 -#elif defined(WITH_GHOST_DEBUG) +/* Assert in non-release builds too. */ +#elif defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG)) # define GHOST_ASSERT(x, info) \ { \ if (!(x)) { \ @@ -59,6 +60,6 @@ } \ } \ (void)0 -#else // WITH_GHOST_DEBUG +#else /* `defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG))` */ # define GHOST_ASSERT(x, info) ((void)0) -#endif // WITH_GHOST_DEBUG +#endif /* `defined(WITH_GHOST_DEBUG) || (!defined(NDEBUG))` */ |