diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_Debug.h')
-rw-r--r-- | intern/ghost/intern/GHOST_Debug.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h index f0db1b3de8d..9292235a9c7 100644 --- a/intern/ghost/intern/GHOST_Debug.h +++ b/intern/ghost/intern/GHOST_Debug.h @@ -58,12 +58,23 @@ # define GHOST_PRINTF(x, ...) #endif // GHOST_DEBUG - -#ifdef GHOST_DEBUG +#ifdef WITH_ASSERT_ABORT +# include <stdio.h> //for fprintf() +# include <stdlib.h> //for abort() +# define GHOST_ASSERT(x, info) \ + { \ + if (!(x)) { \ + fprintf(stderr, "GHOST_ASSERT failed: "); \ + fprintf(stderr, info); \ + fprintf(stderr, "\n"); \ + abort(); \ + } \ + } (void)0 +#elif defined(GHOST_DEBUG) # define GHOST_ASSERT(x, info) \ { \ if (!(x)) { \ - GHOST_PRINT("assertion failed: "); \ + GHOST_PRINT("GHOST_ASSERT failed: "); \ GHOST_PRINT(info); \ GHOST_PRINT("\n"); \ } \ |