SDL_Swap64LE(3)
π SDL_Swap64LE(3) β SDL3 FUNCTIONS
okay bestie, welcome to the SDL_Swap64LE page from the SDL3 functions manual π this one's a lil macro with big "i just fix your endianness and leave" energy, and honestly? iconic. let's get into it β¨
πΈ NAME πΈ
SDL_Swap64LE β swap a 64-bit value from littleendian to native byte order. that's it. that's the whole job. she's a specialist π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_endian.h>
#define SDL_Swap64LE(x) SwapOnlyIfNecessary(x)
so you pull in <SDL3/SDL_endian.h> and boom, the macro is right there waiting for you like a bestie holding your iced coffee π«Ά
π¦ DESCRIPTION π¦
here's the tea, bestie: if this is running on a littleendian system, then x is returned unchanged. no swap, no drama, no nothing. she looked at your bytes, said "you're already correct", and walked away π
and the lowkey genius part? this macro never references x more than once, which avoids side effects. so you can pass in your lil expression without worrying that it's gonna get evaluated twice behind your back. no cap, that's a real thing to care about π
π MACRO PARAMETERS π
- x β the value to swap, in littleendian byte order. hand her over and she'll do her thing β¨
π RETURN VALUE π
returns x in native byte order. same value, same vibes, just speaking your machine's native language now π
π₯ THREAD SAFETY π₯
it is safe to call this macro from any thread. go wild. every thread gets a turn. no locking, no beef, no "wait your turn" energy β she's chill like that π
π AVAILABILITY π
this macro has been available since SDL 3.2.0. so if you're on something older than that... bestie, upgrade. fr fr π§
reminder, queen: this is a macro, not a function, so the "call" is just you writing it in your code and the preprocessor doing the rest. the way that she handles all of it for you before the compiler even blinks? main character energy β
Simple Directmedia Layer π¦ SDL 3.4.18 β that's where this lil page comes from, and she's still serving looks. mwah, bye bestie, go swap some bytes ππβ¨
π¦ 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