Replace all the "static __inline__" functions with SDL_FORCE_INLINE.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 15 Mar 2013 01:09:19 -0400
changeset 7004 18d4df6942c2
parent 7003 eeaf77005c30
child 7005 6c69ad0b184e
Replace all the "static __inline__" functions with SDL_FORCE_INLINE.
include/SDL_atomic.h
include/SDL_bits.h
include/SDL_endian.h
--- a/include/SDL_atomic.h	Fri Mar 15 01:01:20 2013 -0400
+++ b/include/SDL_atomic.h	Fri Mar 15 01:09:19 2013 -0400
@@ -205,7 +205,7 @@
  * \return The previous value of the atomic variable.
  */
 #ifndef SDL_AtomicSet
-static __inline__ int SDL_AtomicSet(SDL_atomic_t *a, int v)
+SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v)
 {
     int value;
     do {
@@ -219,7 +219,7 @@
  * \brief Get the value of an atomic variable
  */
 #ifndef SDL_AtomicGet
-static __inline__ int SDL_AtomicGet(SDL_atomic_t *a)
+SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a)
 {
     int value = a->value;
     SDL_CompilerBarrier();
@@ -235,7 +235,7 @@
  * \note This same style can be used for any number operation
  */
 #ifndef SDL_AtomicAdd
-static __inline__ int SDL_AtomicAdd(SDL_atomic_t *a, int v)
+SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v)
 {
     int value;
     do {
@@ -279,7 +279,7 @@
  * \return The previous value of the pointer.
  */
 #ifndef SDL_AtomicSetPtr
-static __inline__ void* SDL_AtomicSetPtr(void* *a, void* v)
+SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v)
 {
     void* value;
     do {
@@ -293,7 +293,7 @@
  * \brief Get the value of a pointer atomically.
  */
 #ifndef SDL_AtomicGetPtr
-static __inline__ void* SDL_AtomicGetPtr(void* *a)
+SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a)
 {
     void* value = *a;
     SDL_CompilerBarrier();
--- a/include/SDL_bits.h	Fri Mar 15 01:01:20 2013 -0400
+++ b/include/SDL_bits.h	Fri Mar 15 01:09:19 2013 -0400
@@ -40,11 +40,6 @@
 
 /**
  *  \file SDL_bits.h
- *
- *  Uses inline functions for compilers that support them, and static
- *  functions for those that do not.  Because these functions become
- *  static for compilers that do not support inline functions, this
- *  header should only be included in files that actually use them.
  */
 
 /**
@@ -54,7 +49,7 @@
  *
  *  \return Index of the most significant bit.
  */
-static __inline__ Sint8
+SDL_FORCE_INLINE Sint8
 SDL_MostSignificantBitIndex32(Uint32 x)
 {
 #if defined(__GNUC__)
--- a/include/SDL_endian.h	Fri Mar 15 01:01:20 2013 -0400
+++ b/include/SDL_endian.h	Fri Mar 15 01:09:19 2013 -0400
@@ -66,29 +66,24 @@
 
 /**
  *  \file SDL_endian.h
- *  
- *  Uses inline functions for compilers that support them, and static
- *  functions for those that do not.  Because these functions become
- *  static for compilers that do not support inline functions, this
- *  header should only be included in files that actually use them.
  */
 #if defined(__GNUC__) && defined(__i386__) && \
    !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
-static __inline__ Uint16
+SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
   __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
     return x;
 }
 #elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint16
+SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
   __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
     return x;
 }
 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-static __inline__ Uint16
+SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
     int result;
@@ -97,14 +92,14 @@
     return (Uint16)result;
 }
 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
-static __inline__ Uint16
+SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
   __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
 #else
-static __inline__ Uint16
+SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
     return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
@@ -112,21 +107,21 @@
 #endif
 
 #if defined(__GNUC__) && defined(__i386__)
-static __inline__ Uint32
+SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
   __asm__("bswap %0": "=r"(x):"0"(x));
     return x;
 }
 #elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint32
+SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
   __asm__("bswapl %0": "=r"(x):"0"(x));
     return x;
 }
 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-static __inline__ Uint32
+SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
     Uint32 result;
@@ -137,14 +132,14 @@
     return result;
 }
 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
-static __inline__ Uint32
+SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
   __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
 #else
-static __inline__ Uint32
+SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
     return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
@@ -153,7 +148,7 @@
 #endif
 
 #if defined(__GNUC__) && defined(__i386__)
-static __inline__ Uint64
+SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
     union
@@ -171,14 +166,14 @@
     return v.u;
 }
 #elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint64
+SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
   __asm__("bswapq %0": "=r"(x):"0"(x));
     return x;
 }
 #else
-static __inline__ Uint64
+SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
     Uint32 hi, lo;
@@ -195,7 +190,7 @@
 #endif
 
 
-static __inline__ float
+SDL_FORCE_INLINE float
 SDL_SwapFloat(float x)
 {
     union