SDL_GetRevision(3)

✨ NAME ✨

SDL_GetRevision β€” bestie, this is how you get the code revision of the SDL library that's actually linked against your program πŸ’– (yes, the one you're running, not the one you're compiling with, they can be different, we'll get to that).

This lives in the SDL3 FUNCTIONS corner of the manual, and honestly? It's giving "just tell me what hash I'm on" energy.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_version.h>

const char * SDL_GetRevision(void);

That's it. No args. No drama. She takes nothing and gives you a string πŸŽ€


πŸ’… DESCRIPTION πŸ’…

okay so, the value you get back is the revision of the code you are linking against, and heads up β€” it may be different from the code you are compiling with, which is found in the constant SDL_REVISION if you explicitly include SDL_revision.h. two different numbers, two different jobs, don't mix them up πŸ™ˆ

The revision is an arbitrary string (a hash value) uniquely identifying the exact revision of the SDL library in use, and it is only useful in comparing against other revisions. She is NOT an incrementing number. Not 1, not 2, not 47. A hash. Say it with me 🫢

If SDL wasn't built from a git repository with the appropriate tools, this will return an empty string. so if you're staring at "" wondering why she's silent… that's why 😭

girl. You shouldn't use this function for anything but logging it for debugging purposes. The string is not intended to be reliable in any way. Do not parse it. Do not gate logic on it. Do not build your whole personality around it. Just log it and move on πŸ‘‘

⭐ RETURN VALUE ⭐

Returns an arbitrary string, uniquely identifying the exact revision of the SDL library in use. A string, bestie. A vibe, in text form. That's the whole deal ✨


🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. Every thread. All the threads. Slay 🌈


πŸ¦‹ AVAILABILITY πŸ¦‹

This function is available since SDL 3.2.0. if you're on anything older, she's simply not there yet, no cap.


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, you ate it, congrats πŸŽ€ This came out of the Simple Directmedia Layer corner of the world, and this particular page is hanging out with SDL 3.4.18 (the page itself doesn't shout a date at us, so we're just repping the source and the version, periodt). Go log your revision and log off, ily πŸ’–βœ¨

πŸ“¦ where this page comes from