Commit 6abdc06d authored by LRN's avatar LRN Committed by Philip Withnall

W32: Bump target NT version to 0x601 (7 or newer)

Also remove now-unnecessary if_nametoindex() implementation
(the HAVE_IF_NAMETOINDEX configure check didn't work correctly, it turned out),
which prevents glib from building. if_nametoindex() is available in lphlpapi since
Vista[1], so we don't need a compatibility function for it anymore, as Windows 7
is the new minimally-required version.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/bb408409(v=vs.85).aspx

https://bugzilla.gnome.org/show_bug.cgi?id=788180
parent b444ae0d
......@@ -144,7 +144,7 @@ case "$host" in
;;
esac
AC_DEFINE([_WIN32_WINNT], [0x0501], [Target the Windows XP API])
AC_DEFINE([_WIN32_WINNT], [0x0601], [Target the Windows 7 API])
;;
*)
glib_native_win32=no
......
......@@ -2155,63 +2155,6 @@ g_socket_bind (GSocket *socket,
return TRUE;
}
#if !defined(HAVE_IF_NAMETOINDEX) && defined(G_OS_WIN32)
static guint
if_nametoindex (const gchar *iface)
{
PIP_ADAPTER_ADDRESSES addresses = NULL, p;
gulong addresses_len = 0;
guint idx = 0;
DWORD res;
if (ws2funcs.pIfNameToIndex != NULL)
return ws2funcs.pIfNameToIndex (iface);
res = GetAdaptersAddresses (AF_UNSPEC, 0, NULL, NULL, &addresses_len);
if (res != NO_ERROR && res != ERROR_BUFFER_OVERFLOW)
{
if (res == ERROR_NO_DATA)
errno = ENXIO;
else
errno = EINVAL;
return 0;
}
addresses = g_malloc (addresses_len);
res = GetAdaptersAddresses (AF_UNSPEC, 0, NULL, addresses, &addresses_len);
if (res != NO_ERROR)
{
g_free (addresses);
if (res == ERROR_NO_DATA)
errno = ENXIO;
else
errno = EINVAL;
return 0;
}
p = addresses;
while (p)
{
if (strcmp (p->AdapterName, iface) == 0)
{
idx = p->IfIndex;
break;
}
p = p->Next;
}
if (p == NULL)
errno = ENXIO;
g_free (addresses);
return idx;
}
#define HAVE_IF_NAMETOINDEX 1
#endif
static gboolean
g_socket_multicast_group_operation (GSocket *socket,
GInetAddress *group,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment