[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sdl 64bit problem [PATCH]



Hi list,

I found the problem that lead to the distorted sound in tuxracer on AMD64. It 
may have also been the cause for the other reported sound problems with SDL.
The problem is not in SDL, but in SDL-mixer.
There, music files (*.it, and probably others as well) are incorrectly read on 
all 64 bit architectures but Alpha, due to an incorrect data type definition.
The attached patch should solve the problem for all 64 bit architectures on 
Linux, since at least cpp defines _LP64 and __LP64__ for them.
_LP64 indicates that long ints and pointers are 64 bits, but integers are 32 
bits.
I am not sure whether the usage of _LP64 is also standard for the commercial 
compilers, and for other Unixes, but at least Solaris 9 defines _LP64 in the 
64 bit environment as well.

Josselin,
could you include this patch into your next debian packages?

--- SDL_mixer-1.2.5.orig/mikmod/mikmod.h        2001-12-19 18:11:40.000000000 
+0100
+++ SDL_mixer-1.2.5/mikmod/mikmod.h     2004-07-03 17:46:11.132803256 +0200
@@ -85,7 +85,7 @@
 
 /*@DOES_NOT_HAVE_SIGNED@*/
 
-#if defined(__alpha)
+#if defined(__alpha) || defined(_LP64)
 /* 64 bit architectures */
 
 typedef signed char     SBYTE;      /* 1 byte, signed */
--- SDL_mixer-1.2.5.orig/mikmod/mikmod_internals.h      2001-12-19 
18:11:40.000000000 +0100
+++ SDL_mixer-1.2.5/mikmod/mikmod_internals.h   2004-07-03 18:04:38.294489096 
+0200
@@ -69,7 +69,7 @@
 /*========== More type definitions */
 
 /* SLONGLONG: 64bit, signed */
-#if defined(__alpha)
+#if defined(__alpha) || defined(_LP64)
 typedef long           SLONGLONG;
 #define NATIVE_64BIT_INT
 #elif defined(__WATCOMC__)

-- 
--
Hans-Frieder Vogt                 e-mail: hfvogt (at) arcor (dot) de



Reply to: