1 #include "SDL.h" 2 3 #if SDL_BYTEORDER == SDL_BIG_ENDIAN 4 5 #define UNALIGNEDDWORD(x) (int)( \ 6 (((char *)(&(x)))[0] << 24) | \ 7 (((char *)(&(x)))[1] << 16) | \ 8 (((char *)(&(x)))[2] << 8) | \ 9 (((char *)(&(x)))[3] << 0) ) 10 11 #define UNALIGNEDWORD(x) (int)( \ 12 (((char *)(&(x)))[0] << 8) | \ 13 (((char *)(&(x)))[1] << 0) ) 14 15 #elif SDL_BYTEORDER == SDL_LIL_ENDIAN 16 17 /* assume intel -- we can read/write bytes anywhere */ 18 #define UNALIGNEDDWORD(x) (x) 19 #define UNALIGNEDWORD(x) (x) 20 21 #else 22 23 #error defined unaligned int access for your platform 24 25 #endif 26