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