logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_min - Return the lesser of two values.

Availability

       This macro is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                                         SDL_min(3)

Description

       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.

Macro Parameters

x      the first value to compare.

       y      the second value to compare.

Name

       SDL_min - Return the lesser of two values.

Return Value

       Returns the lesser of x and y.

Synopsis

#include<SDL3/SDL_stdinc.h>#defineSDL_min(x,y)(((x)<(y))?(x):(y))

Thread Safety

       It is safe to call this macro from any thread.

See Also