[SDL] amd64 [un]fixes in SDL_endian.h

Albert Cahalan albert at users.sf.net
Tue Jan 25 07:18:29 PST 2005

On Sat, 2005-01-22 at 00:40 -0500, Mike Frysinger wrote:

> the netbsd fix imported here:
> http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/include/SDL_endian.h.diff?r1=1.11&r2=1.12
> made our problems go away nicely (i was able to reproduce original build 
> failures and confirm the fix on an amd64 dev box)

Doesn't a recent gcc know to use that instruction anyway?
I think you can just get rid of the assembly code. The code
might even run faster, since gcc would have more information
about the code.

Since the problem only hits gcc-3.4, and older compilers
might benefit from the assembly, try this:

#if __GNUC__ < 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ < 4 )
// assembly code goes here
// plain C code

More information about the SDL mailing list