Automatically figure out the appropriate assertion level
authorSam Lantinga <slouken@libsdl.org>
Wed, 13 Jan 2010 07:52:53 +0000
changeset 3653 1cd9f7117b98
parent 3652 dbd6a29e4b77
child 3654 336f3df1578d
Automatically figure out the appropriate assertion level
include/SDL_assert.h
--- 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