summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-29 22:55:39 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-29 22:55:39 +0000
commitc152b07e661cbc274cd4979e6b5e053a64656476 (patch)
tree095a8e6af4d608af6c36496227665b14ac6d4921 /stream
parent2a90e559a97e6a77f2caaf8975f4333c2b8766f3 (diff)
downloadmpv-c152b07e661cbc274cd4979e6b5e053a64656476.tar.bz2
mpv-c152b07e661cbc274cd4979e6b5e053a64656476.tar.xz
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
Diffstat (limited to 'stream')
-rw-r--r--stream/asf_mmst_streaming.c6
-rw-r--r--stream/asf_streaming.c7
-rw-r--r--stream/http.c8
-rw-r--r--stream/librtsp/rtsp_session.c13
-rw-r--r--stream/network.c8
-rw-r--r--stream/network.h4
-rw-r--r--stream/pnm.c10
-rw-r--r--stream/rtp.c12
-rw-r--r--stream/stream.c9
-rw-r--r--stream/stream_ftp.c7
-rw-r--r--stream/stream_netstream.c9
-rw-r--r--stream/stream_rtsp.c12
-rw-r--r--stream/tcp.c13
-rw-r--r--stream/udp.c12
14 files changed, 15 insertions, 115 deletions
diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c
index 5874998199..1e3db344b9 100644
--- a/stream/asf_mmst_streaming.c
+++ b/stream/asf_mmst_streaming.c
@@ -39,12 +39,6 @@
#include "mp_msg.h"
#include "help_mp.h"
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#else
-#include <winsock2.h>
-#endif
-
#ifndef CONFIG_SETLOCALE
#undef CONFIG_ICONV
#endif
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index 67dc7278b8..7a7ac86e51 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -8,13 +8,6 @@
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
-
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#else
-#include <winsock2.h>
-#endif
-
#include "url.h"
#include "http.h"
#include "libmpdemux/asf.h"
diff --git a/stream/http.c b/stream/http.c
index 048edeedca..303db09a47 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -11,14 +11,6 @@
#include <string.h>
#include <unistd.h>
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
-#include "http.h"
#include "url.h"
#include "mp_msg.h"
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index 5e897ba777..022aebf183 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -29,17 +29,6 @@
*/
#include <sys/types.h>
-#include "config.h"
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#else
-#include <winsock2.h>
-#endif
-
-
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
@@ -47,10 +36,12 @@
#include <string.h>
#include <inttypes.h>
+#include "config.h"
#include "mp_msg.h"
#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..282c9c2a28 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -18,14 +18,6 @@
#include "mp_msg.h"
#include "help_mp.h"
-
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
#include "stream.h"
#include "libmpdemux/demuxer.h"
#include "m_config.h"
diff --git a/stream/network.h b/stream/network.h
index b3d6abc8c4..5ec0233648 100644
--- a/stream/network.h
+++ b/stream/network.h
@@ -17,6 +17,10 @@
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#define closesocket close
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
#endif
#include "url.h"
diff --git a/stream/pnm.c b/stream/pnm.c
index d9d9513897..946d9273c2 100644
--- a/stream/pnm.c
+++ b/stream/pnm.c
@@ -35,17 +35,9 @@
#include <stdlib.h>
#include <sys/time.h>
#include <inttypes.h>
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#include <sys/socket.h>
-//#include <netinet/in.h>
-//#include <netdb.h>
-#else
-#include <winsock2.h>
-#endif
#include "libavutil/intreadwrite.h"
-
+#include "network.h"
#include "stream.h"
#include "libmpdemux/demuxer.h"
#include "help_mp.h"
diff --git a/stream/rtp.c b/stream/rtp.c
index f4b84fc3b4..c2a3857651 100644
--- a/stream/rtp.c
+++ b/stream/rtp.c
@@ -12,17 +12,9 @@
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
-#include "config.h"
-#ifndef HAVE_WINSOCK2_H
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
#include <errno.h>
+#include "config.h"
+#include "network.h"
#include "stream.h"
/* MPEG-2 TS RTP stack */
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 <strings.h>
#include "config.h"
-
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#else
-#include <winsock2.h>
-#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..253bf057fb 100644
--- a/stream/stream_ftp.c
+++ b/stream/stream_ftp.c
@@ -9,14 +9,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
-#ifndef HAVE_WINSOCK2_H
-#include <sys/socket.h>
-#define closesocket close
-#else
-#include <winsock2.h>
-#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..36bb72ccc2 100644
--- a/stream/stream_netstream.c
+++ b/stream/stream_netstream.c
@@ -42,15 +42,6 @@
#include <inttypes.h>
#include <errno.h>
-#ifndef HAVE_WINSOCK2_H
-#define closesocket close
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#else
-#include <winsock2.h>
-#endif
-
#include "mp_msg.h"
#include "stream.h"
#include "help_mp.h"
diff --git a/stream/stream_rtsp.c b/stream/stream_rtsp.c
index d5c02852c1..9cf877a11a 100644
--- a/stream/stream_rtsp.c
+++ b/stream/stream_rtsp.c
@@ -27,18 +27,10 @@
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
-#include "config.h"
-#ifndef HAVE_WINSOCK2_H
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
#include <errno.h>
+#include "config.h"
+#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..e75e89d609 100644
--- a/stream/tcp.c
+++ b/stream/tcp.c
@@ -19,18 +19,7 @@
#include "mp_msg.h"
#include "help_mp.h"
-
-#ifndef HAVE_WINSOCK2_H
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
+#include "network.h"
#include "stream.h"
#include "tcp.h"
diff --git a/stream/udp.c b/stream/udp.c
index 52d47a0991..eaa0128b0c 100644
--- a/stream/udp.c
+++ b/stream/udp.c
@@ -31,18 +31,8 @@
#include <sys/time.h>
#include <ctype.h>
-#ifndef HAVE_WINSOCK2_H
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#define closesocket close
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
#include "mp_msg.h"
+#include "network.h"
#include "url.h"
#include "udp.h"