SDLMAIN_DECLSPEC(3)
π 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 π
SDL_DECLSPEC(3)β the one you actually want, fr fr π
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
- 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