SDL_FILE(3)

πŸ’– SDL_FILE(3) πŸ’–

the SDL3 functions era, but make it a macro ✨

okay bestie, so this is SDL_FILE, one of the lil SDL3 macros, and she's here to tell you which file is being compiled right now. group chat location sharing but for your preprocessor. πŸ’…


🌸 NAME 🌸

SDL_FILE β€” a macro that reports the current file being compiled. that's it, that's the whole job, and she does it flawlessly. πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_assert.h>

#define SDL_FILE    __FILE_NAME__

look at her. two lines. zero drama. iconic. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea: this macro is only defined if it isn't already defined. meaning if you roll up with your own SDL_FILE, SDL is not gonna fight you over it β€” it respects your hustle. 🫢

which is good news, because you might want to override it. specifically, you can define this macro before including SDL.h or SDL_assert.h if you want it to be something that doesn't provide path information at all.

and why would you do that, bestie? so that build machine information doesn't leak into public binaries. 😭 no cap, nobody needs your laptop's entire directory tree showing up in a shipped release. privacy is main character energy. πŸ’–

lowkey important: if you're overriding it, do it before the include, not after. the order is the whole vibe check. ⭐

🌈 AVAILABILITY 🌈

this macro has been available since SDL 3.2.0. so if you're on anything older, she simply does not exist yet. sorry babe. πŸ’€


mwah πŸ’‹ that's the page. go forth and compile responsibly. 🌸✨

signing off β€” brought to you by Simple Directmedia Layer, running the SDL 3.4.18 edition of these here manual pages. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from