include/SDL_assert.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 18 Apr 2011 12:20:30 -0700
changeset 5538 b395a72329c3
parent 5535 96594ac5fd1a
child 5541 b63f1383f8c9
permissions -rw-r--r--
Minor missing parameter name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     2
  Simple DirectMedia Layer
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     7
  arising from the use of this software.
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    11
  freely, subject to the following restrictions:
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5491
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
#ifndef _SDL_assert_h
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
#define _SDL_assert_h
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    25
#include "SDL_config.h"
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    26
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    27
#include "begin_code.h"
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    28
/* Set up for C function definitions, even when using C++ */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    29
#ifdef __cplusplus
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    30
/* *INDENT-OFF* */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    31
extern "C" {
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    32
/* *INDENT-ON* */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    33
#endif
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    34
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
#ifndef SDL_ASSERT_LEVEL
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3653
diff changeset
    36
#ifdef SDL_DEFAULT_ASSERT_LEVEL
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3653
diff changeset
    37
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3653
diff changeset
    38
#elif defined(_DEBUG) || defined(DEBUG) || \
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3653
diff changeset
    39
      (defined(__GNUC__) && !defined(__OPTIMIZE__))
3653
1cd9f7117b98 Automatically figure out the appropriate assertion level
Sam Lantinga <slouken@libsdl.org>
parents: 3652
diff changeset
    40
#define SDL_ASSERT_LEVEL 2
1cd9f7117b98 Automatically figure out the appropriate assertion level
Sam Lantinga <slouken@libsdl.org>
parents: 3652
diff changeset
    41
#else
1cd9f7117b98 Automatically figure out the appropriate assertion level
Sam Lantinga <slouken@libsdl.org>
parents: 3652
diff changeset
    42
#define SDL_ASSERT_LEVEL 1
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
#endif
3653
1cd9f7117b98 Automatically figure out the appropriate assertion level
Sam Lantinga <slouken@libsdl.org>
parents: 3652
diff changeset
    44
#endif /* SDL_ASSERT_LEVEL */
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
/*
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    47
These are macros and not first class functions so that the debugger breaks
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    48
on the assertion line and not in some random guts of SDL, and so each
3665
97114af2f8dc Fixed comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 3655
diff changeset
    49
assert can have unique static variables associated with it.
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    50
*/
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    51
5086
c2539ff054c8 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 5011
diff changeset
    52
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
5491
abdd970a65a8 Fixed error because intrin.h contains C++ code and can't be included in an extern "C" block.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    53
/* Don't include intrin.h here because it contains C++ code */
abdd970a65a8 Fixed error because intrin.h contains C++ code and can't be included in an extern "C" block.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    54
extern void __cdecl __debugbreak(void);
5011
d306007299ac Use the portable intrinsic
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    55
    #define SDL_TriggerBreakpoint() __debugbreak()
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    56
#elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    57
    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    58
#elif defined(HAVE_SIGNAL_H)
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    59
    #include <signal.h>
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    60
    #define SDL_TriggerBreakpoint() raise(SIGTRAP)
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    61
#else
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    62
    /* How do we trigger breakpoints on this platform? */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    63
    #define SDL_TriggerBreakpoint()
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    64
#endif
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    65
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    66
#if (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    67
#   define SDL_FUNCTION __func__
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    68
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    69
#   define SDL_FUNCTION __FUNCTION__
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    70
#else
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    71
#   define SDL_FUNCTION "???"
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    72
#endif
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    73
#define SDL_FILE    __FILE__
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    74
#define SDL_LINE    __LINE__
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    75
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
    76
/*
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
sizeof (x) makes the compiler still parse the expression even without
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
assertions enabled, so the code is always checked at compile time, but
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
doesn't actually generate code for it, so there are no side effects or
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    80
expensive checks at run time, just the constant size of what x WOULD be,
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
which presumably gets optimized out as unused.
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    82
This also solves the problem of...
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
    int somevalue = blah();
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
    SDL_assert(somevalue == 1);
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
...which would cause compiles to complain that somevalue is unused if we
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
disable assertions.
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
*/
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
#define SDL_disabled_assert(condition) \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
    do { (void) sizeof ((condition)); } while (0)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    94
#if (SDL_ASSERT_LEVEL > 0)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    96
typedef enum
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
{
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
    SDL_ASSERTION_RETRY,  /**< Retry the assert immediately. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
    SDL_ASSERTION_BREAK,  /**< Make the debugger trigger a breakpoint. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
    SDL_ASSERTION_ABORT,  /**< Terminate the program. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
    SDL_ASSERTION_IGNORE,  /**< Ignore the assert. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   102
    SDL_ASSERTION_ALWAYS_IGNORE,  /**< Ignore the assert from now on. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   103
} SDL_assert_state;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   105
typedef struct SDL_assert_data
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   106
{
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   107
    int always_ignore;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
    unsigned int trigger_count;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
    const char *condition;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
    const char *filename;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
    int linenum;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   112
    const char *function;
3670
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   113
    const struct SDL_assert_data *next;
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
} SDL_assert_data;
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
3668
6952d2b783e6 Friendly warning comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 3666
diff changeset
   116
/* Never call this directly. Use the SDL_assert* macros. */
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   117
extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   118
                                                             const char *,
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   119
                                                             const char *, int);
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   121
/* the do {} while(0) avoids dangling else problems:
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   122
    if (x) SDL_assert(y); else blah();
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   123
       ... without the do/while, the "else" could attach to this macro's "if".
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   124
   We try to handle just the minimum we need here in a macro...the loop,
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
   the static vars, and break points. The heavy lifting is handled in
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   126
   SDL_ReportAssertion(), in SDL_assert.c.
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
*/
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
#define SDL_enabled_assert(condition) \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
    do { \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   130
        while ( !(condition) ) { \
3649
1e74d7984d0b The config sets the default assertion level so people can override it for their own use in application code.
Sam Lantinga <slouken@libsdl.org>
parents: 3647
diff changeset
   131
            static struct SDL_assert_data assert_data = { \
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   132
                0, 0, #condition, 0, 0, 0, 0 \
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   133
            }; \
3649
1e74d7984d0b The config sets the default assertion level so people can override it for their own use in application code.
Sam Lantinga <slouken@libsdl.org>
parents: 3647
diff changeset
   134
            const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   135
                                                               SDL_FUNCTION, \
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   136
                                                               SDL_FILE, \
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   137
                                                               SDL_LINE); \
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   138
            if (state == SDL_ASSERTION_RETRY) { \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   139
                continue; /* go again. */ \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   140
            } else if (state == SDL_ASSERTION_BREAK) { \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   141
                SDL_TriggerBreakpoint(); \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   142
            } \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   143
            break; /* not retrying. */ \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   144
        } \
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   145
    } while (0)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   146
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   147
#endif  /* enabled assertions support code */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   148
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   149
/* Enable various levels of assertions. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   150
#if SDL_ASSERT_LEVEL == 0   /* assertions disabled */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   151
#   define SDL_assert(condition) SDL_disabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   152
#   define SDL_assert_release(condition) SDL_disabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   153
#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   154
#elif SDL_ASSERT_LEVEL == 1  /* release settings. */
3652
dbd6a29e4b77 Fixed release level assertions
Sam Lantinga <slouken@libsdl.org>
parents: 3650
diff changeset
   155
