[MPlayer-dev-eng] PATCH: sdl test in configure

vmrsss vmrsss at gmail.com
Wed Apr 22 22:44:45 CEST 2009


On 22 Apr 2009, at 21:19, Uoti Urpala wrote:
> SDL headers contain a hack that renames the original main(), so SDL  
> can
> first execute some code in its own main() and then call the renamed
> main().

Indeed, that is what happens, if you look at your "include/SDL/ 
SDL_main.h" you'll see the hack.

I am on macosx, and the test fails with gcc 4.0.1, 4.2.1 and 4.3. Here  
is an example from configure.log:

> ============ Checking for SDL ============
> 1.2.12
> 1.2.12
>
> #include <SDL.h>
> int main(void) {
>   SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
>   return 0;
> }
>
> cc -Wundef -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration- 
> after-statement -std=gnu99 -Wall -Wno-switch -Wpointer-arith - 
> Wredundant-decls -O4 -march=pentium-m -mtune=pentium-m -pipe -ffast- 
> math -fomit-frame-pointer -mdynamic-no-pic -falign-loops=16 -shared- 
> libgcc -I.   -I/usr/X11/include -I/usr/local/include/   -ffast-math   
> -liconv -lncurses -framework CoreAudio -framework AudioUnit - 
> framework AudioToolbox -framework Carbon -framework QuickTime - 
> framework Cocoa -framework QuartzCore -framework OpenGL -framework  
> IOKit -lpng -lz  -L/usr/X11R6/lib -lXext -lX11  -lXss -lXv - 
> lXinerama -lXxf86vm -lGL  -L/usr/local/lib -lcaca -lcucul  -o /tmp/ 
> mplayer-conf-5570-23698 /tmp/mplayer-conf-2506-23698.c -I/usr/local/ 
> include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -L/usr/local/lib - 
> lSDLmain -lSDL -Wl,-framework,Cocoa -Wl,-framework,Carbon
> /tmp/mplayer-conf-2506-23698.c:2: error: conflicting types for  
> 'SDL_main' /usr/local/include/SDL/SDL_main.h:53: error: previous  
> declaration of 'SDL_main' was here
>
>
> Result is: no

I have assumed that declaring main(arg, argv) would not cause problems  
on other architectures.



More information about the MPlayer-dev-eng mailing list