summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2010-01-13 07:25:28 +0000
committerSam Lantinga <slouken@libsdl.org>2010-01-13 07:25:28 +0000
commita112207d03fc8aec368784cc5b0ab329812bed27 (patch)
tree93bd410f1077bf3c998bf86349d9d2531edf37cd
parentbb12640ed47cd8ddcf35b37b32a8eac367097872 (diff)
The config sets the default assertion level so people can override it for their own use in application code.
-rw-r--r--configure.in8
-rw-r--r--include/SDL.h1
-rw-r--r--include/SDL_assert.h11
-rw-r--r--include/SDL_config.h.in2
-rw-r--r--include/SDL_config_iphoneos.h2
-rw-r--r--include/SDL_config_macosx.h2
-rw-r--r--include/SDL_config_minimal.h2
-rw-r--r--include/SDL_config_nintendods.h2
-rw-r--r--include/SDL_config_pandora.h2
-rw-r--r--include/SDL_config_win32.h2
-rw-r--r--include/SDL_config_wiz.h2
11 files changed, 16 insertions, 20 deletions
diff --git a/configure.in b/configure.in
index cb3b6ce754..83bbd375c0 100644
--- a/configure.in
+++ b/configure.in
@@ -142,19 +142,19 @@ AC_HELP_STRING([--enable-assertions],
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 --git a/include/SDL.h b/include/SDL.h
index 9831e831b9..fc3110e891 100644
--- a/include/SDL.h
+++ b/include/SDL.h
@@ -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 --git a/include/SDL_assert.h b/include/SDL_assert.h
index 0bc03186e7..3817fcfb47 100644
--- a/include/SDL_assert.h
+++ b/include/SDL_assert.h
@@ -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 @@ SDL_assert_state SDL_ReportAssertion(SDL_assert_data *, const char *, int);
#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 @@ SDL_assert_state SDL_ReportAssertion(SDL_assert_data *, const char *, int);
#endif /* _SDL_assert_h */
/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index f5e6f40b61..310b166e9d 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -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 --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index 66b2bd4373..288b18c8e8 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -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 --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index 66733b0d08..194cbc8302 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -29,7 +29,7 @@
#include <AvailabilityMacros.h>
/* 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 --git a/include/SDL_config_minimal.h b/include/SDL_config_minimal.h
index 6fc0829fc6..9e5d431367 100644
--- a/include/SDL_config_minimal.h
+++ b/include/SDL_config_minimal.h
@@ -34,7 +34,7 @@
#include <stdarg.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 --git a/include/SDL_config_nintendods.h b/include/SDL_config_nintendods.h
index 9e3ea314f0..a6bc07a61a 100644
--- a/include/SDL_config_nintendods.h
+++ b/include/SDL_config_nintendods.h
@@ -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 --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h
index 58d1aec547..88440d69e9 100644
--- a/include/SDL_config_pandora.h
+++ b/include/SDL_config_pandora.h
@@ -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 --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h
index 3b23364f63..143371aa3d 100644
--- a/include/SDL_config_win32.h
+++ b/include/SDL_config_win32.h
@@ -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 --git a/include/SDL_config_wiz.h b/include/SDL_config_wiz.h
index fc28afed59..e0b35d87fe 100644
--- a/include/SDL_config_wiz.h
+++ b/include/SDL_config_wiz.h
@@ -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