SDL_FLOATWORDORDER(3)
π SDL_FLOATWORDORDER π
okay so bestie, welcome to the SDL_FLOATWORDORDER page from the SDL3 functions manual β¨ this one is short and sweet and it's literally just a macro that spills the tea on your target system's floating point word order πΈ
β¨ NAME β¨
SDL_FLOATWORDORDER β a macro that reports the target system's floating point word order π«Ά
π SYNOPSIS π
#include <SDL3/SDL_endian.h>
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
like. that second line is the whole vibe. it's a placeholder, don't panic π
π DESCRIPTION π
so this macro is set to either SDL_LIL_ENDIAN or SDL_BIG_ENDIAN β and, no cap, it might be set to other values in the future too, if something else becomes popular π so don't hardcode assumptions about it only ever being two things, okay?
the iconic part is that this can be tested with the preprocessor, which means you get to make decisions at compile time π§ slay. compile-time decisions are the main character energy of C.
#if SDL_FLOATWORDORDER == SDL_BIG_ENDIAN
SDL_Log("This system's floats are bigendian.");
#endif
see how clean that is?? the preprocessor checks it, the log only shows up if it's true, periodt π
β AVAILABILITY β
this macro is available since SDL 3.2.0 π so if you're on anything older, it's not giving. upgrade bestie π
π SEE ALSO π
that's the whole page, you ate it π thanks for reading the SDL3 functions manual, this page came to you from the fine folks at Simple Directmedia Layer, version SDL 3.4.18, dated SDL_FLOATWORDORDER(3) π¦ bye bestie, go check your endianness ππ
π¦ 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