include/SDL_endian.h
changeset 5512 56ab281d7d3e
parent 5262 b530ef003506
child 5535 96594ac5fd1a
equal deleted inserted replaced
5511:be843abc1f6c 5512:56ab281d7d3e
   151     return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
   151     return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
   152                                     ((x >> 8) & 0x0000FF00) | (x >> 24)));
   152                                     ((x >> 8) & 0x0000FF00) | (x >> 24)));
   153 }
   153 }
   154 #endif
   154 #endif
   155 
   155 
   156 #ifdef SDL_HAS_64BIT_TYPE
       
   157 #if defined(__GNUC__) && defined(__i386__)
   156 #if defined(__GNUC__) && defined(__i386__)
   158 static __inline__ Uint64
   157 static __inline__ Uint64
   159 SDL_Swap64(Uint64 x)
   158 SDL_Swap64(Uint64 x)
   160 {
   159 {
   161     union
   160     union
   193     x <<= 32;
   192     x <<= 32;
   194     x |= SDL_Swap32(hi);
   193     x |= SDL_Swap32(hi);
   195     return (x);
   194     return (x);
   196 }
   195 }
   197 #endif
   196 #endif
   198 #else
       
   199 /**
       
   200  *  This is mainly to keep compilers from complaining in SDL code.
       
   201  *  If there is no real 64-bit datatype, then compilers will complain about
       
   202  *  the fake 64-bit datatype that SDL provides when it compiles user code.
       
   203  */
       
   204 #define SDL_Swap64(X)	(X)
       
   205 #endif /* SDL_HAS_64BIT_TYPE */
       
   206 
   197 
   207 
   198 
   208 static __inline__ float
   199 static __inline__ float
   209 SDL_SwapFloat(float x)
   200 SDL_SwapFloat(float x)
   210 {
   201 {