SDL_FUNCTION(3)

πŸ’– SDL_FUNCTION πŸ’–

okay bestie, welcome to the SDL_FUNCTION page from the SDL3 functions manual, and honestly? it's a short one but it EATS. it's giving "tiny but mighty" fr fr ✨

🌸 NAME 🌸

SDL_FUNCTION β€” a constant that contains the current function being compiled. yes literally just that, it's the little macro that knows where it is at all times, main character energy tbh πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_assert.h>

#define SDL_FUNCTION __FUNCTION__

so you pull it in with that include, and it's defined as __FUNCTION__. that's it, that's the whole vibe πŸ¦‹


✨ DESCRIPTION ✨

it's a macro that hands you the name of the function currently being compiled. lowkey iconic for debug messages and asserts and stuff.

and here's the tea: if SDL can't figure out how your compiler reports this, it will use "???". like, it just shrugs and goes "???" β€” no cap, that's the actual fallback string πŸ’€

heads up bestie: that "???" is not a placeholder you get to interpret, it's literally what you'll see. so if your function name shows up as ???, that's SDL being honest about not knowing, not you breaking anything πŸ™ˆ

🌈 AVAILABILITY 🌈

this macro is available since SDL 3.2.0. so if you're on something older, sorry babe, it's not there yet 😭


and that's the whole page!! short, sweet, slayed. go forth and log your function names, you got this 🫢

sign-off time: this lil page comes from the Simple Directmedia Layer crew, straight out of SDL 3.4.18 β€” mwah, sending love, bye bestie πŸ’…πŸŒΈ

πŸ“¦ where this page comes from