SDL 3.0
SDL_assert.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * # CategoryAssert
24 *
25 * A helpful assertion macro!
26 *
27 * SDL assertions operate like your usual `assert` macro, but with some added
28 * features:
29 *
30 * - It uses a trick with the `sizeof` operator, so disabled assertions
31 * vaporize out of the compiled code, but variables only referenced in the
32 * assertion won't trigger compiler warnings about being unused.
33 * - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else
34 * do_something();`
35 * - It works the same everywhere, instead of counting on various platforms'
36 * compiler and C runtime to behave.
37 * - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,
38 * SDL_assert_paranoid) instead of a single all-or-nothing option.
39 * - It offers a variety of responses when an assertion fails (retry, trigger
40 * the debugger, abort the program, ignore the failure once, ignore it for
41 * the rest of the program's run).
42 * - It tries to show the user a dialog by default, if possible, but the app
43 * can provide a callback to handle assertion failures however they like.
44 * - It lets failed assertions be retried. Perhaps you had a network failure
45 * and just want to retry the test after plugging your network cable back
46 * in? You can.
47 * - It lets the user ignore an assertion failure, if there's a harmless
48 * problem that one can continue past.
49 * - It lets the user mark an assertion as ignored for the rest of the
50 * program's run; if there's a harmless problem that keeps popping up.
51 * - It provides statistics and data on all failed assertions to the app.
52 * - It allows the default assertion handler to be controlled with environment
53 * variables, in case an automated script needs to control it.
54 *
55 * To use it: do a debug build and just sprinkle around tests to check your
56 * code!
57 */
58
59#ifndef SDL_assert_h_
60#define SDL_assert_h_
61
62#include <SDL3/SDL_stdinc.h>
63
64#include <SDL3/SDL_begin_code.h>
65/* Set up for C function definitions, even when using C++ */
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70#ifdef SDL_WIKI_DOCUMENTATION_SECTION
71
72/**
73 * The level of assertion aggressiveness.
74 *
75 * This value changes depending on compiler options and other preprocessor
76 * defines.
77 *
78 * It is currently one of the following values, but future SDL releases might
79 * add more:
80 *
81 * - 0: All SDL assertion macros are disabled.
82 * - 1: Release settings: SDL_assert disabled, SDL_assert_release enabled.
83 * - 2: Debug settings: SDL_assert and SDL_assert_release enabled.
84 * - 3: Paranoid settings: All SDL assertion macros enabled, including
85 * SDL_assert_paranoid.
86 *
87 * \since This macro is available since SDL 3.1.3.
88 */
89#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors
90
91#elif !defined(SDL_ASSERT_LEVEL)
92#ifdef SDL_DEFAULT_ASSERT_LEVEL
93#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
94#elif defined(_DEBUG) || defined(DEBUG) || \
95 (defined(__GNUC__) && !defined(__OPTIMIZE__))
96#define SDL_ASSERT_LEVEL 2
97#else
98#define SDL_ASSERT_LEVEL 1
99#endif
100#endif
101
102#ifdef SDL_WIKI_DOCUMENTATION_SECTION
103
104/**
105 * Attempt to tell an attached debugger to pause.
106 *
107 * This allows an app to programmatically halt ("break") the debugger as if it
108 * had hit a breakpoint, allowing the developer to examine program state, etc.
109 *
110 * This is a macro--not a function--so that the debugger breaks on the source
111 * code line that used SDL_TriggerBreakpoint and not in some random guts of
112 * SDL. SDL_assert uses this macro for the same reason.
113 *
114 * If the program is not running under a debugger, SDL_TriggerBreakpoint will
115 * likely terminate the app, possibly without warning. If the current platform
116 * isn't supported (SDL doesn't know how to trigger a breakpoint), this macro
117 * does nothing.
118 *
119 * \threadsafety It is safe to call this macro from any thread.
120 *
121 * \since This macro is available since SDL 3.1.3.
122 */
123#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
124
125#elif defined(_MSC_VER)
126 /* Don't include intrin.h here because it contains C++ code */
127 extern void __cdecl __debugbreak(void);
128 #define SDL_TriggerBreakpoint() __debugbreak()
129#elif defined(ANDROID)
130 #include <assert.h>
131 #define SDL_TriggerBreakpoint() assert(0)
132#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
133 #define SDL_TriggerBreakpoint() __builtin_debugtrap()
134#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
135 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
136#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
137 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
138#elif ( defined(SDL_PLATFORM_APPLE) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
139 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
140#elif defined(SDL_PLATFORM_APPLE) && defined(__arm__)
141 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
142#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
143 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
144#elif defined(__386__) && defined(__WATCOMC__)
145 #define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
146#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
147 #include <signal.h>
148 #define SDL_TriggerBreakpoint() raise(SIGTRAP)
149#else
150 /* How do we trigger breakpoints on this platform? */
151 #define SDL_TriggerBreakpoint()
152#endif
153
154#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
155# define SDL_FUNCTION __func__
156#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
157# define SDL_FUNCTION __FUNCTION__
158#else
159# define SDL_FUNCTION "???"
160#endif
161#define SDL_FILE __FILE__
162#define SDL_LINE __LINE__
163
164/*
165sizeof (x) makes the compiler still parse the expression even without
166assertions enabled, so the code is always checked at compile time, but
167doesn't actually generate code for it, so there are no side effects or
168expensive checks at run time, just the constant size of what x WOULD be,
169which presumably gets optimized out as unused.
170This also solves the problem of...
171
172 int somevalue = blah();
173 SDL_assert(somevalue == 1);
174
175...which would cause compiles to complain that somevalue is unused if we
176disable assertions.
177*/
178
179/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
180 this condition isn't constant. And looks like an owl's face! */
181#ifdef _MSC_VER /* stupid /W4 warnings. */
182#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
183#else
184#define SDL_NULL_WHILE_LOOP_CONDITION (0)
185#endif
186
187#define SDL_disabled_assert(condition) \
188 do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
189
190/**
191 * Possible outcomes from a triggered assertion.
192 *
193 * When an enabled assertion triggers, it may call the assertion handler
194 * (possibly one provided by the app via SDL_SetAssertionHandler), which will
195 * return one of these values, possibly after asking the user.
196 *
197 * Then SDL will respond based on this outcome (loop around to retry the
198 * condition, try to break in a debugger, kill the program, or ignore the
199 * problem).
200 *
201 * \since This enum is available since SDL 3.1.3.
202 */
203typedef enum SDL_AssertState
204{
205 SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
206 SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
207 SDL_ASSERTION_ABORT, /**< Terminate the program. */
208 SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
209 SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
211
212/**
213 * Information about an assertion failure.
214 *
215 * This structure is filled in with information about a triggered assertion,
216 * used by the assertion handler, then added to the assertion report. This is
217 * returned as a linked list from SDL_GetAssertionReport().
218 *
219 * \since This struct is available since SDL 3.1.3.
220 */
221typedef struct SDL_AssertData
222{
223 bool always_ignore; /**< true if app should always continue when assertion is triggered. */
224 unsigned int trigger_count; /**< Number of times this assertion has been triggered. */
225 const char *condition; /**< A string of this assert's test code. */
226 const char *filename; /**< The source file where this assert lives. */
227 int linenum; /**< The line in `filename` where this assert lives. */
228 const char *function; /**< The name of the function where this assert lives. */
229 const struct SDL_AssertData *next; /**< next item in the linked list. */
231
232/**
233 * Never call this directly.
234 *
235 * Use the SDL_assert* macros instead.
236 *
237 * \param data assert data structure.
238 * \param func function name.
239 * \param file file name.
240 * \param line line number.
241 * \returns assert state.
242 *
243 * \threadsafety It is safe to call this function from any thread.
244 *
245 * \since This function is available since SDL 3.1.3.
246 */
247extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
248 const char *func,
249 const char *file, int line) SDL_ANALYZER_NORETURN;
250
251/* Define the trigger breakpoint call used in asserts */
252#ifndef SDL_AssertBreakpoint
253#if defined(ANDROID) && defined(assert)
254/* Define this as empty in case assert() is defined as SDL_assert */
255#define SDL_AssertBreakpoint()
256#else
257#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
258#endif
259#endif /* !SDL_AssertBreakpoint */
260
261/* the do {} while(0) avoids dangling else problems:
262 if (x) SDL_assert(y); else blah();
263 ... without the do/while, the "else" could attach to this macro's "if".
264 We try to handle just the minimum we need here in a macro...the loop,
265 the static vars, and break points. The heavy lifting is handled in
266 SDL_ReportAssertion(), in SDL_assert.c.
267*/
268#define SDL_enabled_assert(condition) \
269 do { \
270 while ( !(condition) ) { \
271 static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
272 const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
273 if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
274 continue; /* go again. */ \
275 } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
276 SDL_AssertBreakpoint(); \
277 } \
278 break; /* not retrying. */ \
279 } \
280 } while (SDL_NULL_WHILE_LOOP_CONDITION)
281
282#ifdef SDL_WIKI_DOCUMENTATION_SECTION
283
284/**
285 * An assertion test that is normally performed only in debug builds.
286 *
287 * This macro is enabled when the SDL_ASSERT_LEVEL is >= 2, otherwise it is
288 * disabled. This is meant to only do these tests in debug builds, so they can
289 * tend to be more expensive, and they are meant to bring everything to a halt
290 * when they fail, with the programmer there to assess the problem.
291 *
292 * In short: you can sprinkle these around liberally and assume they will
293 * evaporate out of the build when building for end-users.
294 *
295 * When assertions are disabled, this wraps `condition` in a `sizeof`
296 * operator, which means any function calls and side effects will not run, but
297 * the compiler will not complain about any otherwise-unused variables that
298 * are only referenced in the assertion.
299 *
300 * One can set the environment variable "SDL_ASSERT" to one of several strings
301 * ("abort", "break", "retry", "ignore", "always_ignore") to force a default
302 * behavior, which may be desirable for automation purposes. If your platform
303 * requires GUI interfaces to happen on the main thread but you're debugging
304 * an assertion in a background thread, it might be desirable to set this to
305 * "break" so that your debugger takes control as soon as assert is triggered,
306 * instead of risking a bad UI interaction (deadlock, etc) in the application.
307 *
308 * \param condition boolean value to test.
309 *
310 * \threadsafety It is safe to call this macro from any thread.
311 *
312 * \since This macro is available since SDL 3.1.3.
313 */
314#define SDL_assert(condition) if (assertion_enabled && (condition)) { trigger_assertion; }
315
316/**
317 * An assertion test that is performed even in release builds.
318 *
319 * This macro is enabled when the SDL_ASSERT_LEVEL is >= 1, otherwise it is
320 * disabled. This is meant to be for tests that are cheap to make and
321 * extremely unlikely to fail; generally it is frowned upon to have an
322 * assertion failure in a release build, so these assertions generally need to
323 * be of more than life-and-death importance if there's a chance they might
324 * trigger. You should almost always consider handling these cases more
325 * gracefully than an assert allows.
326 *
327 * When assertions are disabled, this wraps `condition` in a `sizeof`
328 * operator, which means any function calls and side effects will not run, but
329 * the compiler will not complain about any otherwise-unused variables that
330 * are only referenced in the assertion.
331 *
332 * One can set the environment variable "SDL_ASSERT" to one of several strings
333 * ("abort", "break", "retry", "ignore", "always_ignore") to force a default
334 * behavior, which may be desirable for automation purposes. If your platform
335 * requires GUI interfaces to happen on the main thread but you're debugging
336 * an assertion in a background thread, it might be desirable to set this to
337 * "break" so that your debugger takes control as soon as assert is triggered,
338 * instead of risking a bad UI interaction (deadlock, etc) in the application.
339 * *
340 *
341 * \param condition boolean value to test.
342 *
343 * \threadsafety It is safe to call this macro from any thread.
344 *
345 * \since This macro is available since SDL 3.1.3.
346 */
347#define SDL_assert_release(condition) SDL_disabled_assert(condition)
348
349/**
350 * An assertion test that is performed only when built with paranoid settings.
351 *
352 * This macro is enabled when the SDL_ASSERT_LEVEL is >= 3, otherwise it is
353 * disabled. This is a higher level than both release and debug, so these
354 * tests are meant to be expensive and only run when specifically looking for
355 * extremely unexpected failure cases in a special build.
356 *
357 * When assertions are disabled, this wraps `condition` in a `sizeof`
358 * operator, which means any function calls and side effects will not run, but
359 * the compiler will not complain about any otherwise-unused variables that
360 * are only referenced in the assertion.
361 *
362 * One can set the environment variable "SDL_ASSERT" to one of several strings
363 * ("abort", "break", "retry", "ignore", "always_ignore") to force a default
364 * behavior, which may be desirable for automation purposes. If your platform
365 * requires GUI interfaces to happen on the main thread but you're debugging
366 * an assertion in a background thread, it might be desirable to set this to
367 * "break" so that your debugger takes control as soon as assert is triggered,
368 * instead of risking a bad UI interaction (deadlock, etc) in the application.
369 *
370 * \param condition boolean value to test.
371 *
372 * \threadsafety It is safe to call this macro from any thread.
373 *
374 * \since This macro is available since SDL 3.1.3.
375 */
376#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
377
378/* Enable various levels of assertions. */
379#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */
380# define SDL_assert(condition) SDL_disabled_assert(condition)
381# define SDL_assert_release(condition) SDL_disabled_assert(condition)
382# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
383#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
384# define SDL_assert(condition) SDL_disabled_assert(condition)
385# define SDL_assert_release(condition) SDL_enabled_assert(condition)
386# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
387#elif SDL_ASSERT_LEVEL == 2 /* debug settings. */
388# define SDL_assert(condition) SDL_enabled_assert(condition)
389# define SDL_assert_release(condition) SDL_enabled_assert(condition)
390# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
391#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
392# define SDL_assert(condition) SDL_enabled_assert(condition)
393# define SDL_assert_release(condition) SDL_enabled_assert(condition)
394# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
395#else
396# error Unknown assertion level.
397#endif
398
399/**
400 * An assertion test that is always performed.
401 *
402 * This macro is always enabled no matter what SDL_ASSERT_LEVEL is set to. You
403 * almost never want to use this, as it could trigger on an end-user's system,
404 * crashing your program.
405 *
406 * One can set the environment variable "SDL_ASSERT" to one of several strings
407 * ("abort", "break", "retry", "ignore", "always_ignore") to force a default
408 * behavior, which may be desirable for automation purposes. If your platform
409 * requires GUI interfaces to happen on the main thread but you're debugging
410 * an assertion in a background thread, it might be desirable to set this to
411 * "break" so that your debugger takes control as soon as assert is triggered,
412 * instead of risking a bad UI interaction (deadlock, etc) in the application.
413 *
414 * \param condition boolean value to test.
415 *
416 * \threadsafety It is safe to call this macro from any thread.
417 *
418 * \since This macro is available since SDL 3.1.3.
419 */
420#define SDL_assert_always(condition) SDL_enabled_assert(condition)
421
422
423/**
424 * A callback that fires when an SDL assertion fails.
425 *
426 * \param data a pointer to the SDL_AssertData structure corresponding to the
427 * current assertion.
428 * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
429 * \returns an SDL_AssertState value indicating how to handle the failure.
430 *
431 * \threadsafety This callback may be called from any thread that triggers an
432 * assert at any time.
433 *
434 * \since This datatype is available since SDL 3.1.3.
435 */
437 const SDL_AssertData *data, void *userdata);
438
439/**
440 * Set an application-defined assertion handler.
441 *
442 * This function allows an application to show its own assertion UI and/or
443 * force the response to an assertion failure. If the application doesn't
444 * provide this, SDL will try to do the right thing, popping up a
445 * system-specific GUI dialog, and probably minimizing any fullscreen windows.
446 *
447 * This callback may fire from any thread, but it runs wrapped in a mutex, so
448 * it will only fire from one thread at a time.
449 *
450 * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
451 *
452 * \param handler the SDL_AssertionHandler function to call when an assertion
453 * fails or NULL for the default handler.
454 * \param userdata a pointer that is passed to `handler`.
455 *
456 * \threadsafety It is safe to call this function from any thread.
457 *
458 * \since This function is available since SDL 3.1.3.
459 *
460 * \sa SDL_GetAssertionHandler
461 */
462extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
463 SDL_AssertionHandler handler,
464 void *userdata);
465
466/**
467 * Get the default assertion handler.
468 *
469 * This returns the function pointer that is called by default when an
470 * assertion is triggered. This is an internal function provided by SDL, that
471 * is used for assertions when SDL_SetAssertionHandler() hasn't been used to
472 * provide a different function.
473 *
474 * \returns the default SDL_AssertionHandler that is called when an assert
475 * triggers.
476 *
477 * \threadsafety It is safe to call this function from any thread.
478 *
479 * \since This function is available since SDL 3.1.3.
480 *
481 * \sa SDL_GetAssertionHandler
482 */
483extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
484
485/**
486 * Get the current assertion handler.
487 *
488 * This returns the function pointer that is called when an assertion is
489 * triggered. This is either the value last passed to
490 * SDL_SetAssertionHandler(), or if no application-specified function is set,
491 * is equivalent to calling SDL_GetDefaultAssertionHandler().
492 *
493 * The parameter `puserdata` is a pointer to a void*, which will store the
494 * "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
495 * will always be NULL for the default handler. If you don't care about this
496 * data, it is safe to pass a NULL pointer to this function to ignore it.
497 *
498 * \param puserdata pointer which is filled with the "userdata" pointer that
499 * was passed to SDL_SetAssertionHandler().
500 * \returns the SDL_AssertionHandler that is called when an assert triggers.
501 *
502 * \threadsafety It is safe to call this function from any thread.
503 *
504 * \since This function is available since SDL 3.1.3.
505 *
506 * \sa SDL_SetAssertionHandler
507 */
508extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
509
510/**
511 * Get a list of all assertion failures.
512 *
513 * This function gets all assertions triggered since the last call to
514 * SDL_ResetAssertionReport(), or the start of the program.
515 *
516 * The proper way to examine this data looks something like this:
517 *
518 * ```c
519 * const SDL_AssertData *item = SDL_GetAssertionReport();
520 * while (item) {
521 * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
522 * item->condition, item->function, item->filename,
523 * item->linenum, item->trigger_count,
524 * item->always_ignore ? "yes" : "no");
525 * item = item->next;
526 * }
527 * ```
528 *
529 * \returns a list of all failed assertions or NULL if the list is empty. This
530 * memory should not be modified or freed by the application. This
531 * pointer remains valid until the next call to SDL_Quit() or
532 * SDL_ResetAssertionReport().
533 *
534 * \threadsafety This function is not thread safe. Other threads calling
535 * SDL_ResetAssertionReport() simultaneously, may render the
536 * returned pointer invalid.
537 *
538 * \since This function is available since SDL 3.1.3.
539 *
540 * \sa SDL_ResetAssertionReport
541 */
542extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
543
544/**
545 * Clear the list of all assertion failures.
546 *
547 * This function will clear the list of all assertions triggered up to that
548 * point. Immediately following this call, SDL_GetAssertionReport will return
549 * no items. In addition, any previously-triggered assertions will be reset to
550 * a trigger_count of zero, and their always_ignore state will be false.
551 *
552 * \threadsafety This function is not thread safe. Other threads triggering an
553 * assertion, or simultaneously calling this function may cause
554 * memory leaks or crashes.
555 *
556 * \since This function is available since SDL 3.1.3.
557 *
558 * \sa SDL_GetAssertionReport
559 */
560extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
561
562/* Ends C function definitions when using C++ */
563#ifdef __cplusplus
564}
565#endif
566#include <SDL3/SDL_close_code.h>
567
568#endif /* SDL_assert_h_ */
SDL_AssertState
Definition SDL_assert.h:204
@ SDL_ASSERTION_RETRY
Definition SDL_assert.h:205
@ SDL_ASSERTION_ABORT
Definition SDL_assert.h:207
@ SDL_ASSERTION_IGNORE
Definition SDL_assert.h:208
@ SDL_ASSERTION_BREAK
Definition SDL_assert.h:206
@ SDL_ASSERTION_ALWAYS_IGNORE
Definition SDL_assert.h:209
SDL_AssertState(* SDL_AssertionHandler)(const SDL_AssertData *data, void *userdata)
Definition SDL_assert.h:436
SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, const char *file, int line) SDL_ANALYZER_NORETURN
const SDL_AssertData * SDL_GetAssertionReport(void)
void SDL_ResetAssertionReport(void)
void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)
SDL_AssertionHandler SDL_GetDefaultAssertionHandler(void)
SDL_AssertionHandler SDL_GetAssertionHandler(void **puserdata)
#define SDL_ANALYZER_NORETURN
const struct SDL_AssertData * next
Definition SDL_assert.h:229
unsigned int trigger_count
Definition SDL_assert.h:224
const char * function
Definition SDL_assert.h:228
const char * filename
Definition SDL_assert.h:226
const char * condition
Definition SDL_assert.h:225