changeset 27464:be85aae103f2

Move duplicated '#define closesocket close' into network.h along with network-related #include #ifdeffery.
author diego
date Fri, 29 Aug 2008 22:55:39 +0000
parents e16088a911c1
children b3bfe83d77f9
files stream/asf_mmst_streaming.c stream/asf_streaming.c stream/http.c stream/librtsp/rtsp_session.c stream/network.c stream/network.h stream/pnm.c stream/rtp.c stream/stream.c stream/stream_ftp.c stream/stream_netstream.c stream/stream_rtsp.c stream/tcp.c stream/udp.c
diffstat 14 files changed, 15 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/stream/asf_mmst_streaming.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/asf_mmst_streaming.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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
--- a/stream/asf_streaming.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/asf_streaming.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/http.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/http.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
 
--- a/stream/librtsp/rtsp_session.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/librtsp/rtsp_session.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/network.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/network.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/network.h	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/network.h	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/pnm.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/pnm.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/rtp.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/rtp.c	Fri Aug 29 22:55:39 2008 +0000
@@ -12,17 +12,9 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <ctype.h>
+#include <errno.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 "network.h"
 #include "stream.h"
 
 /* MPEG-2 TS RTP stack */
--- a/stream/stream.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/stream.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
 
--- a/stream/stream_ftp.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/stream_ftp.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/stream_netstream.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/stream_netstream.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/stream_rtsp.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/stream_rtsp.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
--- a/stream/tcp.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/tcp.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"
 
--- a/stream/udp.c	Fri Aug 29 22:29:27 2008 +0000
+++ b/stream/udp.c	Fri Aug 29 22:55:39 2008 +0000
@@ -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"