SDL_PLATFORM_ANDROID(3)

✨ SDL_PLATFORM_ANDROID ✨

okay so bestie, this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_PLATFORM_ANDROID πŸ’…

🌸 NAME 🌸

SDL_PLATFORM_ANDROID β€” a preprocessor macro that is only defined if you're compiling for Android. that's it. that's the whole vibe. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_platform_defines.h>

#define SDL_PLATFORM_ANDROID 1

so you pull in the header, and if the universe (and your compiler) says "yes, Android", then boom β€” SDL_PLATFORM_ANDROID is defined, and its value is literally 1. no cap. 🌈


πŸ¦‹ AVAILABILITY πŸ¦‹

this macro has been around since SDL 3.2.0. she's not new new, but she's not ancient either. iconic behavior honestly. πŸ‘‘

pro tip from your girl: this is a compile-time check, so don't go trying to use it at runtime β€” the preprocessor already decided your fate before your program even existed. πŸ™ˆ

Simple Directmedia Layer β€’ SDL 3.4.18 β€” that's the source and the version this page came from, mwah πŸ’– k bye, go compile something cute for Android, ily! πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from