summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Gruetzmacher <tobias-git@23.gs>2015-01-17 00:45:27 (GMT)
committerTobias Gruetzmacher <tobias-git@23.gs>2015-01-17 00:45:27 (GMT)
commit60c424126da8cc63f62ed414ab8c704cd657f75e (patch)
tree0b1b74f72f5b592e76a4949981e7f3bcfd6ecd91
parent62ebd7a23e841a38425b8ae9d1bc61ae8c13cd92 (diff)
downloadmxe-60c424126da8cc63f62ed414ab8c704cd657f75e.zip
mxe-60c424126da8cc63f62ed414ab8c704cd657f75e.tar.gz
mxe-60c424126da8cc63f62ed414ab8c704cd657f75e.tar.bz2
Don't expose if_nametoindex and if_indextoname in WinXP.
These APIs were only added in Vista (>= 0x6000) and those definitions conflict with other projects (glib).
-rw-r--r--src/mingw-w64-2-netioapi-winxp.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mingw-w64-2-netioapi-winxp.patch b/src/mingw-w64-2-netioapi-winxp.patch
new file mode 100644
index 0000000..7b13a5a
--- /dev/null
+++ b/src/mingw-w64-2-netioapi-winxp.patch
@@ -0,0 +1,29 @@
+This file is part of MXE.
+See index.html for further information.
+
+Some functions in netioapi.h were only added in Windows Vista. This patch removes
+function definitions for if_nametoindex and if_indextoname on older API
+versions, so they don't conflict with replacement implementations in libraries
+(e.g. glib).
+
+This is fixed on the 4.x branch of mingw-w64.
+
+diff -Naur mingw-w64-v3.3.0.orig/mingw-w64-headers/include/netioapi.h mingw-w64-v3.3.0/mingw-w64-headers/include/netioapi.h
+--- mingw-w64-v3.3.0.orig/mingw-w64-headers/include/netioapi.h 2015-01-17 00:07:51.030935703 +0100
++++ mingw-w64-v3.3.0/mingw-w64-headers/include/netioapi.h 2015-01-17 01:09:47.546591536 +0100
+@@ -311,6 +311,7 @@
+ PNET_LUID InterfaceLuid
+ );
+
++#if (_WIN32_WINNT >= 0x0600)
+ PCHAR WINAPI if_indextoname(
+ NET_IFINDEX InterfaceIndex,
+ PCHAR InterfaceName
+@@ -319,6 +320,7 @@
+ NET_IFINDEX WINAPI if_nametoindex(
+ PCSTR InterfaceName
+ );
++#endif
+
+ NETIO_STATUS WINAPI ConvertInterfaceGuidToLuid(
+ const GUID *InterfaceGuid,