SDL_max(3)

SDL_max3

Return the greater of two values.

Usage

#include "SDL3/SDL.h"

#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))

Header file

Defined in SDL3/SDL_stdinc.h

Overview

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.

Return value

Returns the lesser of x and y .

Thread safety

It is safe to call this macro from any thread.

Availability

This macro is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.