To: vim_dev@googlegroups.com Subject: Patch 8.2.3483 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3483 Problem: #ifdef for using sysinfo() is incomplete. Solution: Also check for HAVE_SYSINFO. Make autoconf check use TRY_LINK. (closes #8952) Files: src/memline.c, src/configure.ac, src/auto/configure *** ../vim-8.2.3482/src/memline.c 2021-08-25 16:31:29.845375905 +0100 --- src/memline.c 2021-10-05 15:07:42.445441645 +0100 *************** *** 1109,1115 **** static int swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED) { ! # ifdef HAVE_SYSINFO_UPTIME stat_T st; struct sysinfo sinfo; --- 1109,1115 ---- static int swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED) { ! #if defined(HAVE_SYSINFO) && defined(HAVE_SYSINFO_UPTIME) stat_T st; struct sysinfo sinfo; *** ../vim-8.2.3482/src/configure.ac 2021-09-09 16:14:46.642989948 +0100 --- src/configure.ac 2021-10-06 11:24:05.940075413 +0100 *************** *** 4113,4121 **** AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), AC_MSG_RESULT(not usable)) ! dnl sysinfo() may exist but not be Linux compatible AC_MSG_CHECKING(for sysinfo) ! AC_TRY_COMPILE( [#include #include ], [ struct sysinfo sinfo; --- 4113,4122 ---- AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), AC_MSG_RESULT(not usable)) ! 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_TRY_LINK( [#include #include ], [ struct sysinfo sinfo; *** ../vim-8.2.3482/src/auto/configure 2021-09-09 16:14:46.646989941 +0100 --- src/auto/configure 2021-10-06 11:24:49.412651613 +0100 *************** *** 13954,13960 **** return 0; } _ACEOF ! if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h --- 13954,13960 ---- return 0; } _ACEOF ! if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h *************** *** 13962,13968 **** { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi ! rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5 $as_echo_n "checking for sysinfo.mem_unit... " >&6; } --- 13962,13969 ---- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi ! 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_n "checking for sysinfo.mem_unit... " >&6; } *** ../vim-8.2.3482/src/version.c 2021-10-05 21:58:49.164899480 +0100 --- src/version.c 2021-10-06 11:26:39.550115350 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3483, /**/ -- hundred-and-one symptoms of being an internet addict: 108. While reading a magazine, you look for the Zoom icon for a better look at a photograph. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///