[MPlayer-cygwin] rtsp.c SVN 27243 MingW socket.h or winsock2.h

Gianluigi Tiesi mplayer at netfarm.it
Tue Jul 15 22:26:22 CEST 2008


On Wed, Jul 09, 2008 at 10:22:45PM -0400, Henry Garcia wrote:
> Had to comment out the following in rtsp.c to get MingW to compile SVN 27243
> 
> 
> #include <sys/socket.h>
> 
> Apparently, MingW needs winsock2.h and not socket.h. Not too familiar with
> the
>  'if' logic in c programming, but shouldn't including the socket headers
> file be left out if
> HAVE_WINSOCK2 is defined. Seems like the logical thing to do.
> 
> Few more chapters in my C tutorial and I should have come up with a better
> solution
> other than commenting out the #include <sys/socket.h> line.

hi,
try the attached patch

Regards

-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -NpuBr -Xexclude.txt main/stream/librtsp/rtsp.c sherpya/stream/librtsp/rtsp.c
--- main/stream/librtsp/rtsp.c	2008-07-10 19:30:22.546875000 +0200
+++ sherpya/stream/librtsp/rtsp.c	2008-07-15 21:59:24.703125000 +0200
@@ -41,10 +41,11 @@
 #include <time.h>
 #include <sys/time.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 #include <inttypes.h>
 #ifdef HAVE_WINSOCK2
 #include <winsock2.h>
+#else
+#include <sys/socket.h>
 #endif
 #include "mp_msg.h"
 #include "rtsp.h"


More information about the MPlayer-cygwin mailing list