SDL_PRILL_PREFIX(3)

πŸ’… SDL_PRILL_PREFIX(3) β€” SDL3 FUNCTIONS ✨

okay bestie, welcome to the SDL3 corner of the man pages, this one's a lil baby macro and honestly? it's iconic for what it does. πŸŽ€


🌸 NAME 🌸

SDL_PRILL_PREFIX β€” a printf-formatting string prefix for a long long value. that's it. that's the whole job. she's a prefix and she's slaying. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

#define SDL_PRILL_PREFIX "ll"

like. she's just the two letters ll. no cap.


✨ DESCRIPTION ✨

okay so listen. SDL_PRILL_PREFIX is just the prefix. that's the whole thing. it is not the main character of your format string, it's the supporting role. 🫢

if you're actually trying to print a long long, you highkey probably want one of her sisters instead:

  • SDL_PRILLd
  • SDL_PRILLu
  • SDL_PRILLx
  • SDL_PRILLX

but if you're out here hand-assembling your own format string and you need the prefix bit to do it, she's right there for you. πŸ’–

use it like this:

SDL_Log("There are %" SDL_PRILL_PREFIX "d bottles of beer on the wall.", bottles);

see how the "ll" just slots in between the % and the d? it's giving ✨string concatenation✨, it's giving C preprocessor girlbossery, it's giving portable long long formatting. the way that she just works across platforms so you don't have to guess whether your compiler wants ll or something else. obsessed. 😭


🌈 AVAILABILITY 🌈

this macro is available since SDL 3.2.0. so if you're on something older, bestie, she is not there and you will get a compile error, and that's on you fr fr. πŸ’€


ngl, if you only take one thing from this page: this is a prefix, not a full format specifier. do not pass her to printf alone and expect magic. she needs a conversion character to complete her. it's a two-piece situation. πŸ‘‘

Simple Directmedia Layer β€” SDL 3.4.18 πŸ’œ

and that's the whole page, bestie!! go forth and format your long longs responsibly, mwah, ily, bye πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from