diff --git a/cmdutils.h b/cmdutils.h
index eea4401..eca98a3 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -29,6 +29,10 @@
 #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().
  */
diff --git a/ffplay.c b/ffplay.c
index 74d1f10..5997f65 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -43,14 +43,10 @@
 # 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>
