]> Savannah Git Hosting - gnulib.git/commitdiff
Fix warnings for functions introduced in Android API level 29.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:39 +0000 (21:55 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:39 +0000 (21:55 +0100)
* m4/getloadavg.m4 (gl_GETLOADAVG): Test for getloadavg using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.

ChangeLog
m4/getloadavg.m4

index 081efd1494045424b3832fdab93283750ab7156e..cae9026535939e46c4202c38a34c5fdd1d4f8086 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-19  Bruno Haible  <bruno@clisp.org>
+
+       Fix warnings for functions introduced in Android API level 29.
+       * m4/getloadavg.m4 (gl_GETLOADAVG): Test for getloadavg using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.
+
 2023-01-19  Bruno Haible  <bruno@clisp.org>
 
        Fix warnings for functions introduced in Android API level 28.
index 79e420baae8f7b8c0fc7d9bd13ca129d44cb06b3..067f142abce77fd361363386739e7dd8a2fef7cb 100644 (file)
@@ -7,7 +7,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 10
+#serial 11
 
 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
 # New applications should use gl_GETLOADAVG instead.
@@ -25,8 +25,9 @@ gl_save_LIBS=$LIBS
 # getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
 # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
 HAVE_GETLOADAVG=1
-AC_CHECK_FUNC([getloadavg], [],
-  [gl_func_getloadavg_done=no
+gl_CHECK_FUNCS_ANDROID([getloadavg], [[#include <stdlib.h>]])
+if test $ac_cv_func_getloadavg != yes; then
+   gl_func_getloadavg_done=no
 
    # Some systems with -lutil have (and need) -lkvm as well, some do not.
    # On Solaris, -lkvm requires nlist from -lelf, so check that first
@@ -73,7 +74,8 @@ AC_CHECK_FUNC([getloadavg], [],
           AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
           AC_CHECK_LIB([dgc], [dg_sys_info])])
      fi
-   fi])
+   fi
+fi
 
 if test "x$gl_save_LIBS" = x; then
   GETLOADAVG_LIBS=$LIBS