Patched to compile on BeOS and old, old GCC releases. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Mon, 05 Feb 2007 06:44:51 +0000
branchSDL-1.2
changeset 39096832b00d3594
parent 3908 6e41f5d80198
child 3910 af4d584e0edb
Patched to compile on BeOS and old, old GCC releases.
include/SDL_endian.h
src/video/SDL_blit.c
     1.1 --- a/include/SDL_endian.h	Sat Feb 03 08:17:12 2007 +0000
     1.2 +++ b/include/SDL_endian.h	Mon Feb 05 06:44:51 2007 +0000
     1.3 @@ -56,7 +56,7 @@
     1.4     header should only be included in files that actually use them.
     1.5  */
     1.6  #if defined(__GNUC__) && defined(__i386__) && \
     1.7 -   !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
     1.8 +   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
     1.9  static __inline__ Uint16 SDL_Swap16(Uint16 x)
    1.10  {
    1.11  	__asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
    1.12 @@ -88,7 +88,8 @@
    1.13  }
    1.14  #endif
    1.15  
    1.16 -#if defined(__GNUC__) && defined(__i386__)
    1.17 +#if defined(__GNUC__) && defined(__i386__) && \
    1.18 +   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
    1.19  static __inline__ Uint32 SDL_Swap32(Uint32 x)
    1.20  {
    1.21  	__asm__("bswap %0" : "=r" (x) : "0" (x));
    1.22 @@ -123,7 +124,8 @@
    1.23  #endif
    1.24  
    1.25  #ifdef SDL_HAS_64BIT_TYPE
    1.26 -#if defined(__GNUC__) && defined(__i386__)
    1.27 +#if defined(__GNUC__) && defined(__i386__) && \
    1.28 +   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
    1.29  static __inline__ Uint64 SDL_Swap64(Uint64 x)
    1.30  {
    1.31  	union { 
     2.1 --- a/src/video/SDL_blit.c	Sat Feb 03 08:17:12 2007 +0000
     2.2 +++ b/src/video/SDL_blit.c	Mon Feb 05 06:44:51 2007 +0000
     2.3 @@ -29,6 +29,9 @@
     2.4  
     2.5  #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
     2.6  #define MMX_ASMBLIT
     2.7 +#if (__GNUC__ > 2)  /* SSE instructions aren't in GCC 2. */
     2.8 +#define SSE_ASMBLIT
     2.9 +#endif
    2.10  #endif
    2.11  
    2.12  #if defined(MMX_ASMBLIT)
    2.13 @@ -122,6 +125,7 @@
    2.14  		SDL_memcpy(to, from, len&7);
    2.15  }
    2.16  
    2.17 +#ifdef SSE_ASMBLIT
    2.18  static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len)
    2.19  {
    2.20  	int i;
    2.21 @@ -146,6 +150,7 @@
    2.22  		SDL_memcpy(to, from, len&7);
    2.23  }
    2.24  #endif
    2.25 +#endif
    2.26  
    2.27  static void SDL_BlitCopy(SDL_BlitInfo *info)
    2.28  {
    2.29 @@ -159,7 +164,8 @@
    2.30  	dst = info->d_pixels;
    2.31  	srcskip = w+info->s_skip;
    2.32  	dstskip = w+info->d_skip;
    2.33 -#ifdef MMX_ASMBLIT
    2.34 +
    2.35 +#ifdef SSE_ASMBLIT
    2.36  	if(SDL_HasSSE())
    2.37  	{
    2.38  		while ( h-- ) {
    2.39 @@ -172,6 +178,8 @@
    2.40  		::);
    2.41  	}
    2.42  	else
    2.43 +#endif
    2.44 +#ifdef MMX_ASMBLIT
    2.45  	if(SDL_HasMMX())
    2.46  	{
    2.47  		while ( h-- ) {