Multiply two integers, checking for overflow.
Defined in <SDL3/SDL_stdinc.h>
size_t a, size_t b, size_t *ret); SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(
size_t | a | the multiplicand. |
size_t | b | the multiplier. |
size_t * | ret | on non-overflow output, stores the multiplication result. May not be NULL. |
(SDL_bool) Returns SDL_FALSE on overflow, SDL_TRUE if result is multiplied without overflow.
If a * b
would overflow, return SDL_FALSE.
Otherwise store a * b
via ret and return SDL_TRUE.
It is safe to call this function from any thread.
This function is available since SDL 3.0.0.