Commit 803375d5 authored by Sam Lantinga's avatar Sam Lantinga

Allow configure to override assertion settings, but by default this comes from...

Allow configure to override assertion settings, but by default this comes from the build optimization level.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404405
parent 34ea846c
...@@ -137,28 +137,27 @@ AC_C_VOLATILE ...@@ -137,28 +137,27 @@ AC_C_VOLATILE
dnl See whether we want assertions for debugging/sanity checking SDL itself. dnl See whether we want assertions for debugging/sanity checking SDL itself.
AC_ARG_ENABLE(assertions, AC_ARG_ENABLE(assertions,
AC_HELP_STRING([--enable-assertions], AC_HELP_STRING([--enable-assertions],
[Enable internal sanity checks (yes/no/release/paranoid) [[default=release]]]), [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
, enable_assertions=release) , enable_assertions=auto)
sdl_valid_assertion_level=no case "$enable_assertions" in
if test x$enable_assertions = xno; then auto) # Use optimization settings to determine assertion level
sdl_valid_assertion_level=yes ;;
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0) disabled)
fi AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0)
if test x$enable_assertions = xrelease; then ;;
sdl_valid_assertion_level=yes release)
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1) AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1)
fi ;;
if test x$enable_assertions = xyes; then enabled)
sdl_valid_assertion_level=yes AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2)
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2) ;;
fi paranoid)
if test x$enable_assertions = xparanoid; then AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3)
sdl_valid_assertion_level=yes ;;
AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3) *)
fi AC_MSG_ERROR([*** unknown assertion level. stop.])
if test x$sdl_valid_assertion_level = xno; then ;;
AC_MSG_ERROR([*** unknown assertion level. stop.]) esac
fi
dnl See whether we can use gcc style dependency tracking dnl See whether we can use gcc style dependency tracking
AC_ARG_ENABLE(dependency-tracking, AC_ARG_ENABLE(dependency-tracking,
......
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
#define _SDL_assert_h #define _SDL_assert_h
#ifndef SDL_ASSERT_LEVEL #ifndef SDL_ASSERT_LEVEL
#if defined(_DEBUG) || defined(DEBUG) || \ #ifdef SDL_DEFAULT_ASSERT_LEVEL
(defined(__GNUC__) && !defined(__OPTIMIZE__)) #define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2 #define SDL_ASSERT_LEVEL 2
#else #else
#define SDL_ASSERT_LEVEL 1 #define SDL_ASSERT_LEVEL 1
......
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include "SDL_platform.h" #include "SDL_platform.h"
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ /* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
#ifdef __LP64__ #ifdef __LP64__
......
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
#include <stdarg.h> #include <stdarg.h>
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
/* General platform specific identifiers */ /* General platform specific identifiers */
#include "SDL_platform.h" #include "SDL_platform.h"
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
#define SDL_BYTEORDER 1234 #define SDL_BYTEORDER 1234
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
/* General platform specific identifiers */ /* General platform specific identifiers */
#include "SDL_platform.h" #include "SDL_platform.h"
/* SDL internal assertion support */
#define SDL_DEFAULT_ASSERT_LEVEL 1
/* Make sure that this isn't included by Visual C++ */ /* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER #ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h #error You should copy include/SDL_config.h.default to include/SDL_config.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment