[vlc-commits] include: assume sys/socket.h is available everywhere except on Win32

Steve Lhomme git at videolan.org
Thu Apr 12 13:32:35 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr 12 13:32:31 2018 +0200| [d9cdaef0dd15a488c0922625b104fae21f56fb6f] | committer: Steve Lhomme

include: assume sys/socket.h is available everywhere except on Win32

Oh well...

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d9cdaef0dd15a488c0922625b104fae21f56fb6f
---

 include/vlc_fixups.h    | 4 ++--
 include/vlc_interrupt.h | 4 ++--
 include/vlc_network.h   | 4 +---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 0d9abed520..037f67da31 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -370,9 +370,9 @@ void swab (const void *, void *, ssize_t);
 
 /* Socket stuff */
 #ifndef HAVE_INET_PTON
-# ifdef HAVE_SYS_SOCKET_H
+# ifndef _WIN32
 #  include <sys/socket.h>
-# elif defined(_WIN32)
+#else
 typedef int socklen_t;
 # endif
 int inet_pton(int, const char *, void *);
diff --git a/include/vlc_interrupt.h b/include/vlc_interrupt.h
index 1195c19d33..a6fb303200 100644
--- a/include/vlc_interrupt.h
+++ b/include/vlc_interrupt.h
@@ -21,9 +21,9 @@
 #ifndef VLC_INTERRUPT_H
 # define VLC_INTERRUPT_H 1
 # include <vlc_threads.h>
-# ifdef HAVE_SYS_SOCKET_H
+# ifndef _WIN32
 #  include <sys/socket.h> /* socklen_t */
-# elif defined(_WIN32)
+# else
 #  include <ws2tcpip.h>
 # endif
 
diff --git a/include/vlc_network.h b/include/vlc_network.h
index 1a80759dd5..184c23acae 100644
--- a/include/vlc_network.h
+++ b/include/vlc_network.h
@@ -50,9 +50,7 @@
 #       define IPV6_V6ONLY 27
 #   endif
 #else
-#   ifdef HAVE_SYS_SOCKET_H
-#       include <sys/socket.h>
-#   endif
+#   include <sys/socket.h>
 #   include <netinet/in.h>
 #   include <netdb.h>
 #   define net_errno errno



More information about the vlc-commits mailing list