SDLMAIN_DECLSPEC(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’… SDLMAIN_DECLSPEC(3) β€” the SDL3 FUNCTIONS girlies' edition

okay bestie so welcome to the SDL3 functions manual, and today's main character is SDLMAIN_DECLSPEC πŸ’–


✨ NAME ✨

SDLMAIN_DECLSPEC β€” it's a macro that tags a main entry point function as exported. that's it, that's the whole job, and it does it gorgeously πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_main.h>

#define SDLMAIN_DECLSPEC

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: most platforms genuinely do not need this, and on those platforms the macro is just defined to nothing. literally nothing. empty. a void. it's giving "i'm here but i'm not doing anything" πŸ’€

but some platforms β€” like Android β€” keep the entry points inside a shared library, and they need to explicitly export the symbols. so on those, the macro actually has to show up and do the work. main character energy only when required, periodt πŸ‘‘

and for external code? it rarely needs this at all. like, genuinely rarely. and if it does need something, it's almost always SDL_DECLSPEC instead 🫢 so if you're sitting there wondering "is this the one i want", the answer is lowkey probably no and you want SDL_DECLSPEC. iykyk.


⭐ AVAILABILITY ⭐

this macro has been available since SDL 3.2.0 ✨ so if you're on anything older, no she's not there yet, sorry babe πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


Simple Directmedia Layer β€’ SDL 3.4.18 β€” and that's the whole page bestie, tysm for reading, go export something iconic πŸ’…πŸŒˆπŸŽ€

πŸ“¦ where this page comes from