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 π
SDL_GetVersion(3)β your other bestie, the one with actual numbers π
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
- 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