DOKK / manpages / debian 13 / libsdl3-doc / SDL_min.3.en
SDL_min(3) SDL3 FUNCTIONS SDL_min(3)

SDL_min - Return the lesser of two values.

Defined in SDL3/SDL_stdinc.h

#include "SDL3/SDL.h"
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))

This is a helper macro that might be more clear than writing out the comparisons directly, and works with any type that can be compared with the < operator. However, it double-evaluates both its parameters, so do not use expressions with side-effects here.

Returns the lesser of x and y .

It is safe to call this macro from any thread.

This macro is available since SDL 3.2.0.

SDL 3.2.10 Simple Directmedia Layer