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