SDL2 fails to compile on Mac OS X

Hi,

I have trouble compiling SDL2 on Mac OS X. I am compiling for ppc,
x86, x86_64 platforms. The trouble is when compiling for ppc, in the
file SDL_blit_N.c, any instances of the following code throw an error:

—snip—
if(!srcfmt->Amask)
a = srcfmt->alpha;
—snap—

‘srcfmt’ is defined: SDL_PixelFormat *srcfmt

But for some reason it is pulling the SDL_PixelFormat struct from
SDL_PixelFormat.h instead of SDL_video.h?

Thanks for any ideas to fix,
D

Sorry to reply to myself… I looked at the code a little more and
found that I was incorrect. Here is more detail:

It looks like the ‘alpha’ member of the SDL_PixelFormat struct was
part of SDL 1.2 in the file SDL_video.h (my IDE jumped to the system
SDL header when I followed it by accident…) It looks like that in
SDL 2.0, SDL_PixelFormat has moved to SDL_pixels.h and has removed the
‘alpha’ member.

However, there is left over code that uses the ‘alpha’ member in the
SDL_ALTIVEC_BLITTERS portion of SDL_blit_N.c and therefore fails to
compile when compiling for Mac OS X ppc (10.4/10.5)

As a workaround, you can set SDL_ALTIVEC_BLITTERS to 0 in the file
SDL_config_macosx.h; however, I do not know the effects of this (maybe
performance will suffer in some areas?)

What should be the proper fix? I’ve tinkered a bit with creating a
patch, but I’m far too ignorant of the SDL code to be confident in
anything I write.

Thanks
DOn Fri, Mar 16, 2012 at 9:52 AM, D B <@D_B> wrote:

Hi,

I have trouble compiling SDL2 on Mac OS X. ?I am compiling for ppc,
x86, x86_64 platforms. ?The trouble is when compiling for ppc, in the
file SDL_blit_N.c, any instances of the following code throw an error:

—snip—
? ? ? ? ? ?if(!srcfmt->Amask)
? ? ? ? ? ? ?a = srcfmt->alpha;
—snap—

‘srcfmt’ is defined: ?SDL_PixelFormat *srcfmt

But for some reason it is pulling the SDL_PixelFormat struct from
SDL_PixelFormat.h instead of SDL_video.h?

Thanks for any ideas to fix,
D

This may fix it for you:

Please let me know how it works!On Sun, Mar 18, 2012 at 10:23 PM, D B wrote:

Sorry to reply to myself… I looked at the code a little more and
found that I was incorrect. Here is more detail:

It looks like the ‘alpha’ member of the SDL_PixelFormat struct was
part of SDL 1.2 in the file SDL_video.h (my IDE jumped to the system
SDL header when I followed it by accident…) It looks like that in
SDL 2.0, SDL_PixelFormat has moved to SDL_pixels.h and has removed the
‘alpha’ member.

However, there is left over code that uses the ‘alpha’ member in the
SDL_ALTIVEC_BLITTERS portion of SDL_blit_N.c and therefore fails to
compile when compiling for Mac OS X ppc (10.4/10.5)

As a workaround, you can set SDL_ALTIVEC_BLITTERS to 0 in the file
SDL_config_macosx.h; however, I do not know the effects of this (maybe
performance will suffer in some areas?)

What should be the proper fix? I’ve tinkered a bit with creating a
patch, but I’m far too ignorant of the SDL code to be confident in
anything I write.

Thanks
D

On Fri, Mar 16, 2012 at 9:52 AM, D B wrote:

Hi,

I have trouble compiling SDL2 on Mac OS X. I am compiling for ppc,
x86, x86_64 platforms. The trouble is when compiling for ppc, in the
file SDL_blit_N.c, any instances of the following code throw an error:

—snip—
if(!srcfmt->Amask)
a = srcfmt->alpha;
—snap—

‘srcfmt’ is defined: SDL_PixelFormat *srcfmt

But for some reason it is pulling the SDL_PixelFormat struct from
SDL_PixelFormat.h instead of SDL_video.h?

Thanks for any ideas to fix,
D


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org