[FFmpeg-devel] [PATCH] FATE tests don't build when SDL is installed (Win7 with MinGW32).

gregory.wolfe at kodakalaris.com gregory.wolfe at kodakalaris.com
Fri Mar 7 15:04:05 CET 2014


> On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe at kodakalaris.com 
wrote:
> > A while back I submitted a bug tracker ticket for this (#3368).  Since 
I
> > have already done the work, I figured I might as well share it.
> > 
> > 
> > Patched files:  46 source files (see .patch file attached)
> > Description (from commit message):
> > 
> > Documented in ticket #3368, same problem as described in ticket #256.
> > When SDL is being used, compile flags include -Dmain=SDL_main, which
> > causes problems for FATE test programs.  Applied same fix as in #256:
> > if building using MinGW32, simply #undef main prior to 
main(argc,argv).
> [...]
> > diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
> > index 6308348..a34bee2 100644
> > --- a/libavcodec/dct-test.c
> > +++ b/libavcodec/dct-test.c
> > @@ -541,6 +541,10 @@ static void help(void)
> >  #include "compat/getopt.c"
> >  #endif
> > 
> > +#ifdef __MINGW32__
> > +#undef main /* We don't want SDL to override our main() */
> > +#endif
> > +
> >  int main(int argc, char **argv)
> >  {
> >      int test_idct = 0, test_248_dct = 0;
> 
> adding this same "hack" to every file is kind of ugly
> cant the "-Dmain=SDL_main" thing be filtered out of the flags or
> overridden?
> 
> [...]
> 
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In ticket #3368 I mentioned that it might be more elegant to fix this 
problem
in the Makefile.  After looking at the options for the configure script, I 
tried
--extra-cflags=-Umain, but that did not work.  Will keep looking for a 
better
solution and get back to you.

Greg Wolfe, Kodak Alaris


More information about the ffmpeg-devel mailing list