From 3af860b877587ab276388956e797a7ad04cd41e3 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 29 Aug 2008 20:05:08 +0000 Subject: Rename HAVE_WINSOCK preprocessor condition to HAVE_WINSOCK_H. This is what it is called in FFmpeg and more consistent with other names for similar conditionals. This fixes a potential compilation failure on MinGW, as described in Bugzilla #1262. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27493 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 041fd0b2d1..9b58c670f2 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -14,7 +14,7 @@ #include "config.h" -#ifndef HAVE_WINSOCK2 +#ifndef HAVE_WINSOCK2_H #define closesocket close #else #include @@ -410,7 +410,7 @@ stream_t* new_stream(int fd,int type){ if(s==NULL) return NULL; memset(s,0,sizeof(stream_t)); -#ifdef HAVE_WINSOCK2 +#ifdef HAVE_WINSOCK2_H { WSADATA wsdata; int temp = WSAStartup(0x0202, &wsdata); // there might be a better place for this (-> later) @@ -445,7 +445,7 @@ void free_stream(stream_t *s){ closesocket(s->fd); else close(s->fd); } -#ifdef HAVE_WINSOCK2 +#ifdef HAVE_WINSOCK2_H mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n"); WSACleanup(); // there might be a better place for this (-> later) #endif -- cgit v1.2.3 From c152b07e661cbc274cd4979e6b5e053a64656476 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 29 Aug 2008 22:55:39 +0000 Subject: Move duplicated '#define closesocket close' into network.h along with network-related #include #ifdeffery. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27496 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 9b58c670f2..c71ff28477 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -13,17 +13,10 @@ #include #include "config.h" - -#ifndef HAVE_WINSOCK2_H -#define closesocket close -#else -#include -#endif - #include "mp_msg.h" #include "help_mp.h" #include "osdep/shmem.h" - +#include "network.h" #include "stream.h" #include "libmpdemux/demuxer.h" -- cgit v1.2.3 From f27f04a53d56a5b6ca89e80a67c140b6f009c439 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 31 Aug 2008 13:59:54 +0000 Subject: Revert moving closesocket definition and network headers to network.h. This caused lots of trouble on MinGW, we need a different solution. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27504 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index c71ff28477..9b58c670f2 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -13,10 +13,17 @@ #include #include "config.h" + +#ifndef HAVE_WINSOCK2_H +#define closesocket close +#else +#include +#endif + #include "mp_msg.h" #include "help_mp.h" #include "osdep/shmem.h" -#include "network.h" + #include "stream.h" #include "libmpdemux/demuxer.h" -- cgit v1.2.3 From 788a4d5f913fd4100f2163cf2e4e4a4a487f21ef Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 1 Sep 2008 07:31:57 +0000 Subject: Move '#define closesocket close' preprocessor directive to a common place and put it under the proper '#ifndef HAVE_CLOSESOCKET' condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27505 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 9b58c670f2..bcf4836717 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -14,16 +14,14 @@ #include "config.h" -#ifndef HAVE_WINSOCK2_H -#define closesocket close -#else +#ifdef HAVE_WINSOCK2_H #include #endif #include "mp_msg.h" #include "help_mp.h" #include "osdep/shmem.h" - +#include "network.h" #include "stream.h" #include "libmpdemux/demuxer.h" -- cgit v1.2.3