MINGW-packages/mingw-w64-python3.13/0083-Include-winsock.h-when-checking-for-netdb-function.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

47 lines
1.8 KiB
Diff

From 087440c7bf0af88eb777aaa48977f9e7a7397860 Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Wed, 21 Jun 2023 15:42:39 +0530
Subject: [PATCH 083/N] Include `winsock.h` when checking for netdb function
also move `gethostname` to that check
---
configure.ac | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index fccf9b6..e74d042 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5501,7 +5501,7 @@ AC_CHECK_FUNCS([ \
faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
gai_strerror getegid geteuid getgid getgrent getgrgid getgrgid_r \
- getgrnam_r getgrouplist gethostname getitimer getloadavg getlogin getlogin_r \
+ getgrnam_r getgrouplist getitimer getloadavg getlogin getlogin_r \
getpeername getpgid getpid getppid getpriority _getpty \
getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \
getspnam getuid getwd grantpt if_nameindex initgroups kill killpg lchown linkat \
@@ -5744,7 +5744,13 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [
])
dnl PY_CHECK_NETDB_FUNC(FUNCTION)
-AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [@%:@include <netdb.h>])])
+AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [
+#ifdef _WIN32
+ #include <winsock.h>
+#else
+ #include <netdb.h>
+#endif
+])])
PY_CHECK_NETDB_FUNC([hstrerror])
dnl not available in WASI yet
@@ -5753,6 +5759,7 @@ PY_CHECK_NETDB_FUNC([getservbyport])
PY_CHECK_NETDB_FUNC([gethostbyname])
PY_CHECK_NETDB_FUNC([gethostbyaddr])
PY_CHECK_NETDB_FUNC([getprotobyname])
+PY_CHECK_NETDB_FUNC([gethostname])
dnl PY_CHECK_SOCKET_FUNC(FUNCTION)
AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [