SDL_endian.h: extend Linux way for GNU libc

The currently used way to determine the endianness (i.e. include
<endian.h> and use the __BYTE_ORDER macro) is provided in general by
GNU libc. Thus, extend that to any platform/OS based on GNU libc.
This commit is contained in:
Pino Toscano
2025-08-06 23:40:02 +02:00
committed by Sam Lantinga
parent f439e44771
commit 561c99ee11

View File

@@ -128,7 +128,7 @@ _m_prefetch(void *__P)
* \sa SDL_BIG_ENDIAN
*/
#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
#elif defined(SDL_PLATFORM_LINUX)
#elif defined(SDL_PLATFORM_LINUX) || defined(__GLIBC__)
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#elif defined(SDL_PLATFORM_SOLARIS)