From b2830b6cc4a2ec5936232ba07298852d33cdb1cf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 13 Jan 2010 07:52:53 +0000 Subject: [PATCH] Automatically figure out the appropriate assertion level --- include/SDL_assert.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/SDL_assert.h b/include/SDL_assert.h index 18430a58a..9cff3dfe8 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -25,8 +25,13 @@ #define _SDL_assert_h #ifndef SDL_ASSERT_LEVEL -#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#if defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 #endif +#endif /* SDL_ASSERT_LEVEL */ /* sizeof (x) makes the compiler still parse the expression even without