Can not compile SDL with gcc < 3.1

Hello,

I just tried to compile SDL 1.2.8 for Linux, and as I use gcc-2.95, the
file SDL_yuv_mmx.c can not be compiled:

SDL_yuv_mmx.c: In function ColorRGBDitherYV12MMX1X': SDL_yuv_mmx.c:236: parse error before[‘
SDL_yuv_mmx.c: In function Color565DitherYV12MMX1X': SDL_yuv_mmx.c:417: parse error before[‘
SDL_yuv_mmx.c: At top level:
SDL_yuv_mmx.c:33: warning: MMX_0080w' defined but not used SDL_yuv_mmx.c:34: warning:MMX_00FFw’ defined but not used
SDL_yuv_mmx.c:35: warning: MMX_FF00w' defined but not used SDL_yuv_mmx.c:37: warning:MMX_Ycoeff’ defined but not used
SDL_yuv_mmx.c:39: warning: MMX_UbluRGB' defined but not used SDL_yuv_mmx.c:40: warning:MMX_VredRGB’ defined but not used
SDL_yuv_mmx.c:41: warning: MMX_UgrnRGB' defined but not used SDL_yuv_mmx.c:42: warning:MMX_VgrnRGB’ defined but not used
SDL_yuv_mmx.c:44: warning: MMX_Ublu5x5' defined but not used SDL_yuv_mmx.c:45: warning:MMX_Vred5x5’ defined but not used
SDL_yuv_mmx.c:46: warning: MMX_Ugrn555' defined but not used SDL_yuv_mmx.c:47: warning:MMX_Vgrn555’ defined but not used
SDL_yuv_mmx.c:48: warning: MMX_Ugrn565' defined but not used SDL_yuv_mmx.c:49: warning:MMX_Vgrn565’ defined but not used
SDL_yuv_mmx.c:51: warning: MMX_red555' defined but not used SDL_yuv_mmx.c:52: warning:MMX_red565’ defined but not used
SDL_yuv_mmx.c:53: warning: MMX_grn555' defined but not used SDL_yuv_mmx.c:54: warning:MMX_grn565’ defined but not used
SDL_yuv_mmx.c:55: warning: `MMX_blu5x5’ defined but not used

This is due to a special declaration of names for assembly parameters,
which is only available as of gcc 3.1 (according to gcc info page).

I know I just have to use a more recent gcc, but I just wanted to tell
anyone still using gcc<3.1 that there will be a problem with this file.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Patrice Mandin wrote:

Hello,

I just tried to compile SDL 1.2.8 for Linux, and as I use gcc-2.95, the
file SDL_yuv_mmx.c can not be compiled:

SDL_yuv_mmx.c: In function ColorRGBDitherYV12MMX1X': SDL_yuv_mmx.c:236: parse error before[‘
SDL_yuv_mmx.c: In function Color565DitherYV12MMX1X': SDL_yuv_mmx.c:417: parse error before[‘
SDL_yuv_mmx.c: At top level:
SDL_yuv_mmx.c:33: warning: MMX_0080w' defined but not used SDL_yuv_mmx.c:34: warning:MMX_00FFw’ defined but not used
SDL_yuv_mmx.c:35: warning: MMX_FF00w' defined but not used SDL_yuv_mmx.c:37: warning:MMX_Ycoeff’ defined but not used
SDL_yuv_mmx.c:39: warning: MMX_UbluRGB' defined but not used SDL_yuv_mmx.c:40: warning:MMX_VredRGB’ defined but not used
SDL_yuv_mmx.c:41: warning: MMX_UgrnRGB' defined but not used SDL_yuv_mmx.c:42: warning:MMX_VgrnRGB’ defined but not used
SDL_yuv_mmx.c:44: warning: MMX_Ublu5x5' defined but not used SDL_yuv_mmx.c:45: warning:MMX_Vred5x5’ defined but not used
SDL_yuv_mmx.c:46: warning: MMX_Ugrn555' defined but not used SDL_yuv_mmx.c:47: warning:MMX_Vgrn555’ defined but not used
SDL_yuv_mmx.c:48: warning: MMX_Ugrn565' defined but not used SDL_yuv_mmx.c:49: warning:MMX_Vgrn565’ defined but not used
SDL_yuv_mmx.c:51: warning: MMX_red555' defined but not used SDL_yuv_mmx.c:52: warning:MMX_red565’ defined but not used
SDL_yuv_mmx.c:53: warning: MMX_grn555' defined but not used SDL_yuv_mmx.c:54: warning:MMX_grn565’ defined but not used
SDL_yuv_mmx.c:55: warning: `MMX_blu5x5’ defined but not used

This is due to a special declaration of names for assembly parameters,
which is only available as of gcc 3.1 (according to gcc info page).

That’s an easy one :slight_smile:
I’ll fix this tomorrow.

Stephane

That’s an easy one :slight_smile:
I’ll fix this tomorrow.

Hah. You need to test your fix on gcc 2.95, 3.1, and 3.4, as I’ve seen
different syntax break on one of the three. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment