mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 06:28:29 +00:00
Improved handling of function parameter validation
SDL supports the following use cases: * Normal operation with fast parameter checks (default): SDL_SetHint(SDL_HINT_INVALID_PARAM_CHECKS, "1"); * Object parameters are checked for use-after-free issues: SDL_SetHint(SDL_HINT_INVALID_PARAM_CHECKS, "2"); * Enable full validation, plus assert on invalid parameters: #define SDL_ASSERT_INVALID_PARAMS * Disable all parameter validation: #define SDL_DISABLE_INVALID_PARAMS
This commit is contained in:
@@ -685,6 +685,20 @@ extern "C" {
|
||||
*/
|
||||
#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
|
||||
|
||||
/**
|
||||
* Set the level of checking for invalid parameters passed to SDL functions.
|
||||
*
|
||||
* The variable can be set to the following values:
|
||||
*
|
||||
* - "1": Enable fast parameter error checking, e.g. quick NULL checks, etc. (default)
|
||||
* - "2": Enable full parameter error checking, e.g. validating objects are the correct type, etc.
|
||||
*
|
||||
* This hint can be set anytime.
|
||||
*
|
||||
* \since This hint is available since SDL 3.4.0.
|
||||
*/
|
||||
#define SDL_HINT_INVALID_PARAM_CHECKS "SDL_INVALID_PARAM_CHECKS"
|
||||
|
||||
/**
|
||||
* Disable giving back control to the browser automatically when running with
|
||||
* asyncify.
|
||||
|
Reference in New Issue
Block a user