# HG changeset patch # User Sam Lantinga # Date 1263367528 0 # Node ID 1e74d7984d0b9672a5f01ebd9b38a7f83b062de6 # Parent a9d830c059983347795faefa5a2ca51ea778b661 The config sets the default assertion level so people can override it for their own use in application code. diff -r a9d830c05998 -r 1e74d7984d0b configure.in --- a/configure.in Wed Jan 13 07:00:20 2010 +0000 +++ b/configure.in Wed Jan 13 07:25:28 2010 +0000 @@ -142,19 +142,19 @@ sdl_valid_assertion_level=no if test x$enable_assertions = xno; then sdl_valid_assertion_level=yes - AC_DEFINE(SDL_ASSERT_LEVEL, 0) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0) fi if test x$enable_assertions = xrelease; then sdl_valid_assertion_level=yes - AC_DEFINE(SDL_ASSERT_LEVEL, 1) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1) fi if test x$enable_assertions = xyes; then sdl_valid_assertion_level=yes - AC_DEFINE(SDL_ASSERT_LEVEL, 2) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2) fi if test x$enable_assertions = xparanoid; then sdl_valid_assertion_level=yes - AC_DEFINE(SDL_ASSERT_LEVEL, 3) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3) fi if test x$sdl_valid_assertion_level = xno; then AC_MSG_ERROR([*** unknown assertion level. stop.]) diff -r a9d830c05998 -r 1e74d7984d0b include/SDL.h --- a/include/SDL.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL.h Wed Jan 13 07:25:28 2010 +0000 @@ -77,7 +77,6 @@ #include "SDL_main.h" #include "SDL_stdinc.h" -#include "SDL_assert.h" #include "SDL_atomic.h" #include "SDL_audio.h" #include "SDL_cpuinfo.h" diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_assert.h --- a/include/SDL_assert.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_assert.h Wed Jan 13 07:25:28 2010 +0000 @@ -21,13 +21,11 @@ */ #include "SDL_config.h" -/* This is an assert macro for SDL's internal use. Not for the public API! */ - #ifndef _SDL_assert_h #define _SDL_assert_h #ifndef SDL_ASSERT_LEVEL -#error SDL_ASSERT_LEVEL is not defined. Please fix your SDL_config.h. +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL #endif /* @@ -107,12 +105,12 @@ #define SDL_enabled_assert(condition) \ do { \ while ( !(condition) ) { \ - static struct SDL_assert_data assert_data = { \ + static struct SDL_assert_data assert_data = { \ 0, 0, #condition, __FILE__, 0, 0, 0 \ }; \ - const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ + const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ SDL_FUNCTION, \ - __LINE__); \ + __LINE__); \ if (state == SDL_ASSERTION_RETRY) { \ continue; /* go again. */ \ } else if (state == SDL_ASSERTION_BREAK) { \ @@ -148,4 +146,3 @@ #endif /* _SDL_assert_h */ /* vi: set ts=4 sw=4 expandtab: */ - diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config.h.in --- a/include/SDL_config.h.in Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config.h.in Wed Jan 13 07:25:28 2010 +0000 @@ -163,7 +163,7 @@ #endif /* HAVE_LIBC */ /* SDL internal assertion support */ -#undef SDL_ASSERT_LEVEL +#undef SDL_DEFAULT_ASSERT_LEVEL /* Allow disabling of core subsystems */ #undef SDL_AUDIO_DISABLED diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_iphoneos.h --- a/include/SDL_config_iphoneos.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_iphoneos.h Wed Jan 13 07:25:28 2010 +0000 @@ -26,7 +26,7 @@ #include "SDL_platform.h" /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_macosx.h --- a/include/SDL_config_macosx.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_macosx.h Wed Jan 13 07:25:28 2010 +0000 @@ -29,7 +29,7 @@ #include /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 /* This is a set of defines to configure the SDL features */ diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_minimal.h --- a/include/SDL_config_minimal.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_minimal.h Wed Jan 13 07:25:28 2010 +0000 @@ -34,7 +34,7 @@ #include /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_nintendods.h --- a/include/SDL_config_nintendods.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_nintendods.h Wed Jan 13 07:25:28 2010 +0000 @@ -28,7 +28,7 @@ /* This is a set of defines to configure the SDL features */ /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_pandora.h --- a/include/SDL_config_pandora.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_pandora.h Wed Jan 13 07:25:28 2010 +0000 @@ -29,7 +29,7 @@ #include "SDL_platform.h" /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 #define SDL_HAS_64BIT_TYPE 1 #define SDL_BYTEORDER 1234 diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_win32.h --- a/include/SDL_config_win32.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_win32.h Wed Jan 13 07:25:28 2010 +0000 @@ -28,7 +28,7 @@ /* This is a set of defines to configure the SDL features */ /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) diff -r a9d830c05998 -r 1e74d7984d0b include/SDL_config_wiz.h --- a/include/SDL_config_wiz.h Wed Jan 13 07:00:20 2010 +0000 +++ b/include/SDL_config_wiz.h Wed Jan 13 07:25:28 2010 +0000 @@ -29,7 +29,7 @@ #include "SDL_platform.h" /* SDL internal assertion support */ -#define SDL_ASSERT_LEVEL 1 +#define SDL_DEFAULT_ASSERT_LEVEL 1 /* Make sure that this isn't included by Visual C++ */ #ifdef _MSC_VER