SDL_VERSION(3)

πŸ’– SDL_VERSION πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_VERSION β€” literally the version number macro for the current SDL version. that's it, that's the whole vibe. she's small, she's iconic, she's giving build-time truth serum ✨


🌸 NAME 🌸

SDL_VERSION β€” the version number macro for the current SDL version πŸŽ€


✨ SYNOPSIS ✨

lowkey the whole thing is two lines, no cap:

#include <SDL3/SDL_version.h>

#define SDL_VERSION \
    SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION)

see how she just glues SDL_MAJOR_VERSION, SDL_MINOR_VERSION and SDL_MICRO_VERSION together through SDL_VERSIONNUM? that's the whole trick, fr fr πŸ’…


🧡 THREAD SAFETY 🧡

good news, bestie: it is safe to call this macro from any thread. every single one. go wild, no locks needed, she's not that kind of girl πŸ¦‹


πŸ“… AVAILABILITY πŸ“…

this macro has been around since SDL 3.2.0. vintage-ish but not ancient, yk? πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


and that's the page!! this lil beauty lives in the Simple Directmedia Layer manual, documented as SDL 3.4.18, and she's filed under SDL_VERSION(3). mwah, go compile something cute πŸ’–πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from