include/SDL_byteorder.h
changeset 1137 0f9d463bf09c
parent 969 cfb9518670f4
child 1190 173c063d4f55
     1.1 --- a/include/SDL_byteorder.h	Thu Sep 08 06:43:51 2005 +0000
     1.2 +++ b/include/SDL_byteorder.h	Thu Sep 08 06:49:20 2005 +0000
     1.3 @@ -34,6 +34,16 @@
     1.4  #define SDL_LIL_ENDIAN	1234
     1.5  #define SDL_BIG_ENDIAN	4321
     1.6  
     1.7 +#ifdef __linux__
     1.8 +# include <endian.h>
     1.9 +# if BYTE_ORDER == LITTLE_ENDIAN
    1.10 +#  define SDL_BYTEORDER SDL_LIL_ENDIAN
    1.11 +# else
    1.12 +#  define SDL_BYTEORDER SDL_BIG_ENDIAN
    1.13 +# endif
    1.14 +
    1.15 +#else
    1.16 +
    1.17  /* Pardon the mess, I'm trying to determine the endianness of this host.
    1.18     I'm doing it by preprocessor defines rather than some sort of configure
    1.19     script so that application code can use this too.  The "right" way would
    1.20 @@ -42,7 +52,8 @@
    1.21  #if (defined(__i386__) || defined(__i386)) || \
    1.22       defined(__ia64__) || defined(WIN32) || \
    1.23      (defined(__alpha__) || defined(__alpha)) || \
    1.24 -     defined(__arm__) || \
    1.25 +    (defined(__arm__) || defined(__thumb__)) || \
    1.26 +    (defined(__sh__) || defined(__sh64__)) || \
    1.27      (defined(__mips__) && defined(__MIPSEL__)) || \
    1.28       defined(__SYMBIAN32__) || \
    1.29       defined(__x86_64__) || \
    1.30 @@ -52,4 +63,6 @@
    1.31  #define SDL_BYTEORDER	SDL_BIG_ENDIAN
    1.32  #endif
    1.33  
    1.34 +#endif /* __linux__ */
    1.35 +
    1.36  #endif /* _SDL_byteorder_h */