sdl12-compat: updated SDL_endian.h from latest SDL2

From 1d6dfdc33b86b71dfab4fe631e72fe7ee5c01ee1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 18 Aug 2024 01:40:24 +0300
Subject: [PATCH] updated SDL_endian.h from latest SDL2

---
 include/SDL/SDL_endian.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/SDL/SDL_endian.h b/include/SDL/SDL_endian.h
index d878e13ed..e5ea9cdc6 100644
--- a/include/SDL/SDL_endian.h
+++ b/include/SDL/SDL_endian.h
@@ -41,6 +41,15 @@ real SDL-1.2 available to you. */
 #ifdef __linux__
 #include <endian.h>
 #define SDL_BYTEORDER  __BYTE_ORDER
+#elif defined(__sun) && defined(__SVR4)  /* Solaris */
+#include <sys/byteorder.h>
+#if defined(_LITTLE_ENDIAN)
+#define SDL_BYTEORDER   SDL_LIL_ENDIAN
+#elif defined(_BIG_ENDIAN)
+#define SDL_BYTEORDER   SDL_BIG_ENDIAN
+#else
+#error Unsupported endianness
+#endif
 #elif defined(__OpenBSD__) || defined(__DragonFly__)
 #include <endian.h>
 #define SDL_BYTEORDER  BYTE_ORDER
@@ -61,7 +70,7 @@ real SDL-1.2 available to you. */
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MIPSEB__)) || \
     defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
-    defined(__sparc__)
+    defined(__sparc__) || defined(__sparc)
 #define SDL_BYTEORDER   SDL_BIG_ENDIAN
 #else
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN