34 #ifndef WS_OVERLAPPEDWINDOW
35 #define WS_OVERLAPPEDWINDOW 0
78 triggered_assertions =
data;
90 debug_print(
"All SDL assertions between last init/quit:\n\n");
92 while (item !=
NULL) {
96 " * triggered %u time%s.\n"
97 " * always ignore: %s.\n",
113 ExitProcess(exitcode);
130 #define ENDLINE "\r\n"
159 "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE
180 }
else if (
SDL_strcmp(envr,
"always_ignore") == 0) {
202 messagebox.
window = window;
203 messagebox.
title =
"Assertion Failed";
209 if (selected == -1) {
221 fprintf(stderr,
"Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : ");
223 if (fgets(buf,
sizeof (buf), stdin) ==
NULL) {
262 static int assertion_running = 0;
290 if (assertion_running > 1) {
291 if (assertion_running == 2) {
293 }
else if (assertion_running == 3) {
339 if (handler !=
NULL) {
357 for (item = triggered_assertions; item !=
NULL; item = next) {
364 triggered_assertions =
NULL;
static SDL_AssertionHandler assertion_handler
#define SDL_MAX_LOG_MESSAGE
The maximum size of a log message.
static void SDL_GenerateAssertionReport(void)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
GLsizei GLenum GLuint GLuint GLsizei GLchar * message
static SDL_assert_data * triggered_assertions
DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock)
Unlock a spin lock by setting it to 0. Always returns immediately.
DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt,...)
static void SDL_AbortAssertion(void)
#define SDL_stack_free(data)
DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex *mutex)
DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void)
static void * assertion_userdata
DECLSPEC void SDLCALL SDL_Quit(void)
static SDL_assert_state SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
static void debug_print(const char *fmt,...)
DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex *mutex)
unsigned int trigger_count
DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window *window)
Minimize a window to an iconic representation.
void SDL_AssertionsQuit(void)
DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap)
Log a message with the specified category and priority.
DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock)
Lock a spin lock by setting it to a non-zero value.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
SDL_Window * SDL_GetFocusWindow(void)
DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window *window)
Restore the size and position of a minimized or maximized window.
DECLSPEC void SDLCALL SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)
Set an application-defined assertion handler.
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2)
DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window *window)
Get the window flags.
const SDL_MessageBoxButtonData * buttons
MessageBox structure containing title, text, window, etc.
SDL_assert_state(SDLCALL * SDL_AssertionHandler)(const SDL_assert_data *data, void *userdata)
static void SDL_AddAssertionToReport(SDL_assert_data *data)
#define SDL_arraysize(array)
struct SDL_mutex SDL_mutex
GLenum GLuint GLsizei const GLchar * buf
static SDL_mutex * assertion_mutex
struct SDL_assert_data * next
DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, const char *, const char *, int)
#define SDL_stack_alloc(type, count)
DECLSPEC const SDL_assert_data *SDLCALL SDL_GetAssertionReport(void)
Get a list of all assertion failures.
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex)
DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
Create a modal message box.
DECLSPEC void SDLCALL SDL_ResetAssertionReport(void)
Reset the list of all assertion failures.
static void SDL_ExitProcess(int exitcode)