SDL_endian.h: minor fixes from SDL-1.2 branch ( forward-port of changesets 3909:6832b00d3594 and 5657:529d23724144 )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
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)
{