#   define SDL_assert(condition) SDL_disabled_assert(condition)
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   156
#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
3652
dbd6a29e4b77 Fixed release level assertions
Sam Lantinga <slouken@libsdl.org>
parents: 3650
diff changeset
   157
#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   158
#elif SDL_ASSERT_LEVEL == 2  /* normal settings. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   159
#   define SDL_assert(condition) SDL_enabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   160
#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   161
#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   162
#elif SDL_ASSERT_LEVEL == 3  /* paranoid settings. */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   163
#   define SDL_assert(condition) SDL_enabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   164
#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   165
#   define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   166
#else
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   167
#   error Unknown assertion level.
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   168
#endif
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   169
3670
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   170
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   171
typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)(
5538
b395a72329c3 Minor missing parameter name
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   172
                                 const SDL_assert_data* data, void* userdata);
3670
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   173
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   174
/**
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   175
 *  \brief Set an application-defined assertion handler.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   176
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   177
 *  This allows an app to show its own assertion UI and/or force the
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   178
 *  response to an assertion failure. If the app doesn't provide this, SDL
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   179
 *  will try to do the right thing, popping up a system-specific GUI dialog,
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   180
 *  and probably minimizing any fullscreen windows.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   181
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   182
 *  This callback may fire from any thread, but it runs wrapped in a mutex, so
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   183
 *  it will only fire from one thread at a time.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   184
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   185
 *  Setting the callback to NULL restores SDL's original internal handler.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   186
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   187
 *  This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   188
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   189
 *  \return SDL_assert_state value of how to handle the assertion failure.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   190
 *  
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   191
 *  \param handler Callback function, called when an assertion fails.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   192
 *  \param userdata A pointer passed to the callback as-is.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   193
 */
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   194
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   195
                                            SDL_AssertionHandler handler,
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   196
                                            void *userdata);
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   197
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   198
/**
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   199
 *  \brief Get a list of all assertion failures.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   200
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   201
 *  Get all assertions triggered since last call to SDL_ResetAssertionReport(),
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   202
 *  or the start of the program.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   203
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   204
 *  The proper way to examine this data looks something like this:
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   205
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   206
 *  <code>
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   207
 *  const SDL_assert_data *item = SDL_GetAssertionReport();
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   208
 *  while (item->condition) {
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   209
 *      printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   210
 *             item->condition, item->function, item->filename,
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   211
 *             item->linenum, item->trigger_count,
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   212
 *             item->always_ignore ? "yes" : "no");
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   213
 *      item = item->next;
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   214
 *  }
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   215
 *  </code>
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   216
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   217
 *  \return List of all assertions. This never returns NULL,
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   218
 *          even if there are no items.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   219
 *  \sa SDL_ResetAssertionReport
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   220
 */
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   221
extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void);
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   222
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   223
/**
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   224
 *  \brief Reset the list of all assertion failures.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   225
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   226
 *  Reset list of all assertions triggered.
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   227
 *
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   228
 *  \sa SDL_GetAssertionReport
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   229
 */
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   230
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
62b6a5b99918 Clean up assertion API for public use.
Ryan C. Gordon <icculus@icculus.org>
parents: 3668
diff changeset
   231
3655
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   232
/* Ends C function definitions when using C++ */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   233
#ifdef __cplusplus
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   234
/* *INDENT-OFF* */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   235
}
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   236
/* *INDENT-ON* */
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   237
#endif
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   238
#include "close_code.h"
1cc7f0143c12 Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
Sam Lantinga <slouken@libsdl.org>
parents: 3654
diff changeset
   239
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   240
#endif /* _SDL_assert_h */
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   241
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   242
/* vi: set ts=4 sw=4 expandtab: */