Files
MINGW-packages/mingw-w64-python3/2010-configure-have-inet-pton.patch
Christoph Reiter 91a728c082 python3: fix HAVE_INET_PTON configure check on Windows. Fixes #5184
HAVE_INET_PTON is hardcoded to 1 in the official Windows build. Since we use autotools
we need to make the check work on Windows.

This makes socket.inet_ntop() and socket.inet_pton() available like with the official build.
2019-04-13 17:56:50 +02:00

18 lines
521 B
Diff

--- Python-3.7.2/configure.ac.orig 2019-04-13 17:14:32.296998700 +0200
+++ Python-3.7.2/configure.ac 2019-04-13 17:27:16.307347800 +0200
@@ -4107,10 +4107,14 @@
AC_MSG_CHECKING(for inet_pton)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#endif
]], [[void* p = inet_pton]])],
[AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
AC_MSG_RESULT(yes)],