use the proper check for sys/socket.h availability

This commit is contained in:
Steve Lhomme 2018-04-12 13:00:54 +02:00
parent 34bfcde533
commit 333ed248b9
17 changed files with 34 additions and 10 deletions

View File

@ -26,9 +26,9 @@
#include <errno.h>
#include <sys/types.h>
#ifndef _WIN32
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#else
#elif defined(_WIN32)
# include <winsock2.h>
# include <ws2tcpip.h>
# undef EAFNOSUPPORT

View File

@ -88,7 +88,9 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/uio.h>
ssize_t recvmsg(int fd, struct msghdr *msg, int flags)

View File

@ -78,7 +78,9 @@ ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/uio.h>
ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)

View File

@ -370,9 +370,9 @@ void swab (const void *, void *, ssize_t);
/* Socket stuff */
#ifndef HAVE_INET_PTON
# ifndef _WIN32
# ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#else
# elif defined(_WIN32)
typedef int socklen_t;
# endif
int inet_pton(int, const char *, void *);

View File

@ -21,9 +21,9 @@
#ifndef VLC_INTERRUPT_H
# define VLC_INTERRUPT_H 1
# include <vlc_threads.h>
# ifndef _WIN32
# ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h> /* socklen_t */
# else
# elif defined(_WIN32)
# include <ws2tcpip.h>
# endif

View File

@ -50,7 +50,9 @@
# define IPV6_V6ONLY 27
# endif
#else
# include <sys/socket.h>
# ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# endif
# include <netinet/in.h>
# include <netdb.h>
# define net_errno errno

View File

@ -29,7 +29,9 @@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <vlc_common.h>
#include <vlc_block.h>

View File

@ -29,7 +29,9 @@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <vlc_common.h>
#include <vlc_block.h>

View File

@ -31,7 +31,9 @@
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifndef SOCK_CLOEXEC
# define SOCK_CLOEXEC 0
# define accept4(a,b,c,d) accept(a,b,c)

View File

@ -43,7 +43,7 @@
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
#else
#elif defined (HAVE_SYS_SOCKET_H)
# include <sys/socket.h>
#endif

View File

@ -399,7 +399,9 @@ int vlc_poll_i11e(struct pollfd *fds, unsigned nfds, int timeout)
# include <fcntl.h>
# include <sys/uio.h>
# include <sys/socket.h>
# ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# endif
/* There are currently no ways to atomically force a non-blocking read or write

View File

@ -55,7 +55,7 @@
#if defined(_WIN32)
# include <winsock2.h>
#else
#elif defined(HAVE_SYS_SOCKET_H)
# include <sys/socket.h>
#endif

View File

@ -41,7 +41,9 @@ int rootwrap_bind (int, int, int, const struct sockaddr *, size_t);
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/uio.h>
#include <sys/un.h>
#include <netinet/in.h>

View File

@ -38,7 +38,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <dirent.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <signal.h>
#include <vlc_common.h>

View File

@ -40,7 +40,9 @@
#include <time.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/time.h>
#include <sys/select.h>

View File

@ -38,7 +38,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <dirent.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <vlc_common.h>
#include <vlc_fs.h>

View File

@ -29,7 +29,9 @@
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <poll.h>
#include <vlc_common.h>