zenilib
0.5.3.0
|
Go to the source code of this file.
Classes | |
struct | SDL_assert_data |
Macros | |
#define | SDL_assert(condition) SDL_disabled_assert(condition) |
#define | SDL_assert_always(condition) SDL_enabled_assert(condition) |
#define | SDL_ASSERT_LEVEL 1 |
#define | SDL_assert_paranoid(condition) SDL_disabled_assert(condition) |
#define | SDL_assert_release(condition) SDL_enabled_assert(condition) |
#define | SDL_disabled_assert(condition) do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) |
#define | SDL_enabled_assert(condition) |
#define | SDL_FILE __FILE__ |
#define | SDL_FUNCTION "???" |
#define | SDL_LINE __LINE__ |
#define | SDL_NULL_WHILE_LOOP_CONDITION (0) |
#define | SDL_TriggerBreakpoint() |
Typedefs | |
typedef struct SDL_assert_data | SDL_assert_data |
typedef SDL_assert_state(SDLCALL * | SDL_AssertionHandler )(const SDL_assert_data *data, void *userdata) |
Enumerations | |
enum | SDL_assert_state { SDL_ASSERTION_RETRY, SDL_ASSERTION_BREAK, SDL_ASSERTION_ABORT, SDL_ASSERTION_IGNORE, SDL_ASSERTION_ALWAYS_IGNORE } |
Functions | |
DECLSPEC const SDL_assert_data *SDLCALL | SDL_GetAssertionReport (void) |
Get a list of all assertion failures. More... | |
DECLSPEC SDL_assert_state SDLCALL | SDL_ReportAssertion (SDL_assert_data *, const char *, const char *, int) |
DECLSPEC void SDLCALL | SDL_ResetAssertionReport (void) |
Reset the list of all assertion failures. More... | |
DECLSPEC void SDLCALL | SDL_SetAssertionHandler (SDL_AssertionHandler handler, void *userdata) |
Set an application-defined assertion handler. More... | |
#define SDL_assert | ( | condition | ) | SDL_disabled_assert(condition) |
Definition at line 159 of file SDL_assert.h.
Referenced by SDL_AddEvent(), SDL_CutEvent(), SDL_FindFrequencyMultiple(), SDL_HapticRumblePlay(), SDL_JoystickQuit(), SDL_OpenAudio(), SDL_PrivateGameControllerParseButton(), SDL_PrivateShouldInitSubsystem(), SDL_PrivateSubsystemRefCountIncr(), SDL_ResetMouse(), SDL_SW_CreateYUVTexture(), SDL_SYS_SetupThread(), SDL_TouchQuit(), SDL_TraverseShapeTree(), SDL_UpdateYUVTexture(), and SDLTest_Assert().
#define SDL_assert_always | ( | condition | ) | SDL_enabled_assert(condition) |
Definition at line 175 of file SDL_assert.h.
#define SDL_ASSERT_LEVEL 1 |
Definition at line 40 of file SDL_assert.h.
#define SDL_assert_paranoid | ( | condition | ) | SDL_disabled_assert(condition) |
Definition at line 161 of file SDL_assert.h.
#define SDL_assert_release | ( | condition | ) | SDL_enabled_assert(condition) |
Definition at line 160 of file SDL_assert.h.
#define SDL_disabled_assert | ( | condition | ) | do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) |
Definition at line 95 of file SDL_assert.h.
#define SDL_enabled_assert | ( | condition | ) |
Definition at line 132 of file SDL_assert.h.
#define SDL_FILE __FILE__ |
Definition at line 71 of file SDL_assert.h.
#define SDL_FUNCTION "???" |
Definition at line 69 of file SDL_assert.h.
#define SDL_LINE __LINE__ |
Definition at line 72 of file SDL_assert.h.
#define SDL_NULL_WHILE_LOOP_CONDITION (0) |
Definition at line 92 of file SDL_assert.h.
#define SDL_TriggerBreakpoint | ( | ) |
Definition at line 61 of file SDL_assert.h.
typedef struct SDL_assert_data SDL_assert_data |
typedef SDL_assert_state(SDLCALL * SDL_AssertionHandler)(const SDL_assert_data *data, void *userdata) |
Definition at line 178 of file SDL_assert.h.
enum SDL_assert_state |
Definition at line 98 of file SDL_assert.h.
DECLSPEC const SDL_assert_data* SDLCALL SDL_GetAssertionReport | ( | void | ) |
Get a list of all assertion failures.
Get all assertions triggered since last call to SDL_ResetAssertionReport(), or the start of the program.
The proper way to examine this data looks something like this:
const SDL_assert_data *item = SDL_GetAssertionReport(); while (item) { printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", item->condition, item->function, item->filename, item->linenum, item->trigger_count, item->always_ignore ? "yes" : "no"); item = item->next; }
Definition at line 348 of file SDL_assert.c.
References triggered_assertions.
DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion | ( | SDL_assert_data * | , |
const char * | , | ||
const char * | , | ||
int | |||
) |
Definition at line 259 of file SDL_assert.c.
References SDL_assert_data::always_ignore, assertion_handler, assertion_mutex, assertion_userdata, file, SDL_assert_data::filename, SDL_assert_data::function, SDL_assert_data::linenum, NULL, SDL_AbortAssertion(), SDL_AddAssertionToReport(), SDL_ASSERTION_ABORT, SDL_ASSERTION_ALWAYS_IGNORE, SDL_ASSERTION_BREAK, SDL_ASSERTION_IGNORE, SDL_ASSERTION_RETRY, SDL_AtomicLock(), SDL_AtomicUnlock(), SDL_CreateMutex(), SDL_ExitProcess(), SDL_LockMutex(), SDL_UnlockMutex(), and SDL_assert_data::trigger_count.
Reset the list of all assertion failures.
Reset list of all assertions triggered.
Definition at line 353 of file SDL_assert.c.
References SDL_assert_data::always_ignore, SDL_assert_data::next, NULL, SDL_FALSE, and SDL_assert_data::trigger_count.
Referenced by SDL_GenerateAssertionReport().
DECLSPEC void SDLCALL SDL_SetAssertionHandler | ( | SDL_AssertionHandler | handler, |
void * | userdata | ||
) |
Set an application-defined assertion handler.
This allows an app to show its own assertion UI and/or force the response to an assertion failure. If the app doesn't provide this, SDL will try to do the right thing, popping up a system-specific GUI dialog, and probably minimizing any fullscreen windows.
This callback may fire from any thread, but it runs wrapped in a mutex, so it will only fire from one thread at a time.
Setting the callback to NULL restores SDL's original internal handler.
This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
handler | Callback function, called when an assertion fails. |
userdata | A pointer passed to the callback as-is. |
Definition at line 337 of file SDL_assert.c.
References assertion_handler, assertion_userdata, NULL, and SDL_PromptAssertion().