wincrypt.h is necessary here

The issue with this is that the if_nametoindex auto-detection code would
also need this hack, and it will make those super complicated.

The auto-detection is not normally run with cmake (but necessary to pass
a checkprefill test). With autotools however, it's required to detect
if_nametoindex.

`wincrypt.h` is not safe to include as-is because UWP does not support it,
but in this case this is safe because `if_nametoindex` is not supported by
UWP, and thus `HAVE_IF_NAMETOINDEX` is always undefined.
This commit is contained in:
Viktor Szakats 2025-07-24 15:04:12 +02:00
parent d42ad746ae
commit 8e4aa0d47b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -60,7 +60,9 @@
#endif
#if defined(HAVE_IF_NAMETOINDEX) && defined(_WIN32)
#include <winsock2.h>
#if __MINGW64_VERSION_MAJOR <= 5
#include <wincrypt.h> /* to avoid a mingw-w64 header issue */
#endif
#include <iphlpapi.h>
#endif