Path: blob/master/thirdparty/sdl/include/SDL3/SDL_assert.h
9912 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/**22* # CategoryAssert23*24* A helpful assertion macro!25*26* SDL assertions operate like your usual `assert` macro, but with some added27* features:28*29* - It uses a trick with the `sizeof` operator, so disabled assertions30* vaporize out of the compiled code, but variables only referenced in the31* assertion won't trigger compiler warnings about being unused.32* - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else33* do_something();`34* - It works the same everywhere, instead of counting on various platforms'35* compiler and C runtime to behave.36* - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,37* SDL_assert_paranoid) instead of a single all-or-nothing option.38* - It offers a variety of responses when an assertion fails (retry, trigger39* the debugger, abort the program, ignore the failure once, ignore it for40* the rest of the program's run).41* - It tries to show the user a dialog by default, if possible, but the app42* can provide a callback to handle assertion failures however they like.43* - It lets failed assertions be retried. Perhaps you had a network failure44* and just want to retry the test after plugging your network cable back45* in? You can.46* - It lets the user ignore an assertion failure, if there's a harmless47* problem that one can continue past.48* - It lets the user mark an assertion as ignored for the rest of the49* program's run; if there's a harmless problem that keeps popping up.50* - It provides statistics and data on all failed assertions to the app.51* - It allows the default assertion handler to be controlled with environment52* variables, in case an automated script needs to control it.53* - It can be used as an aid to Clang's static analysis; it will treat SDL54* assertions as universally true (under the assumption that you are serious55* about the asserted claims and that your debug builds will detect when56* these claims were wrong). This can help the analyzer avoid false57* positives.58*59* To use it: compile a debug build and just sprinkle around tests to check60* your code!61*/6263#ifndef SDL_assert_h_64#define SDL_assert_h_6566#include <SDL3/SDL_stdinc.h>6768#include <SDL3/SDL_begin_code.h>69/* Set up for C function definitions, even when using C++ */70#ifdef __cplusplus71extern "C" {72#endif7374#ifdef SDL_WIKI_DOCUMENTATION_SECTION7576/**77* The level of assertion aggressiveness.78*79* This value changes depending on compiler options and other preprocessor80* defines.81*82* It is currently one of the following values, but future SDL releases might83* add more:84*85* - 0: All SDL assertion macros are disabled.86* - 1: Release settings: SDL_assert disabled, SDL_assert_release enabled.87* - 2: Debug settings: SDL_assert and SDL_assert_release enabled.88* - 3: Paranoid settings: All SDL assertion macros enabled, including89* SDL_assert_paranoid.90*91* \since This macro is available since SDL 3.2.0.92*/93#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors9495#elif !defined(SDL_ASSERT_LEVEL)96#ifdef SDL_DEFAULT_ASSERT_LEVEL97#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL98#elif defined(_DEBUG) || defined(DEBUG) || \99(defined(__GNUC__) && !defined(__OPTIMIZE__))100#define SDL_ASSERT_LEVEL 2101#else102#define SDL_ASSERT_LEVEL 1103#endif104#endif105106#ifdef SDL_WIKI_DOCUMENTATION_SECTION107108/**109* Attempt to tell an attached debugger to pause.110*111* This allows an app to programmatically halt ("break") the debugger as if it112* had hit a breakpoint, allowing the developer to examine program state, etc.113*114* This is a macro--not a function--so that the debugger breaks on the source115* code line that used SDL_TriggerBreakpoint and not in some random guts of116* SDL. SDL_assert uses this macro for the same reason.117*118* If the program is not running under a debugger, SDL_TriggerBreakpoint will119* likely terminate the app, possibly without warning. If the current platform120* isn't supported, this macro is left undefined.121*122* \threadsafety It is safe to call this macro from any thread.123*124* \since This macro is available since SDL 3.2.0.125*/126#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner127128#elif defined(_MSC_VER) && _MSC_VER >= 1310129/* Don't include intrin.h here because it contains C++ code */130extern void __cdecl __debugbreak(void);131#define SDL_TriggerBreakpoint() __debugbreak()132#elif defined(_MSC_VER) && defined(_M_IX86)133#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }134#elif defined(ANDROID)135#include <assert.h>136#define SDL_TriggerBreakpoint() assert(0)137#elif SDL_HAS_BUILTIN(__builtin_debugtrap)138#define SDL_TriggerBreakpoint() __builtin_debugtrap()139#elif SDL_HAS_BUILTIN(__builtin_trap)140#define SDL_TriggerBreakpoint() __builtin_trap()141#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))142#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )143#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)144#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )145#elif ( defined(SDL_PLATFORM_APPLE) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */146#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )147#elif defined(SDL_PLATFORM_APPLE) && defined(__arm__)148#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )149#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )150#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )151#elif defined(__GNUC__) || defined(__clang__)152#define SDL_TriggerBreakpoint() __builtin_trap() /* older gcc may not support SDL_HAS_BUILTIN(__builtin_trap) above */153#elif defined(__386__) && defined(__WATCOMC__)154#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }155#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)156#include <signal.h>157#define SDL_TriggerBreakpoint() raise(SIGTRAP)158#else159/* SDL_TriggerBreakpoint is intentionally left undefined on unknown platforms. */160#endif161162#ifdef SDL_WIKI_DOCUMENTATION_SECTION163164/**165* A macro that reports the current function being compiled.166*167* If SDL can't figure how the compiler reports this, it will use "???".168*169* \since This macro is available since SDL 3.2.0.170*/171#define SDL_FUNCTION __FUNCTION__172173#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */174# define SDL_FUNCTION __func__175#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))176# define SDL_FUNCTION __FUNCTION__177#else178# define SDL_FUNCTION "???"179#endif180181/**182* A macro that reports the current file being compiled.183*184* \since This macro is available since SDL 3.2.0.185*/186#define SDL_FILE __FILE__187188/**189* A macro that reports the current line number of the file being compiled.190*191* \since This macro is available since SDL 3.2.0.192*/193#define SDL_LINE __LINE__194195/*196sizeof (x) makes the compiler still parse the expression even without197assertions enabled, so the code is always checked at compile time, but198doesn't actually generate code for it, so there are no side effects or199expensive checks at run time, just the constant size of what x WOULD be,200which presumably gets optimized out as unused.201This also solves the problem of...202203int somevalue = blah();204SDL_assert(somevalue == 1);205206...which would cause compiles to complain that somevalue is unused if we207disable assertions.208*/209210#ifdef SDL_WIKI_DOCUMENTATION_SECTION211212/**213* A macro for wrapping code in `do {} while (0);` without compiler warnings.214*215* Visual Studio with really aggressive warnings enabled needs this to avoid216* compiler complaints.217*218* the `do {} while (0);` trick is useful for wrapping code in a macro that219* may or may not be a single statement, to avoid various C language220* accidents.221*222* To use:223*224* ```c225* do { SomethingOnce(); } while (SDL_NULL_WHILE_LOOP_CONDITION (0));226* ```227*228* \since This macro is available since SDL 3.2.0.229*/230#define SDL_NULL_WHILE_LOOP_CONDITION (0)231232#elif defined(_MSC_VER) /* Avoid /W4 warnings. */233/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking234this condition isn't constant. And looks like an owl's face! */235#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)236#else237#define SDL_NULL_WHILE_LOOP_CONDITION (0)238#endif239240/**241* The macro used when an assertion is disabled.242*243* This isn't for direct use by apps, but this is the code that is inserted244* when an SDL_assert is disabled (perhaps in a release build).245*246* The code does nothing, but wraps `condition` in a sizeof operator, which247* generates no code and has no side effects, but avoid compiler warnings248* about unused variables.249*250* \param condition the condition to assert (but not actually run here).251*252* \since This macro is available since SDL 3.2.0.253*/254#define SDL_disabled_assert(condition) \255do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)256257/**258* Possible outcomes from a triggered assertion.259*260* When an enabled assertion triggers, it may call the assertion handler261* (possibly one provided by the app via SDL_SetAssertionHandler), which will262* return one of these values, possibly after asking the user.263*264* Then SDL will respond based on this outcome (loop around to retry the265* condition, try to break in a debugger, kill the program, or ignore the266* problem).267*268* \since This enum is available since SDL 3.2.0.269*/270typedef enum SDL_AssertState271{272SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */273SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */274SDL_ASSERTION_ABORT, /**< Terminate the program. */275SDL_ASSERTION_IGNORE, /**< Ignore the assert. */276SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */277} SDL_AssertState;278279/**280* Information about an assertion failure.281*282* This structure is filled in with information about a triggered assertion,283* used by the assertion handler, then added to the assertion report. This is284* returned as a linked list from SDL_GetAssertionReport().285*286* \since This struct is available since SDL 3.2.0.287*/288typedef struct SDL_AssertData289{290bool always_ignore; /**< true if app should always continue when assertion is triggered. */291unsigned int trigger_count; /**< Number of times this assertion has been triggered. */292const char *condition; /**< A string of this assert's test code. */293const char *filename; /**< The source file where this assert lives. */294int linenum; /**< The line in `filename` where this assert lives. */295const char *function; /**< The name of the function where this assert lives. */296const struct SDL_AssertData *next; /**< next item in the linked list. */297} SDL_AssertData;298299/**300* Never call this directly.301*302* Use the SDL_assert macros instead.303*304* \param data assert data structure.305* \param func function name.306* \param file file name.307* \param line line number.308* \returns assert state.309*310* \threadsafety It is safe to call this function from any thread.311*312* \since This function is available since SDL 3.2.0.313*/314extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,315const char *func,316const char *file, int line) SDL_ANALYZER_NORETURN;317318319#ifdef SDL_WIKI_DOCUMENTATION_SECTION320321/**322* The macro used when an assertion triggers a breakpoint.323*324* This isn't for direct use by apps; use SDL_assert or SDL_TriggerBreakpoint325* instead.326*327* \since This macro is available since SDL 3.2.0.328*/329#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()330331#elif !defined(SDL_AssertBreakpoint)332# if defined(ANDROID) && defined(assert)333/* Define this as empty in case assert() is defined as SDL_assert */334# define SDL_AssertBreakpoint()335# else336# define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()337# endif338#endif /* !SDL_AssertBreakpoint */339340/**341* The macro used when an assertion is enabled.342*343* This isn't for direct use by apps, but this is the code that is inserted344* when an SDL_assert is enabled.345*346* The `do {} while(0)` avoids dangling else problems:347*348* ```c349* if (x) SDL_assert(y); else blah();350* ```351*352* ... without the do/while, the "else" could attach to this macro's "if". We353* try to handle just the minimum we need here in a macro...the loop, the354* static vars, and break points. The heavy lifting is handled in355* SDL_ReportAssertion().356*357* \param condition the condition to assert.358*359* \since This macro is available since SDL 3.2.0.360*/361#define SDL_enabled_assert(condition) \362do { \363while ( !(condition) ) { \364static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \365const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \366if (sdl_assert_state == SDL_ASSERTION_RETRY) { \367continue; /* go again. */ \368} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \369SDL_AssertBreakpoint(); \370} \371break; /* not retrying. */ \372} \373} while (SDL_NULL_WHILE_LOOP_CONDITION)374375#ifdef SDL_WIKI_DOCUMENTATION_SECTION376377/**378* An assertion test that is normally performed only in debug builds.379*380* This macro is enabled when the SDL_ASSERT_LEVEL is >= 2, otherwise it is381* disabled. This is meant to only do these tests in debug builds, so they can382* tend to be more expensive, and they are meant to bring everything to a halt383* when they fail, with the programmer there to assess the problem.384*385* In short: you can sprinkle these around liberally and assume they will386* evaporate out of the build when building for end-users.387*388* When assertions are disabled, this wraps `condition` in a `sizeof`389* operator, which means any function calls and side effects will not run, but390* the compiler will not complain about any otherwise-unused variables that391* are only referenced in the assertion.392*393* One can set the environment variable "SDL_ASSERT" to one of several strings394* ("abort", "break", "retry", "ignore", "always_ignore") to force a default395* behavior, which may be desirable for automation purposes. If your platform396* requires GUI interfaces to happen on the main thread but you're debugging397* an assertion in a background thread, it might be desirable to set this to398* "break" so that your debugger takes control as soon as assert is triggered,399* instead of risking a bad UI interaction (deadlock, etc) in the application.400*401* \param condition boolean value to test.402*403* \threadsafety It is safe to call this macro from any thread.404*405* \since This macro is available since SDL 3.2.0.406*/407#define SDL_assert(condition) if (assertion_enabled && (condition)) { trigger_assertion; }408409/**410* An assertion test that is performed even in release builds.411*412* This macro is enabled when the SDL_ASSERT_LEVEL is >= 1, otherwise it is413* disabled. This is meant to be for tests that are cheap to make and414* extremely unlikely to fail; generally it is frowned upon to have an415* assertion failure in a release build, so these assertions generally need to416* be of more than life-and-death importance if there's a chance they might417* trigger. You should almost always consider handling these cases more418* gracefully than an assert allows.419*420* When assertions are disabled, this wraps `condition` in a `sizeof`421* operator, which means any function calls and side effects will not run, but422* the compiler will not complain about any otherwise-unused variables that423* are only referenced in the assertion.424*425* One can set the environment variable "SDL_ASSERT" to one of several strings426* ("abort", "break", "retry", "ignore", "always_ignore") to force a default427* behavior, which may be desirable for automation purposes. If your platform428* requires GUI interfaces to happen on the main thread but you're debugging429* an assertion in a background thread, it might be desirable to set this to430* "break" so that your debugger takes control as soon as assert is triggered,431* instead of risking a bad UI interaction (deadlock, etc) in the application.432* *433*434* \param condition boolean value to test.435*436* \threadsafety It is safe to call this macro from any thread.437*438* \since This macro is available since SDL 3.2.0.439*/440#define SDL_assert_release(condition) SDL_disabled_assert(condition)441442/**443* An assertion test that is performed only when built with paranoid settings.444*445* This macro is enabled when the SDL_ASSERT_LEVEL is >= 3, otherwise it is446* disabled. This is a higher level than both release and debug, so these447* tests are meant to be expensive and only run when specifically looking for448* extremely unexpected failure cases in a special build.449*450* When assertions are disabled, this wraps `condition` in a `sizeof`451* operator, which means any function calls and side effects will not run, but452* the compiler will not complain about any otherwise-unused variables that453* are only referenced in the assertion.454*455* One can set the environment variable "SDL_ASSERT" to one of several strings456* ("abort", "break", "retry", "ignore", "always_ignore") to force a default457* behavior, which may be desirable for automation purposes. If your platform458* requires GUI interfaces to happen on the main thread but you're debugging459* an assertion in a background thread, it might be desirable to set this to460* "break" so that your debugger takes control as soon as assert is triggered,461* instead of risking a bad UI interaction (deadlock, etc) in the application.462*463* \param condition boolean value to test.464*465* \threadsafety It is safe to call this macro from any thread.466*467* \since This macro is available since SDL 3.2.0.468*/469#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)470471/* Enable various levels of assertions. */472#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */473# define SDL_assert(condition) SDL_disabled_assert(condition)474# define SDL_assert_release(condition) SDL_disabled_assert(condition)475# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)476#elif SDL_ASSERT_LEVEL == 1 /* release settings. */477# define SDL_assert(condition) SDL_disabled_assert(condition)478# define SDL_assert_release(condition) SDL_enabled_assert(condition)479# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)480#elif SDL_ASSERT_LEVEL == 2 /* debug settings. */481# define SDL_assert(condition) SDL_enabled_assert(condition)482# define SDL_assert_release(condition) SDL_enabled_assert(condition)483# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)484#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */485# define SDL_assert(condition) SDL_enabled_assert(condition)486# define SDL_assert_release(condition) SDL_enabled_assert(condition)487# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)488#else489# error Unknown assertion level.490#endif491492/**493* An assertion test that is always performed.494*495* This macro is always enabled no matter what SDL_ASSERT_LEVEL is set to. You496* almost never want to use this, as it could trigger on an end-user's system,497* crashing your program.498*499* One can set the environment variable "SDL_ASSERT" to one of several strings500* ("abort", "break", "retry", "ignore", "always_ignore") to force a default501* behavior, which may be desirable for automation purposes. If your platform502* requires GUI interfaces to happen on the main thread but you're debugging503* an assertion in a background thread, it might be desirable to set this to504* "break" so that your debugger takes control as soon as assert is triggered,505* instead of risking a bad UI interaction (deadlock, etc) in the application.506*507* \param condition boolean value to test.508*509* \threadsafety It is safe to call this macro from any thread.510*511* \since This macro is available since SDL 3.2.0.512*/513#define SDL_assert_always(condition) SDL_enabled_assert(condition)514515516/**517* A callback that fires when an SDL assertion fails.518*519* \param data a pointer to the SDL_AssertData structure corresponding to the520* current assertion.521* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().522* \returns an SDL_AssertState value indicating how to handle the failure.523*524* \threadsafety This callback may be called from any thread that triggers an525* assert at any time.526*527* \since This datatype is available since SDL 3.2.0.528*/529typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(530const SDL_AssertData *data, void *userdata);531532/**533* Set an application-defined assertion handler.534*535* This function allows an application to show its own assertion UI and/or536* force the response to an assertion failure. If the application doesn't537* provide this, SDL will try to do the right thing, popping up a538* system-specific GUI dialog, and probably minimizing any fullscreen windows.539*540* This callback may fire from any thread, but it runs wrapped in a mutex, so541* it will only fire from one thread at a time.542*543* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!544*545* \param handler the SDL_AssertionHandler function to call when an assertion546* fails or NULL for the default handler.547* \param userdata a pointer that is passed to `handler`.548*549* \threadsafety It is safe to call this function from any thread.550*551* \since This function is available since SDL 3.2.0.552*553* \sa SDL_GetAssertionHandler554*/555extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(556SDL_AssertionHandler handler,557void *userdata);558559/**560* Get the default assertion handler.561*562* This returns the function pointer that is called by default when an563* assertion is triggered. This is an internal function provided by SDL, that564* is used for assertions when SDL_SetAssertionHandler() hasn't been used to565* provide a different function.566*567* \returns the default SDL_AssertionHandler that is called when an assert568* triggers.569*570* \threadsafety It is safe to call this function from any thread.571*572* \since This function is available since SDL 3.2.0.573*574* \sa SDL_GetAssertionHandler575*/576extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);577578/**579* Get the current assertion handler.580*581* This returns the function pointer that is called when an assertion is582* triggered. This is either the value last passed to583* SDL_SetAssertionHandler(), or if no application-specified function is set,584* is equivalent to calling SDL_GetDefaultAssertionHandler().585*586* The parameter `puserdata` is a pointer to a void*, which will store the587* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value588* will always be NULL for the default handler. If you don't care about this589* data, it is safe to pass a NULL pointer to this function to ignore it.590*591* \param puserdata pointer which is filled with the "userdata" pointer that592* was passed to SDL_SetAssertionHandler().593* \returns the SDL_AssertionHandler that is called when an assert triggers.594*595* \threadsafety It is safe to call this function from any thread.596*597* \since This function is available since SDL 3.2.0.598*599* \sa SDL_SetAssertionHandler600*/601extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);602603/**604* Get a list of all assertion failures.605*606* This function gets all assertions triggered since the last call to607* SDL_ResetAssertionReport(), or the start of the program.608*609* The proper way to examine this data looks something like this:610*611* ```c612* const SDL_AssertData *item = SDL_GetAssertionReport();613* while (item) {614* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",615* item->condition, item->function, item->filename,616* item->linenum, item->trigger_count,617* item->always_ignore ? "yes" : "no");618* item = item->next;619* }620* ```621*622* \returns a list of all failed assertions or NULL if the list is empty. This623* memory should not be modified or freed by the application. This624* pointer remains valid until the next call to SDL_Quit() or625* SDL_ResetAssertionReport().626*627* \threadsafety This function is not thread safe. Other threads calling628* SDL_ResetAssertionReport() simultaneously, may render the629* returned pointer invalid.630*631* \since This function is available since SDL 3.2.0.632*633* \sa SDL_ResetAssertionReport634*/635extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);636637/**638* Clear the list of all assertion failures.639*640* This function will clear the list of all assertions triggered up to that641* point. Immediately following this call, SDL_GetAssertionReport will return642* no items. In addition, any previously-triggered assertions will be reset to643* a trigger_count of zero, and their always_ignore state will be false.644*645* \threadsafety This function is not thread safe. Other threads triggering an646* assertion, or simultaneously calling this function may cause647* memory leaks or crashes.648*649* \since This function is available since SDL 3.2.0.650*651* \sa SDL_GetAssertionReport652*/653extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);654655/* Ends C function definitions when using C++ */656#ifdef __cplusplus657}658#endif659#include <SDL3/SDL_close_code.h>660661#endif /* SDL_assert_h_ */662663664