mirror of https://github.com/libsdl-org/SDL
SDL_endian.h: Fix byte order detection on Solaris (and some SPARC compilers).
Fixes #10093. (Sort of cherry-picked from 14183f8ecac099982883331ae7e405f82e42aa6b.)
This commit is contained in:
parent
d8e68aea9d
commit
d7ee9ce455
|
@ -59,6 +59,15 @@ _m_prefetch(void *__P)
|
|||
#ifdef SDL_PLATFORM_LINUX
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(SDL_PLATFORM_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(SDL_PLATFORM_OPENBSD) || defined(__DragonFly__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
|
@ -79,7 +88,7 @@ _m_prefetch(void *__P)
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue