include/SDL_endian.h
changeset 7004 18d4df6942c2
parent 6885 700f1b25f77f
child 7191 75360622e65f
     1.1 --- a/include/SDL_endian.h	Fri Mar 15 01:01:20 2013 -0400
     1.2 +++ b/include/SDL_endian.h	Fri Mar 15 01:09:19 2013 -0400
     1.3 @@ -66,29 +66,24 @@
     1.4  
     1.5  /**
     1.6   *  \file SDL_endian.h
     1.7 - *  
     1.8 - *  Uses inline functions for compilers that support them, and static
     1.9 - *  functions for those that do not.  Because these functions become
    1.10 - *  static for compilers that do not support inline functions, this
    1.11 - *  header should only be included in files that actually use them.
    1.12   */
    1.13  #if defined(__GNUC__) && defined(__i386__) && \
    1.14     !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
    1.15 -static __inline__ Uint16
    1.16 +SDL_FORCE_INLINE Uint16
    1.17  SDL_Swap16(Uint16 x)
    1.18  {
    1.19    __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
    1.20      return x;
    1.21  }
    1.22  #elif defined(__GNUC__) && defined(__x86_64__)
    1.23 -static __inline__ Uint16
    1.24 +SDL_FORCE_INLINE Uint16
    1.25  SDL_Swap16(Uint16 x)
    1.26  {
    1.27    __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
    1.28      return x;
    1.29  }
    1.30  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    1.31 -static __inline__ Uint16
    1.32 +SDL_FORCE_INLINE Uint16
    1.33  SDL_Swap16(Uint16 x)
    1.34  {
    1.35      int result;
    1.36 @@ -97,14 +92,14 @@
    1.37      return (Uint16)result;
    1.38  }
    1.39  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    1.40 -static __inline__ Uint16
    1.41 +SDL_FORCE_INLINE Uint16
    1.42  SDL_Swap16(Uint16 x)
    1.43  {
    1.44    __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
    1.45      return x;
    1.46  }
    1.47  #else
    1.48 -static __inline__ Uint16
    1.49 +SDL_FORCE_INLINE Uint16
    1.50  SDL_Swap16(Uint16 x)
    1.51  {
    1.52      return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
    1.53 @@ -112,21 +107,21 @@
    1.54  #endif
    1.55  
    1.56  #if defined(__GNUC__) && defined(__i386__)
    1.57 -static __inline__ Uint32
    1.58 +SDL_FORCE_INLINE Uint32
    1.59  SDL_Swap32(Uint32 x)
    1.60  {
    1.61    __asm__("bswap %0": "=r"(x):"0"(x));
    1.62      return x;
    1.63  }
    1.64  #elif defined(__GNUC__) && defined(__x86_64__)
    1.65 -static __inline__ Uint32
    1.66 +SDL_FORCE_INLINE Uint32
    1.67  SDL_Swap32(Uint32 x)
    1.68  {
    1.69    __asm__("bswapl %0": "=r"(x):"0"(x));
    1.70      return x;
    1.71  }
    1.72  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    1.73 -static __inline__ Uint32
    1.74 +SDL_FORCE_INLINE Uint32
    1.75  SDL_Swap32(Uint32 x)
    1.76  {
    1.77      Uint32 result;
    1.78 @@ -137,14 +132,14 @@
    1.79      return result;
    1.80  }
    1.81  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    1.82 -static __inline__ Uint32
    1.83 +SDL_FORCE_INLINE Uint32
    1.84  SDL_Swap32(Uint32 x)
    1.85  {
    1.86    __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
    1.87      return x;
    1.88  }
    1.89  #else
    1.90 -static __inline__ Uint32
    1.91 +SDL_FORCE_INLINE Uint32
    1.92  SDL_Swap32(Uint32 x)
    1.93  {
    1.94      return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
    1.95 @@ -153,7 +148,7 @@
    1.96  #endif
    1.97  
    1.98  #if defined(__GNUC__) && defined(__i386__)
    1.99 -static __inline__ Uint64
   1.100 +SDL_FORCE_INLINE Uint64
   1.101  SDL_Swap64(Uint64 x)
   1.102  {
   1.103      union
   1.104 @@ -171,14 +166,14 @@
   1.105      return v.u;
   1.106  }
   1.107  #elif defined(__GNUC__) && defined(__x86_64__)
   1.108 -static __inline__ Uint64
   1.109 +SDL_FORCE_INLINE Uint64
   1.110  SDL_Swap64(Uint64 x)
   1.111  {
   1.112    __asm__("bswapq %0": "=r"(x):"0"(x));
   1.113      return x;
   1.114  }
   1.115  #else
   1.116 -static __inline__ Uint64
   1.117 +SDL_FORCE_INLINE Uint64
   1.118  SDL_Swap64(Uint64 x)
   1.119  {
   1.120      Uint32 hi, lo;
   1.121 @@ -195,7 +190,7 @@
   1.122  #endif
   1.123  
   1.124  
   1.125 -static __inline__ float
   1.126 +SDL_FORCE_INLINE float
   1.127  SDL_SwapFloat(float x)
   1.128  {
   1.129      union