Skip to content

Commit

Permalink
Include winsock.h when checking for netdb function
Browse files Browse the repository at this point in the history
also move `gethostname` to that check
  • Loading branch information
naveen521kk authored and lazka committed Jul 19, 2023
1 parent 9769e0c commit 452b0ce
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4867,7 +4867,7 @@ AC_CHECK_FUNCS([ \
faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
getgrnam_r getgrouplist getgroups gethostname getitimer getloadavg getlogin \
getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \
getpeername getpgid getpid getppid getpriority _getpty \
getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \
getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \
Expand Down Expand Up @@ -5110,7 +5110,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
Expand All @@ -5119,6 +5125,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], [
Expand Down

0 comments on commit 452b0ce

Please sign in to comment.