0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.3483: #ifdef for using sysinfo() is incomplete

Problem:    #ifdef for using sysinfo() is incomplete.
Solution:   Also check for HAVE_SYSINFO. Make autoconf check use TRY_LINK.
            (closes #8952)
This commit is contained in:
Bram Moolenaar
2021-10-06 11:27:21 +01:00
parent 78e0fa4cf4
commit e2982d6911
4 changed files with 9 additions and 5 deletions

5
src/auto/configure vendored
View File

@@ -13954,7 +13954,7 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h
@@ -13962,7 +13962,8 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5
$as_echo "not usable" >&6; } $as_echo "not usable" >&6; }
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5
$as_echo_n "checking for sysinfo.mem_unit... " >&6; } $as_echo_n "checking for sysinfo.mem_unit... " >&6; }

View File

@@ -4113,9 +4113,10 @@ AC_TRY_COMPILE(
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
AC_MSG_RESULT(not usable)) AC_MSG_RESULT(not usable))
dnl sysinfo() may exist but not be Linux compatible dnl sysinfo() may exist but not be Linux compatible.
dnl On some FreeBSD systems it may depend on libsysinfo, use TRY_LINK
AC_MSG_CHECKING(for sysinfo) AC_MSG_CHECKING(for sysinfo)
AC_TRY_COMPILE( AC_TRY_LINK(
[#include <sys/types.h> [#include <sys/types.h>
#include <sys/sysinfo.h>], #include <sys/sysinfo.h>],
[ struct sysinfo sinfo; [ struct sysinfo sinfo;

View File

@@ -1109,7 +1109,7 @@ add_b0_fenc(
static int static int
swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED) swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED)
{ {
# ifdef HAVE_SYSINFO_UPTIME #if defined(HAVE_SYSINFO) && defined(HAVE_SYSINFO_UPTIME)
stat_T st; stat_T st;
struct sysinfo sinfo; struct sysinfo sinfo;

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3483,
/**/ /**/
3482, 3482,
/**/ /**/