SDL_AUDIO_ISLITTLEENDIAN(3)
π SDL_AUDIO_ISLITTLEENDIAN π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_AUDIO_ISLITTLEENDIAN(3) β yes the whole thing is SCREAMING, that's just how macros are, they're loud and they're proud π«Ά
β¨ NAME β¨
SDL_AUDIO_ISLITTLEENDIAN β Determine if an SDL_AudioFormat represents littleendian data.
like. that's the whole vibe check. is this audio format littleendian or not. boom. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_audio.h>
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
ngl the way this macro is literally just the opposite of the bigendian check? iconic. it said "why do the work myself when I can just flip a boolean" and honestly? valid. π
β¨ DESCRIPTION β¨
So here's the tea, bestie π β this macro tells you whether a given SDL_AudioFormat value is littleendian. It does that by asking SDL_AUDIO_ISBIGENDIAN(x) and then going "not that."
For example, SDL_AUDIO_ISLITTLEENDIAN(SDL_AUDIO_S16BE) returns 0.
and yeah, that 0 is not a typo, not a glitch, not a bad take β that format is BE as in BIG endian, so it is very much NOT littleendian, so you get a big fat zero. the macro is correct and it is thriving. β¨
β¨ MACRO PARAMETERS β¨
xβ anSDL_AudioFormatvalue. that's it, that's the whole input. one (1) value. no notes. π
β¨ RETURN VALUE β¨
- Returns non-zero if format is littleendian πΈ
- Returns zero otherwise
so like, if it's truthy, she's littleendian. if it's 0, she is not. classic binary situation, no in-between, no "it's complicated". periodt. π
β¨ THREAD SAFETY β¨
It is safe to call this macro from any thread. π§
literally any thread. go wild. spawn a thousand of them. she does not care, she is not scared, she has no state to fight over. main character energy that is also somehow completely chill. π¦
β¨ AVAILABILITY β¨
This macro is available since SDL 3.2.0. so if you're on something older than that, bestie, you are simply not invited to this party π upgrade time fr fr.
π«Ά friendly reminder: this is a macro, not a function. there's no symbol to link against, no function pointer to take, no ABI drama. it just expands. don't be weird about it. π
and that's the whole page, bestie!! πβ¨πΈ
this little love letter to endianness comes to you straight from Simple Directmedia Layer, and the version tag on the tin is SDL 3.4.18 β SDL_AUDIO_ISLITTLEENDIAN(3), signing off, mwah π
ππ
π¦ 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