diff include/SDL_assert.h @ 3653:1cd9f7117b98

Automatically figure out the appropriate assertion level
author Sam Lantinga <slouken@libsdl.org>
date Wed, 13 Jan 2010 07:52:53 +0000
parents dbd6a29e4b77
children 336f3df1578d
line wrap: on
line diff
--- a/include/SDL_assert.h	Wed Jan 13 07:36:00 2010 +0000
+++ b/include/SDL_assert.h	Wed Jan 13 07:52:53 2010 +0000
@@ -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