]> granicus.if.org Git - vim/commitdiff
patch 8.2.3483: #ifdef for using sysinfo() is incomplete v8.2.3483
authorBram Moolenaar <Bram@vim.org>
Wed, 6 Oct 2021 10:27:21 +0000 (11:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 6 Oct 2021 10:27:21 +0000 (11:27 +0100)
Problem:    #ifdef for using sysinfo() is incomplete.
Solution:   Also check for HAVE_SYSINFO. Make autoconf check use TRY_LINK.
            (closes #8952)

src/auto/configure
src/configure.ac
src/memline.c
src/version.c

index be1440d3a711c539bd3a052104aea8bda0bcdb7e..cab7bc9fcaae8aeb191132df475f0c5fc97c1200 100755 (executable)
@@ -13954,7 +13954,7 @@ main ()
   return 0;
 }
 _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 "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 "not usable" >&6; }
 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_n "checking for sysinfo.mem_unit... " >&6; }
index d417b904627101a0a602ddaa0cd2b0244e236376..bb77485f31c530266e058aab918c8dfc6f0ff67d 100644 (file)
@@ -4113,9 +4113,10 @@ AC_TRY_COMPILE(
        AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
        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_TRY_COMPILE(
+AC_TRY_LINK(
 [#include <sys/types.h>
 #include <sys/sysinfo.h>],
 [      struct sysinfo sinfo;
index 9fc689f6c5dadfe7f6900f044648f73e3cb9bdd8..b43f10e12e68940cdfd8eeb32032f49c5e505d00 100644 (file)
@@ -1109,7 +1109,7 @@ add_b0_fenc(
     static int
 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;
     struct sysinfo  sinfo;
 
index b0049e00fb455ac0489f498a4057aa9ad07b9043..03b7022ad3c5a7e361ef77bdb7253acd2cfcfb8b 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3483,
 /**/
     3482,
 /**/