arsa
2.7
|
Go to the source code of this file.
Classes | |
struct | SDL_AssertData |
Macros | |
#define | SDL_ASSERT_LEVEL 1 |
#define | SDL_TriggerBreakpoint() |
#define | SDL_FUNCTION "???" |
#define | SDL_FILE __FILE__ |
#define | SDL_LINE __LINE__ |
#define | SDL_NULL_WHILE_LOOP_CONDITION (0) |
#define | SDL_disabled_assert(condition) do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) |
#define | SDL_enabled_assert(condition) |
#define | SDL_assert(condition) SDL_disabled_assert(condition) |
#define | SDL_assert_release(condition) SDL_enabled_assert(condition) |
#define | SDL_assert_paranoid(condition) SDL_disabled_assert(condition) |
#define | SDL_assert_always(condition) SDL_enabled_assert(condition) |
#define | SDL_assert_state SDL_AssertState |
#define | SDL_assert_data SDL_AssertData |
Typedefs | |
typedef struct SDL_AssertData | SDL_AssertData |
typedef SDL_AssertState(SDLCALL * | SDL_AssertionHandler) (const SDL_AssertData *data, void *userdata) |
Enumerations | |
enum | SDL_AssertState { SDL_ASSERTION_RETRY, SDL_ASSERTION_BREAK, SDL_ASSERTION_ABORT, SDL_ASSERTION_IGNORE, SDL_ASSERTION_ALWAYS_IGNORE } |
Functions | |
DECLSPEC SDL_AssertState SDLCALL | SDL_ReportAssertion (SDL_AssertData *, const char *, const char *, int) |
DECLSPEC void SDLCALL | SDL_SetAssertionHandler (SDL_AssertionHandler handler, void *userdata) |
Set an application-defined assertion handler. More... | |
DECLSPEC SDL_AssertionHandler SDLCALL | SDL_GetDefaultAssertionHandler (void) |
Get the default assertion handler. More... | |
DECLSPEC SDL_AssertionHandler SDLCALL | SDL_GetAssertionHandler (void **puserdata) |
Get the current assertion handler. More... | |
DECLSPEC const SDL_AssertData *SDLCALL | SDL_GetAssertionReport (void) |
Get a list of all assertion failures. More... | |
DECLSPEC void SDLCALL | SDL_ResetAssertionReport (void) |
Reset the list of all assertion failures. More... | |
#define SDL_assert | ( | condition | ) | SDL_disabled_assert(condition) |
Definition at line 169 of file SDL_assert.h.
#define SDL_assert_always | ( | condition | ) | SDL_enabled_assert(condition) |
Definition at line 185 of file SDL_assert.h.
#define SDL_assert_data SDL_AssertData |
Definition at line 280 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 171 of file SDL_assert.h.
#define SDL_assert_release | ( | condition | ) | SDL_enabled_assert(condition) |
Definition at line 170 of file SDL_assert.h.
#define SDL_assert_state SDL_AssertState |
Definition at line 279 of file SDL_assert.h.
#define SDL_disabled_assert | ( | condition | ) | do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) |
Definition at line 99 of file SDL_assert.h.
#define SDL_enabled_assert | ( | condition | ) |
Definition at line 145 of file SDL_assert.h.
#define SDL_FILE __FILE__ |
Definition at line 73 of file SDL_assert.h.
#define SDL_FUNCTION "???" |
Definition at line 71 of file SDL_assert.h.
#define SDL_LINE __LINE__ |
Definition at line 74 of file SDL_assert.h.
#define SDL_NULL_WHILE_LOOP_CONDITION (0) |
Definition at line 96 of file SDL_assert.h.
#define SDL_TriggerBreakpoint | ( | ) |
Definition at line 63 of file SDL_assert.h.
typedef struct SDL_AssertData SDL_AssertData |
typedef SDL_AssertState(SDLCALL * SDL_AssertionHandler) (const SDL_AssertData *data, void *userdata) |
Definition at line 188 of file SDL_assert.h.
enum SDL_AssertState |
Definition at line 102 of file SDL_assert.h.
DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler | ( | void ** | puserdata | ) |
Get the current assertion handler.
This returns the function pointer that is called when an assertion is triggered. This is either the value last passed to SDL_SetAssertionHandler(), or if no application-specified function is set, is equivalent to calling SDL_GetDefaultAssertionHandler().
puserdata | Pointer to a void*, which will store the "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value will always be NULL for the default handler. If you don't care about this data, it is safe to pass a NULL pointer to this function to ignore it. |
DECLSPEC const SDL_AssertData* 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_AssertData *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; }
DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler | ( | void | ) |
Get the default assertion handler.
This returns the function pointer that is called by default when an assertion is triggered. This is an internal function provided by SDL, that is used for assertions when SDL_SetAssertionHandler() hasn't been used to provide a different function.
DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion | ( | SDL_AssertData * | , |
const char * | , | ||
const char * | , | ||
int | |||
) |
Reset the list of all assertion failures.
Reset list of all assertions triggered.
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()!
Return SDL_AssertState value of how to handle the assertion failure.
handler | Callback function, called when an assertion fails. |
userdata | A pointer passed to the callback as-is. |