SDL on SuperH

Attached is a quickie patch to allow SDL to run sucessfully on Hitachi
SuperH macines.

M. R.

diff -urN -x CVS SDL.orig/include/SDL_byteorder.h SDL/include/SDL_byteorder.h
— SDL.orig/include/SDL_byteorder.h Sat Feb 17 12:24:20 2001
+++ SDL/include/SDL_byteorder.h Mon Mar 5 12:50:50 2001
@@ -42,7 +42,8 @@
#if defined(i386) || defined(WIN32) ||
(defined(alpha) || defined(__alpha)) ||
defined(arm) || \

  • (defined(mips) && defined(MIPSEL))
  • (defined(mips) && defined(MIPSEL)) || \
  • (defined(sh) && defined(LITTLE_ENDIAN))
    #define SDL_BYTEORDER SDL_LIL_ENDIAN
    #else
    #define SDL_BYTEORDER SDL_BIG_ENDIAN

“M. R. Brown” <mrbrown-lists-sdl at 0xd6.org> writes:

Attached is a quickie patch to allow SDL to run sucessfully on Hitachi
SuperH macines.

Why not have a configure-time test to figure out the byte order? (at
least for all “configure” platforms)>

diff -urN -x CVS SDL.orig/include/SDL_byteorder.h SDL/include/SDL_byteorder.h
— SDL.orig/include/SDL_byteorder.h Sat Feb 17 12:24:20 2001
+++ SDL/include/SDL_byteorder.h Mon Mar 5 12:50:50 2001
@@ -42,7 +42,8 @@
#if defined(i386) || defined(WIN32) ||
(defined(alpha) || defined(__alpha)) ||
defined(arm) || \

  • (defined(mips) && defined(MIPSEL))
  • (defined(mips) && defined(MIPSEL)) || \
  • (defined(sh) && defined(LITTLE_ENDIAN))
    #define SDL_BYTEORDER SDL_LIL_ENDIAN
    #else
    #define SDL_BYTEORDER SDL_BIG_ENDIAN


[ Below is a random fortune, which is unrelated to the above message. ]
This space intentionally left blank.

  • David Hedbor on Wed, Mar 28, 2001:

“M. R. Brown” <mrbrown-lists-sdl at 0xd6.org> writes:

Attached is a quickie patch to allow SDL to run sucessfully on Hitachi
SuperH macines.

Why not have a configure-time test to figure out the byte order? (at
least for all “configure” platforms)

Because that may not work when cross-compiling SDL to another platform (as
I am in this case), unless you add specific configure.in conditionals for
every architecture you support. To me that seems a lot more cumbersome
than just adding a single line to this header file. Especially since I’m
cross-compiling to an SuperH Linux target, why would you add configure
options for each supported Linux, NetBSD, etc. target, when the compiler
can efficiently handle it at build time?

Since Sam has it all in SDL_byteorder.h, the addition of a new architecture is
as simple as adding a condition for it’s arch. identifer, e.g. sh,
mips, and it’s endianness.

M. R.

“M. R. Brown” <mrbrown-lists-sdl at 0xd6.org> writes:

Attached is a quickie patch to allow SDL to run sucessfully on Hitachi
SuperH macines.

Why not have a configure-time test to figure out the byte order? (at
least for all “configure” platforms)

Because it doesn’t work for non-configure platforms. :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Attached is a quickie patch to allow SDL to run sucessfully on Hitachi
SuperH macines.

Thanks, this fix is now in CVS. :slight_smile:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software