The config sets the default assertion level so people can override it for their own use in application code.
authorSam Lantinga <slouken@libsdl.org>
Wed, 13 Jan 2010 07:25:28 +0000
changeset 36491e74d7984d0b
parent 3648 a9d830c05998
child 3650 91460fdfe83a
The config sets the default assertion level so people can override it for their own use in application code.
configure.in
include/SDL.h
include/SDL_assert.h
include/SDL_config.h.in
include/SDL_config_iphoneos.h
include/SDL_config_macosx.h
include/SDL_config_minimal.h
include/SDL_config_nintendods.h
include/SDL_config_pandora.h
include/SDL_config_win32.h
include/SDL_config_wiz.h
     1.1 --- a/configure.in	Wed Jan 13 07:00:20 2010 +0000
     1.2 +++ b/configure.in	Wed Jan 13 07:25:28 2010 +0000
     1.3 @@ -142,19 +142,19 @@
     1.4  sdl_valid_assertion_level=no
     1.5  if test x$enable_assertions = xno; then
     1.6      sdl_valid_assertion_level=yes
     1.7 -    AC_DEFINE(SDL_ASSERT_LEVEL, 0)
     1.8 +    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0)
     1.9  fi
    1.10  if test x$enable_assertions = xrelease; then
    1.11      sdl_valid_assertion_level=yes
    1.12 -    AC_DEFINE(SDL_ASSERT_LEVEL, 1)
    1.13 +    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1)
    1.14  fi
    1.15  if test x$enable_assertions = xyes; then
    1.16      sdl_valid_assertion_level=yes
    1.17 -    AC_DEFINE(SDL_ASSERT_LEVEL, 2)
    1.18 +    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2)
    1.19  fi
    1.20  if test x$enable_assertions = xparanoid; then
    1.21      sdl_valid_assertion_level=yes
    1.22 -    AC_DEFINE(SDL_ASSERT_LEVEL, 3)
    1.23 +    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3)
    1.24  fi
    1.25  if test x$sdl_valid_assertion_level = xno; then
    1.26      AC_MSG_ERROR([*** unknown assertion level. stop.])
     2.1 --- a/include/SDL.h	Wed Jan 13 07:00:20 2010 +0000
     2.2 +++ b/include/SDL.h	Wed Jan 13 07:25:28 2010 +0000
     2.3 @@ -77,7 +77,6 @@
     2.4  
     2.5  #include "SDL_main.h"
     2.6  #include "SDL_stdinc.h"
     2.7 -#include "SDL_assert.h"
     2.8  #include "SDL_atomic.h"
     2.9  #include "SDL_audio.h"
    2.10  #include "SDL_cpuinfo.h"
     3.1 --- a/include/SDL_assert.h	Wed Jan 13 07:00:20 2010 +0000
     3.2 +++ b/include/SDL_assert.h	Wed Jan 13 07:25:28 2010 +0000
     3.3 @@ -21,13 +21,11 @@
     3.4  */
     3.5  #include "SDL_config.h"
     3.6  
     3.7 -/* This is an assert macro for SDL's internal use. Not for the public API! */
     3.8 -
     3.9  #ifndef _SDL_assert_h
    3.10  #define _SDL_assert_h
    3.11  
    3.12  #ifndef SDL_ASSERT_LEVEL
    3.13 -#error SDL_ASSERT_LEVEL is not defined. Please fix your SDL_config.h.
    3.14 +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
    3.15  #endif
    3.16  
    3.17  /*
    3.18 @@ -107,12 +105,12 @@
    3.19  #define SDL_enabled_assert(condition) \
    3.20      do { \
    3.21          while ( !(condition) ) { \
    3.22 -			static struct SDL_assert_data assert_data = { \
    3.23 +            static struct SDL_assert_data assert_data = { \
    3.24                  0, 0, #condition, __FILE__, 0, 0, 0 \
    3.25              }; \
    3.26 -			const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
    3.27 +            const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
    3.28                                                                 SDL_FUNCTION, \
    3.29 -															   __LINE__); \
    3.30 +                                                               __LINE__); \
    3.31              if (state == SDL_ASSERTION_RETRY) { \
    3.32                  continue; /* go again. */ \
    3.33              } else if (state == SDL_ASSERTION_BREAK) { \
    3.34 @@ -148,4 +146,3 @@
    3.35  #endif /* _SDL_assert_h */
    3.36  
    3.37  /* vi: set ts=4 sw=4 expandtab: */
    3.38 -
     4.1 --- a/include/SDL_config.h.in	Wed Jan 13 07:00:20 2010 +0000
     4.2 +++ b/include/SDL_config.h.in	Wed Jan 13 07:25:28 2010 +0000
     4.3 @@ -163,7 +163,7 @@
     4.4  #endif /* HAVE_LIBC */
     4.5  
     4.6  /* SDL internal assertion support */
     4.7 -#undef SDL_ASSERT_LEVEL
     4.8 +#undef SDL_DEFAULT_ASSERT_LEVEL
     4.9  
    4.10  /* Allow disabling of core subsystems */
    4.11  #undef SDL_AUDIO_DISABLED
     5.1 --- a/include/SDL_config_iphoneos.h	Wed Jan 13 07:00:20 2010 +0000
     5.2 +++ b/include/SDL_config_iphoneos.h	Wed Jan 13 07:25:28 2010 +0000
     5.3 @@ -26,7 +26,7 @@
     5.4  #include "SDL_platform.h"
     5.5  
     5.6  /* SDL internal assertion support */
     5.7 -#define SDL_ASSERT_LEVEL 1
     5.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
     5.9  
    5.10  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    5.11  typedef signed char int8_t;
     6.1 --- a/include/SDL_config_macosx.h	Wed Jan 13 07:00:20 2010 +0000
     6.2 +++ b/include/SDL_config_macosx.h	Wed Jan 13 07:25:28 2010 +0000
     6.3 @@ -29,7 +29,7 @@
     6.4  #include <AvailabilityMacros.h>
     6.5  
     6.6  /* SDL internal assertion support */
     6.7 -#define SDL_ASSERT_LEVEL 1
     6.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
     6.9  
    6.10  /* This is a set of defines to configure the SDL features */
    6.11  
     7.1 --- a/include/SDL_config_minimal.h	Wed Jan 13 07:00:20 2010 +0000
     7.2 +++ b/include/SDL_config_minimal.h	Wed Jan 13 07:25:28 2010 +0000
     7.3 @@ -34,7 +34,7 @@
     7.4  #include <stdarg.h>
     7.5  
     7.6  /* SDL internal assertion support */
     7.7 -#define SDL_ASSERT_LEVEL 1
     7.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
     7.9  
    7.10  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    7.11  typedef signed char int8_t;
     8.1 --- a/include/SDL_config_nintendods.h	Wed Jan 13 07:00:20 2010 +0000
     8.2 +++ b/include/SDL_config_nintendods.h	Wed Jan 13 07:25:28 2010 +0000
     8.3 @@ -28,7 +28,7 @@
     8.4  /* This is a set of defines to configure the SDL features */
     8.5  
     8.6  /* SDL internal assertion support */
     8.7 -#define SDL_ASSERT_LEVEL 1
     8.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
     8.9  
    8.10  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    8.11  typedef signed char int8_t;
     9.1 --- a/include/SDL_config_pandora.h	Wed Jan 13 07:00:20 2010 +0000
     9.2 +++ b/include/SDL_config_pandora.h	Wed Jan 13 07:25:28 2010 +0000
     9.3 @@ -29,7 +29,7 @@
     9.4  #include "SDL_platform.h"
     9.5  
     9.6  /* SDL internal assertion support */
     9.7 -#define SDL_ASSERT_LEVEL 1
     9.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
     9.9  
    9.10  #define SDL_HAS_64BIT_TYPE 1
    9.11  #define SDL_BYTEORDER 1234
    10.1 --- a/include/SDL_config_win32.h	Wed Jan 13 07:00:20 2010 +0000
    10.2 +++ b/include/SDL_config_win32.h	Wed Jan 13 07:25:28 2010 +0000
    10.3 @@ -28,7 +28,7 @@
    10.4  /* This is a set of defines to configure the SDL features */
    10.5  
    10.6  /* SDL internal assertion support */
    10.7 -#define SDL_ASSERT_LEVEL 1
    10.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
    10.9  
   10.10  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
   10.11  #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
    11.1 --- a/include/SDL_config_wiz.h	Wed Jan 13 07:00:20 2010 +0000
    11.2 +++ b/include/SDL_config_wiz.h	Wed Jan 13 07:25:28 2010 +0000
    11.3 @@ -29,7 +29,7 @@
    11.4  #include "SDL_platform.h"
    11.5  
    11.6  /* SDL internal assertion support */
    11.7 -#define SDL_ASSERT_LEVEL 1
    11.8 +#define SDL_DEFAULT_ASSERT_LEVEL 1
    11.9  
   11.10  /* Make sure that this isn't included by Visual C++ */
   11.11  #ifdef _MSC_VER