SDL_Swap32LE(3)
π NAME π
SDL_Swap32LE β bestie, this one swaps a 32-bit value from littleendian over to native byte order. that's it, that's the whole job π¦
β¨ SYNOPSIS β¨
#include <SDL3/SDL_endian.h>
#define SDL_Swap32LE(x) SwapOnlyIfNecessary(x)
πΈ DESCRIPTION πΈ
okay so picture this: if this is running on a littleendian system, then x just gets returned unchanged. no drama, no swap, nothing. it simply comes back to you exactly how you sent it π
and here's the part that's genuinely iconic: this macro never references x more than once, which means it avoids side effects. so you can pass it something spicy and it won't double-dip on you. no cap π₯
π MACRO PARAMETERS π
xβ the value to swap, in littleendian byte order. hand it over and let the macro cook π
π RETURN VALUE π
Returns x in native byte order. that's the glow-up π
π§ THREAD SAFETY π§
It is safe to call this macro from any thread. every thread can get a turn, we don't gatekeep π
β AVAILABILITY β
This macro is available since SDL 3.2.0. so if you're on anything olderβ¦ yeah, you're not invited to this one π
lowkey obsessed with a macro that minds its own business and only touches your variable one time. main character energy fr fr π«Ά
k bye bestie, this page came to you courtesy of Simple Directmedia Layer β the one and only SDL 3.4.18 era πβ¨π go swap something, iykyk π¦
π¦ 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