From e6ba3612db85aa9a0306222e16cf0aeb4d800e9d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 6 Aug 2025 23:40:02 +0200 Subject: [PATCH] SDL_endian.h: extend Linux way for GNU libc The currently used way to determine the endianness (i.e. include and use the __BYTE_ORDER macro) is provided in general by GNU libc. Thus, extend that to any platform/OS based on GNU libc. (cherry picked from commit 561c99ee1171f680088ff98c773de2efe94b0f5e) --- include/SDL3/SDL_endian.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_endian.h b/include/SDL3/SDL_endian.h index 2a9b8a34d8..41ad0ce51a 100644 --- a/include/SDL3/SDL_endian.h +++ b/include/SDL3/SDL_endian.h @@ -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 #define SDL_BYTEORDER __BYTE_ORDER #elif defined(SDL_PLATFORM_SOLARIS)