OSDN Git Service

cmdutils: move "#undef main" from ffplay.c to cmdutils.h
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 3 Jun 2011 11:30:27 +0000 (13:30 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Fri, 3 Jun 2011 15:03:43 +0000 (17:03 +0200)
On Windows/MinGW the SDL cflags re-define the main() function, which
results in a linking error if the define is not undeffed.

Since the addition of the SDL output device, SDL cflags are used also
for compiling ffmpeg and ffprobe, so we need to move this trick from
ffplay.c to a common header.

Fix trac issue #256.

cmdutils.h
ffplay.c

index eea4401..eca98a3 100644 (file)
 #include "libavformat/avformat.h"
 #include "libswscale/swscale.h"
 
+#ifdef __MINGW32__
+#undef main /* We don't want SDL to override our main() */
+#endif
+
 /**
  * program name, defined by the program for show_version().
  */
index 74d1f10..5997f65 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
 # include "libavfilter/avfiltergraph.h"
 #endif
 
-#include "cmdutils.h"
-
 #include <SDL.h>
 #include <SDL_thread.h>
 
-#ifdef __MINGW32__
-#undef main /* We don't want SDL to override our main() */
-#endif
+#include "cmdutils.h"
 
 #include <unistd.h>
 #include <assert.h>