SDL_PLATFORM_LINUX(3)

✨ NAME ✨

SDL_PLATFORM_LINUX β€” bestie, it's a preprocessor macro, and it is only defined if you're compiling for Linux. That's it, that's the whole job πŸ’…

Oh also, hey, this is a page from the SDL3 FUNCTIONS manual, in case you were wondering where you wandered into πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_platform_defines.h>

#define SDL_PLATFORM_LINUX 1

Like, you don't call it, you don't link it, it just exists the second you're building on Linux. No cap. ✨


πŸ’– DESCRIPTION πŸ’–

So here's the tea, and it's actually important tea πŸ«–: Android is, like, ostensibly a Linux-based system, right? Everyone says that. But it will not define this macro. Nope. Not happening.

Android defines SDL_PLATFORM_ANDROID instead. That's its whole separate thing. So if you're out here writing #ifdef SDL_PLATFORM_LINUX and expecting your Android build to tag along, it will simply not show up to the party 😭

fr fr, don't assume "Linux kernel underneath" means "this macro is defined". Check for SDL_PLATFORM_ANDROID if that's what you actually mean πŸ‘‘

πŸŽ€ AVAILABILITY πŸŽ€

This macro has been available since SDL 3.2.0. So if you're on something older, it's giving... nothing. Upgrade, queen 🌈


Simple Directmedia Layer β€’ SDL 3.4.18 β€” that's the source and version of this little page, mwah, thanks for reading bestie, go compile something iconic πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from