[MPlayer-dev-eng] [PATCH] MinGW compile fix, header order policy suggestion

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon May 30 10:39:46 CEST 2005


Hi,
the attached patch changes the order of the header in some files so that
system headers always come first. The point is that windows headers
define a STREAM_SEEK, too (in the way typedef struct ... STREAM_SEEK),
if in this case our STREAM_SEEK is already defined it won't compile.
I'd also suggest to adding something like: "you should first #include
config.h, then any system header and last the MPlayer specific one. If
can't do it like this for some reason, comment it in the code!"
to the CVS policy.
What do you think?

Greetings,
Reimar Döffinger
-------------- next part --------------
diff -ur MPlayer-cvs/libmpdemux/http.c /windows/D/MinGW/msys/home/Reimar/MPlayer-cvs/libmpdemux/http.c
--- MPlayer-cvs/libmpdemux/http.c	2005-05-29 19:17:12.000000000 +0200
+++ /windows/D/MinGW/msys/home/Reimar/MPlayer-cvs/libmpdemux/http.c	2005-05-29 21:47:48.000000000 +0200
@@ -4,11 +4,20 @@
  * (C) 2001, MPlayer team.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
+#ifndef HAVE_WINSOCK2
+#define closesocket close
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
 #include "http.h"
 #include "url.h"
 #include "mp_msg.h"
@@ -18,13 +27,6 @@
 #include "network.h"
 #include "help_mp.h"
 
-#ifndef HAVE_WINSOCK2
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
 
 extern mime_struct_t mime_type_table[];
 extern int stream_cache_size;
diff -ur MPlayer-cvs/libmpdemux/pnm.c /windows/D/MinGW/msys/home/Reimar/MPlayer-cvs/libmpdemux/pnm.c
--- MPlayer-cvs/libmpdemux/pnm.c	2005-05-29 19:17:13.000000000 +0200
+++ /windows/D/MinGW/msys/home/Reimar/MPlayer-cvs/libmpdemux/pnm.c	2005-05-29 21:48:28.000000000 +0200
@@ -23,6 +23,8 @@
  * based upon code from joschka
  */
 
+#include "config.h"
+
 #include <unistd.h>
 #include <stdio.h>
 #include <assert.h>
@@ -33,12 +35,6 @@
 #include <stdlib.h>
 #include <sys/time.h>
 #include <inttypes.h>
-#include "stream.h"
-#include "demuxer.h"
-#include "help_mp.h"
-
-
-#include "config.h"
 #ifndef HAVE_WINSOCK2
 #define closesocket close
 #include <sys/socket.h>
@@ -48,6 +44,11 @@
 #include <winsock2.h>
 #endif
 
+#include "stream.h"
+#include "demuxer.h"
+#include "help_mp.h"
+
+
 #include "pnm.h"
 //#include "libreal/rmff.h"
 


More information about the MPlayer-dev-eng mailing list