# HG changeset patch # User diego # Date 1220254317 0 # Node ID ae5da477539e9b1d9c72cea03b106bea43ac3476 # Parent c0b233cd30cacae702b25ffad9d32ea34ffdb52a Move '#define closesocket close' preprocessor directive to a common place and put it under the proper '#ifndef HAVE_CLOSESOCKET' condition. diff -r c0b233cd30ca -r ae5da477539e stream/asf_mmst_streaming.c --- a/stream/asf_mmst_streaming.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/asf_mmst_streaming.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/asf_streaming.c --- a/stream/asf_streaming.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/asf_streaming.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/http.c --- a/stream/http.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/http.c Mon Sep 01 07:31:57 2008 +0000 @@ -12,7 +12,6 @@ #include #ifndef HAVE_WINSOCK2_H -#define closesocket close #else #include #include diff -r c0b233cd30ca -r ae5da477539e stream/librtsp/rtsp_session.c --- a/stream/librtsp/rtsp_session.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/librtsp/rtsp_session.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/network.c --- a/stream/network.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/network.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/network.h --- a/stream/network.h Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/network.h Mon Sep 01 07:31:57 2008 +0000 @@ -22,6 +22,10 @@ #include "url.h" #include "http.h" +#ifndef HAVE_CLOSESOCKET +#define closesocket close +#endif + #define BUFFER_SIZE 2048 typedef struct { diff -r c0b233cd30ca -r ae5da477539e stream/pnm.c --- a/stream/pnm.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/pnm.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/rtp.c --- a/stream/rtp.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/rtp.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/stream.c --- a/stream/stream.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/stream.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/stream_ftp.c --- a/stream/stream_ftp.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/stream_ftp.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/stream_netstream.c --- a/stream/stream_netstream.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/stream_netstream.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/stream_rtsp.c --- a/stream/stream_rtsp.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/stream_rtsp.c Mon Sep 01 07:31:57 2008 +0000 @@ -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 -r c0b233cd30ca -r ae5da477539e stream/tcp.c --- a/stream/tcp.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/tcp.c Mon Sep 01 07:31:57 2008 +0000 @@ -25,12 +25,12 @@ #include #include #include -#define closesocket close #else #include #include #endif +#include "network.h" #include "stream.h" #include "tcp.h" diff -r c0b233cd30ca -r ae5da477539e stream/udp.c --- a/stream/udp.c Sun Aug 31 13:59:54 2008 +0000 +++ b/stream/udp.c Mon Sep 01 07:31:57 2008 +0000 @@ -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"