SDL_PRIs32(3)
π SDL_PRIs32 β the manual page, but make it cute
okay so bestie, you're reading the page for SDL_PRIs32 from the SDL3 FUNCTIONS manual, and honestly? it's a tiny one but it's an absolute icon. β¨
πΈ NAME πΈ
SDL_PRIs32 β a printf-formatting string for an Sint32 value. π
That's it. That's the whole job. And it does it flawlessly.
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
#define SDL_PRIs32 "d"
not me looking at a macro whose entire body is literally just "d" π iconic behavior, no notes.
π¦ DESCRIPTION π¦
So the vibe is: you want to print an Sint32 with printf-style formatting, and you want to do it portably, because hardcoding the wrong length modifier is how you get cursed output on some platform you've never even heard of. That's the whole reason this macro exists β it expands to the right string for your setup. π
Use it like this, fr fr:
SDL_Log("There are %" SDL_PRIs32 " bottles of beer on the wall.", bottles);
see what she did there? The format string is split around the macro. The % lives in the first literal, SDL_PRIs32 supplies the conversion specifier right after it, and then the rest of the string picks back up. It's giving string-literal sandwich π₯ͺ and it works because the preprocessor glues adjacent string literals together. Slay. π
no cap: the macro goes between the%and the rest of your text. Don't put the%inside it, don't wrap it in quotes, just let it sit there in the middle doing its little job. π«Ά
π AVAILABILITY π
This macro is available since SDL 3.2.0. π
So if you're on anything older, it's simply not there yet β check your version before you start yelling at the compiler. π
and that's the page!! π This one came from the Simple Directmedia Layer crew, SDL 3.4.18 era, and it's filed under SDL_PRIs32(3). ily, go format some integers 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