[vlc-commits] compat: fix inet_pton declaration

Richard Diamond git at videolan.org
Wed Jul 6 14:15:17 CEST 2016


vlc | branch: master | Richard Diamond <wichard at vitalitystudios.com> | Thu Mar 24 16:48:14 2016 -0500| [810702d4ce498b5dc06959c5a6778b2717efc294] | committer: Jean-Baptiste Kempf

compat: fix inet_pton declaration

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 compat/inet_pton.c   |    3 ++-
 include/vlc_fixups.h |    7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/compat/inet_pton.c b/compat/inet_pton.c
index fb825c2..7052a1a 100644
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
@@ -30,6 +30,7 @@
 # include <sys/socket.h>
 #else
 # include <winsock2.h>
+# include <ws2tcpip.h>
 # undef EAFNOSUPPORT
 # define EAFNOSUPPORT WSAEAFNOSUPPORT
 #endif
@@ -48,7 +49,7 @@ int inet_pton (int af, const char *src, void *dst)
     return -1;
 }
 
-const char *inet_ntop (int af, const void *src, char *dst, int len)
+const char *inet_ntop (int af, const void *src, char *dst, socklen_t len)
 {
     const unsigned char *b = src;
 
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 39581ff..2b4fe20 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -320,8 +320,13 @@ void swab (const void *, void *, ssize_t);
 
 /* Socket stuff */
 #ifndef HAVE_INET_PTON
+# ifndef _WIN32
+#  include <sys/socket.h>
+# else
+#  include <ws2tcpip.h>
+# endif
 int inet_pton(int, const char *, void *);
-const char *inet_ntop(int, const void *, char *, int);
+const char *inet_ntop(int, const void *, char *, socklen_t);
 #endif
 
 #ifndef HAVE_STRUCT_POLLFD



More information about the vlc-commits mailing list