Commit 5b2e011e6d40fecc0f06fce8c1cedd13020e832f

Ozkan Sezer 2020-12-30T23:55:02

SDL_endian.h: minor fixes from SDL-1.2 branch ( forward-port of changesets 3909:6832b00d3594 and 5657:529d23724144 )

diff --git a/include/SDL_endian.h b/include/SDL_endian.h
index b11a83a..d09209b 100644
--- a/include/SDL_endian.h
+++ b/include/SDL_endian.h
@@ -69,7 +69,7 @@ extern "C" {
  *  \file SDL_endian.h
  */
 #if defined(__GNUC__) && defined(__i386__) && \
-   !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
@@ -99,7 +99,7 @@ SDL_Swap16(Uint16 x)
   __asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x));
   return x;
 }
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
@@ -120,7 +120,8 @@ SDL_Swap16(Uint16 x)
 }
 #endif
 
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
@@ -152,7 +153,7 @@ SDL_Swap32(Uint32 x)
   __asm__("rev %w1, %w0": "=r"(x):"r"(x));
   return x;
 }
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
@@ -183,7 +184,8 @@ SDL_Swap32(Uint32 x)
 }
 #endif
 
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {