network: Include unistd.h from network.h
authorMartin Storsjö <martin@martin.st>
Sun, 24 Jun 2012 21:39:57 +0000 (00:39 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 26 Jun 2012 14:22:21 +0000 (17:22 +0300)
This heaader is required for close() for sockets in network
code. For winsock, the equivalent function is defined in the
winsock2.h header.

This avoids having the HAVE_UNISTD_H in all files dealing with
raw sockets.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/network.h
libavformat/sctp.c
libavformat/tcp.c
libavformat/udp.c

index 1dc9deb..3e4422e 100644 (file)
 #include "libavutil/error.h"
 #include "os_support.h"
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
 #include <ws2tcpip.h>
index 07de498..7bcb5ae 100644 (file)
@@ -39,7 +39,6 @@
 
 #include <netinet/in.h>
 #include <netinet/sctp.h>
-#include <unistd.h>
 
 #include "config.h"
 
index e77e4c5..badc0ba 100644 (file)
@@ -20,7 +20,6 @@
  */
 #include "avformat.h"
 #include "libavutil/parseutils.h"
-#include <unistd.h>
 #include "internal.h"
 #include "network.h"
 #include "os_support.h"
index 39db263..71b445b 100644 (file)
@@ -30,7 +30,6 @@
 #include "avio_internal.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/avstring.h"
-#include <unistd.h>
 #include "internal.h"
 #include "network.h"
 #include "os_support.h"