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_const_cast - Handle a Const Cast properly whether using C or C++.

Availability

       This macro is available since SDL 3.2.0.

Description

       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++.

Macro Parameters

type   the type to cast the expression to.

       expression
              the expression to cast to a different type.

Name

       SDL_const_cast - Handle a Const Cast properly whether using C or C++.

Return Value

       Returns expression, cast to type.

See Also

SDL_reinterpret_cast(3), SDL_static_cast(3)

Simple Directmedia Layer                           SDL 3.2.20                                  SDL_const_cast(3)

Synopsis

#include<SDL3/SDL_stdinc.h>#defineSDL_const_cast(type,expression)const_cast<type>(expression)/*or`((type)(expression))`inC*/

Thread Safety

       It is safe to call this macro from any thread.

See Also