From e5da076f8146ce4e8d80ef2e5958da594fb547fd Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 21 Jun 2024 12:53:04 +0200 Subject: [PATCH] configure: check for socklen_t and substitute with a replacement if not available This unifies MHD code as socklen_t could universally used --- configure.ac | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/configure.ac b/configure.ac index 871a5a27..0d28e2ee 100644 --- a/configure.ac +++ b/configure.ac @@ -555,6 +555,39 @@ AS_IF([test "x$ac_cv_type_size_t" != "xyes"], [AC_MSG_FAILURE(['size_t' type is not provided by system headers])] ) +AC_CHECK_TYPE([socklen_t], + [], + [AC_DEFINE([socklen_t],[int],[Define to suitable 'socklen_t' replacement if 'socklen_t' is not defined by system headers])], + [[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ +#include +#ifdef HAVE_INTTYPES_H +#include +#endif /* HAVE_INTTYPES_H */ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif /* HAVE_NETINET_IN_SYSTM_H */ +#ifdef HAVE_NETINET_IN_H +#include +#endif /* HAVE_NETINET_IN_H */ +#ifdef HAVE_UNISTD_H +#include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_SOCKLIB_H +#include +#endif /* HAVE_SOCKLIB_H */ +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#include +#endif /* _WIN32 && ! __CYGWIN__ */ + ]] +) + AC_CHECK_HEADER([[search.h]], [ MHD_CHECK_LINK_RUN([[for proper tsearch(), tfind() and tdelete()]],[[mhd_cv_sys_tsearch_usable]],