SDL_DEPRECATED(3)
π SDL_DEPRECATED(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we talk about the lil macro that slaps a "this is so last season" sticker on stuff. it's giving SDL_DEPRECATED, and honestly? iconic.
β¨ NAME β¨
SDL_DEPRECATED β a macro to tag a symbol as deprecated. that's it, that's the whole job, and it does it flawlessly π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_begin_code.h>
#define SDL_DEPRECATED __attribute__((deprecated))
like. look at her. one line. no notes. π
π¦ DESCRIPTION π¦
so here's the vibe: you mark a function as deprecated by adding this macro to its declaration, like this:
extern SDL_DEPRECATED int ThisFunctionWasABadIdea(void);
and yes, that function name is literally in the official docs, the SDL girlies were being so real with that one π
compilers that have deprecation support can throw a warning whenever somebody uses a deprecated function. and here's the cute part: this symbol lives in SDL's headers, but apps are totally welcome to use it for their own interfaces too. share the love, share the macro π«Ά
now, SDL, on occasion, might deprecate a function for various reasons. various reasons. don't ask. but listen up, because this is the important bit: SDL never removes symbols before major versions. so deprecated interfaces in SDL3 are staying right where they are until SDL4. by then, it'd be expected that an app would have to take steps to migrate anyhow. so like, no surprises, no rug pulls, the timeline is known. periodt. π
and if you're on a compiler that doesn't have any deprecation mechanism at all? this macro is defined to nothing, and using a deprecated function won't generate a warning. so, y'know, it's just vibes at that point. no warning, no drama, no heads-up. π
β AVAILABILITY β
this macro is available since SDL 3.2.0. so if you're on anything older, sorry babe, she wasn't born yet π
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_DEPRECATED(3)
and that's the whole page bestie, mwah π thanks for reading, go forth and deprecate responsibly ππβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms