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
- 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