From e0be19968c1329280ed5af8da095651d4a7fb9cf Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 7 Jul 2022 17:19:39 +1200 Subject: [PATCH] Include in check for sys_errlist That's where it is with mingw and MSVC. (cherry picked from commit 285806c55f6a4627e4e9f3a92c823f3f76d59674) --- xapian-core/common/errno_to_string.cc | 2 +- xapian-core/configure.ac | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xapian-core/common/errno_to_string.cc b/xapian-core/common/errno_to_string.cc index e822e0175..be6e19229 100644 --- a/xapian-core/common/errno_to_string.cc +++ b/xapian-core/common/errno_to_string.cc @@ -31,7 +31,7 @@ #if defined HAVE__SYS_ERRLIST_AND__SYS_NERR || \ defined HAVE_SYS_ERRLIST_AND_SYS_NERR # include -// Under mingw, these are in stdlib.h. +// Under mingw and MSVC these are in stdlib.h. # include #endif diff --git a/xapian-core/configure.ac b/xapian-core/configure.ac index d1d7d8bb3..6f495b8a1 100644 --- a/xapian-core/configure.ac +++ b/xapian-core/configure.ac @@ -720,9 +720,11 @@ AC_CACHE_CHECK([for sys_errlist and sys_nerr], xo_cv_sys_errlist_and_sys_nerr, [ AC_LINK_IFELSE([AC_LANG_PROGRAM( dnl On Linux, sys_errlist and sys_nerr need , though the man page dnl says . The man page seems to match other platforms such as -dnl NetBSD, so include both headers to ensure we get them. +dnl NetBSD, so include both headers to ensure we get them. With mingw and MSVC +dnl they're provided by . [[#include -#include ]], +#include +#include ]], [[ printf("%s", sys_errlist[sys_nerr - 1]);]])], [ xo_cv_sys_errlist_and_sys_nerr=yes ], [ xo_cv_sys_errlist_and_sys_nerr=no ]) @@ -734,7 +736,8 @@ fi AC_CACHE_CHECK([for _sys_errlist and _sys_nerr], xo_cv__sys_errlist_and__sys_nerr, [ AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include -#include ]], +#include +#include ]], [[ printf("%s", _sys_errlist[_sys_nerr - 1]);]])], [ xo_cv__sys_errlist_and__sys_nerr=yes ], [ xo_cv__sys_errlist_and__sys_nerr=no -- 2.11.4.GIT