SDL_const_cast(3)

SDL_const_cast3

Handle a const cast properly whether using c or c++.

Usage

#include "SDL3/SDL.h"

#define SDL_const_cast(type, expression) const_cast<type>(expression) /* or `((type)(expression))` in C */

Header file

Defined in SDL3/SDL_stdinc.h

Overview

If compiled as C++, this macro offers a proper C++ const_cast<>.

If compiled as C, this macro does a normal C-style cast.

This is helpful to avoid compiler warnings in C++.

Return value

Returns expression , cast to type .

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.