Browse Source

compat: fix inet_pton declaration

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
pull/47/head
Richard Diamond 11 years ago
committed by Jean-Baptiste Kempf
parent
commit
810702d4ce
  1. 3
      compat/inet_pton.c
  2. 7
      include/vlc_fixups.h

3
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;

7
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

Loading…
Cancel
Save