[vlc-commits] udp: document why we need wincrypt.h with iphlpapi.h

Steve Lhomme git at videolan.org
Fri Jun 19 12:00:14 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 18 15:40:53 2020 +0200| [bdf2857fb17e9596fe3cb59908201a6332a0a8a2] | committer: Steve Lhomme

udp: document why we need wincrypt.h with iphlpapi.h

Older versions of mingw had bogus headers when using WIN32_LEAN_AND_MEAN.
Also integrate the patch from Francois to fix the detection in configure.

Co-authored-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 configure.ac      | 3 +++
 src/network/udp.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 89fc36cdf4..977029016e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1069,6 +1069,9 @@ AS_IF([test "${SYS}" = "mingw32"], [
   AC_MSG_CHECKING(for if_nametoindex availability)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
       [[#include <windows.h>
+        #if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 6
+        # include <wincrypt.h>
+        #endif
         #include <iphlpapi.h>
         static void test (void) {
           if_nametoindex("");
diff --git a/src/network/udp.c b/src/network/udp.c
index dbac266b66..f2361e3cd4 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -40,7 +40,9 @@
 #ifdef _WIN32
 #   undef EAFNOSUPPORT
 #   define EAFNOSUPPORT WSAEAFNOSUPPORT
-#   include <wincrypt.h>
+#   if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 6
+#    include <wincrypt.h>
+#   endif
 #   include <iphlpapi.h>
 #else
 #   include <unistd.h>



More information about the vlc-commits mailing list