Skip to content

Commit

Permalink
config-win32: add support for if_nametoindex and getsockname
Browse files Browse the repository at this point in the history
Closes #3923
  • Loading branch information
Zenju authored and MarcelRaad committed May 23, 2019
1 parent c2a8d52 commit 170bd04
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 16 additions & 2 deletions lib/config-win32.h
Expand Up @@ -154,6 +154,11 @@
#define HAVE_WS2TCPIP_H 1
#endif

/* Define if you have the <Iphlpapi.h> header file. */
#ifndef __SALFORDC__
#define HAVE_IPHLPAPI_H 1
#endif

/* ---------------------------------------------------------------- */
/* OTHER HEADER INFO */
/* ---------------------------------------------------------------- */
Expand Down Expand Up @@ -188,6 +193,9 @@
/* Define to 1 if you have the `getpeername' function. */
#define HAVE_GETPEERNAME 1

/* Define to 1 if you have the getsockname function. */
#define HAVE_GETSOCKNAME 1

/* Define if you have the gethostbyaddr function. */
#define HAVE_GETHOSTBYADDR 1

Expand Down Expand Up @@ -582,8 +590,9 @@ Vista
# endif
#endif

/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
quite convoluted, compiler dependent and even build target dependent. */
/* Availability of freeaddrinfo, getaddrinfo, getnameinfo and if_nametoindex
functions is quite convoluted, compiler dependent and even build target
dependent. */
#if defined(HAVE_WS2TCPIP_H)
# if defined(__POCC__)
# define HAVE_FREEADDRINFO 1
Expand All @@ -602,6 +611,11 @@ Vista
# define HAVE_GETNAMEINFO 1
# endif
#endif
#if defined(HAVE_IPHLPAPI_H)
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
#define HAVE_IF_NAMETOINDEX 1
#endif
#endif

#if defined(__POCC__)
# ifndef _MSC_VER
Expand Down
4 changes: 3 additions & 1 deletion lib/url.c
Expand Up @@ -34,10 +34,12 @@
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#ifdef HAVE_IPHLPAPI_H
#include <Iphlpapi.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif

#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
Expand Down

0 comments on commit 170bd04

Please sign in to comment.