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/asf_mmst_streaming.c | 4 +--- stream/asf_streaming.c | 4 +--- stream/http.c | 1 - stream/librtsp/rtsp_session.c | 2 +- stream/network.c | 4 +--- stream/network.h | 4 ++++ stream/pnm.c | 3 +-- stream/rtp.c | 2 +- stream/stream.c | 6 ++---- stream/stream_ftp.c | 2 +- stream/stream_netstream.c | 2 +- stream/stream_rtsp.c | 2 +- stream/tcp.c | 2 +- stream/udp.c | 2 +- 14 files changed, 17 insertions(+), 23 deletions(-) diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c index 5874998199..36021af35c 100644 --- a/stream/asf_mmst_streaming.c +++ b/stream/asf_mmst_streaming.c @@ -39,9 +39,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifndef HAVE_WINSOCK2_H -#define closesocket close -#else +#ifdef HAVE_WINSOCK2_H #include #endif diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index 67dc7278b8..a937c23432 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -9,9 +9,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifndef HAVE_WINSOCK2_H -#define closesocket close -#else +#ifdef HAVE_WINSOCK2_H #include #endif diff --git a/stream/http.c b/stream/http.c index 048edeedca..2a6d07aee0 100644 --- a/stream/http.c +++ b/stream/http.c @@ -12,7 +12,6 @@ #include #ifndef HAVE_WINSOCK2_H -#define closesocket close #else #include #include diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c index 5e897ba777..ce68dd765f 100644 --- a/stream/librtsp/rtsp_session.c +++ b/stream/librtsp/rtsp_session.c @@ -31,7 +31,6 @@ #include #include "config.h" #ifndef HAVE_WINSOCK2_H -#define closesocket close #include #include #include @@ -51,6 +50,7 @@ #include "rtsp.h" #include "rtsp_rtp.h" #include "rtsp_session.h" +#include "stream/network.h" #include "stream/url.h" #include "stream/rtp.h" #include "stream/realrtsp/real.h" diff --git a/stream/network.c b/stream/network.c index 3f2391e60f..6e000c07f2 100644 --- a/stream/network.c +++ b/stream/network.c @@ -19,9 +19,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifndef HAVE_WINSOCK2_H -#define closesocket close -#else +#ifdef HAVE_WINSOCK2_H #include #include #endif diff --git a/stream/network.h b/stream/network.h index b3d6abc8c4..76e2e6d520 100644 --- a/stream/network.h +++ b/stream/network.h @@ -22,6 +22,10 @@ #include "url.h" #include "http.h" +#ifndef HAVE_CLOSESOCKET +#define closesocket close +#endif + #define BUFFER_SIZE 2048 typedef struct { diff --git a/stream/pnm.c b/stream/pnm.c index d9d9513897..1ef86e620c 100644 --- a/stream/pnm.c +++ b/stream/pnm.c @@ -36,7 +36,6 @@ #include #include #ifndef HAVE_WINSOCK2_H -#define closesocket close #include //#include //#include @@ -50,7 +49,7 @@ #include "libmpdemux/demuxer.h" #include "help_mp.h" #include "osdep/timer.h" - +#include "network.h" #include "pnm.h" #include "tcp.h" //#include "libreal/rmff.h" diff --git a/stream/rtp.c b/stream/rtp.c index f4b84fc3b4..624812a0fe 100644 --- a/stream/rtp.c +++ b/stream/rtp.c @@ -17,12 +17,12 @@ #include #include #include -#define closesocket close #else #include #include #endif #include +#include "network.h" #include "stream.h" /* MPEG-2 TS RTP stack */ 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" diff --git a/stream/stream_ftp.c b/stream/stream_ftp.c index 814d7d0083..95632e7375 100644 --- a/stream/stream_ftp.c +++ b/stream/stream_ftp.c @@ -11,12 +11,12 @@ #include #ifndef HAVE_WINSOCK2_H #include -#define closesocket close #else #include #endif #include "mp_msg.h" +#include "network.h" #include "stream.h" #include "help_mp.h" #include "m_option.h" diff --git a/stream/stream_netstream.c b/stream/stream_netstream.c index 4a3d2f04ed..5a3de1ce58 100644 --- a/stream/stream_netstream.c +++ b/stream/stream_netstream.c @@ -43,7 +43,6 @@ #include #ifndef HAVE_WINSOCK2_H -#define closesocket close #include #include #include @@ -59,6 +58,7 @@ #include "libavutil/common.h" #include "mpbswap.h" +#include "network.h" #include "netstream.h" #include "tcp.h" diff --git a/stream/stream_rtsp.c b/stream/stream_rtsp.c index d5c02852c1..c45f3aad86 100644 --- a/stream/stream_rtsp.c +++ b/stream/stream_rtsp.c @@ -32,13 +32,13 @@ #include #include #include -#define closesocket close #else #include #include #endif #include +#include "network.h" #include "stream.h" #include "tcp.h" #include "librtsp/rtsp.h" diff --git a/stream/tcp.c b/stream/tcp.c index 7eb5fc11b8..fd5a849cad 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -25,12 +25,12 @@ #include #include #include -#define closesocket close #else #include #include #endif +#include "network.h" #include "stream.h" #include "tcp.h" diff --git a/stream/udp.c b/stream/udp.c index 52d47a0991..e7ac97f597 100644 --- a/stream/udp.c +++ b/stream/udp.c @@ -36,13 +36,13 @@ #include #include #include -#define closesocket close #else #include #include #endif #include "mp_msg.h" +#include "network.h" #include "url.h" #include "udp.h" -- cgit v1.2.3