SDL_assert_always

Macro SDL_assert_always 

Source
macro_rules! SDL_assert_always {
    ($condition:expr) => { ... };
}
Expand description

An assertion test that is always performed.

This macro is always enabled no matter what SDL_ASSERT_LEVEL is set to. You almost never want to use this, as it could trigger on an end-user’s system, crashing your program.

One can set the environment variable “SDL_ASSERT” to one of several strings (“abort”, “break”, “retry”, “ignore”, “always_ignore”) to force a default behavior, which may be desirable for automation purposes. If your platform requires GUI interfaces to happen on the main thread but you’re debugging an assertion in a background thread, it might be desirable to set this to “break” so that your debugger takes control as soon as assert is triggered, instead of risking a bad UI interaction (deadlock, etc) in the application.

§Parameters

  • condition: boolean value to test.

§Thread safety

It is safe to call this macro from any thread.

§Availability

This macro is available since SDL 3.2.0.