From 909873441124b0f80b1427d55d02d8b6b5992890 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 19 Jan 2023 21:55:23 +0100 Subject: [PATCH 06/15] Fix warnings for functions introduced in Android API level 18. * m4/getdelim.m4 (gl_FUNC_GETDELIM): Test for getdelim using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/getline.m4 (gl_FUNC_GETLINE): Test for getline using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC. * m4/log2.m4 (gl_FUNC_LOG2): Test for log2 using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. * m4/log2f.m4 (gl_FUNC_LOG2F): Test for log2f using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. * m4/log2l.m4 (gl_FUNC_LOG2L): Test for log2l using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. --- ChangeLog | 14 ++++++++++++++ m4/getdelim.m4 | 4 ++-- m4/getline.m4 | 13 ++++++------- m4/log2.m4 | 4 ++-- m4/log2f.m4 | 4 ++-- m4/log2l.m4 | 4 ++-- 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0704164a25..7d80045e81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2023-01-19 Bruno Haible + + Fix warnings for functions introduced in Android API level 18. + * m4/getdelim.m4 (gl_FUNC_GETDELIM): Test for getdelim using + gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. + * m4/getline.m4 (gl_FUNC_GETLINE): Test for getline using + gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC. + * m4/log2.m4 (gl_FUNC_LOG2): Test for log2 using + gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. + * m4/log2f.m4 (gl_FUNC_LOG2F): Test for log2f using + gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. + * m4/log2l.m4 (gl_FUNC_LOG2L): Test for log2l using + gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. + 2023-01-19 Bruno Haible Fix warnings for functions introduced in Android API level 16 or 17. diff --git a/m4/getdelim.m4 b/m4/getdelim.m4 index 9aaed202ab..bbd7c03bcb 100644 --- a/m4/getdelim.m4 +++ b/m4/getdelim.m4 @@ -1,4 +1,4 @@ -# getdelim.m4 serial 16 +# getdelim.m4 serial 17 dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. dnl @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_GETDELIM], AC_CHECK_DECLS_ONCE([getdelim]) - AC_CHECK_FUNCS_ONCE([getdelim]) + gl_CHECK_FUNCS_ANDROID([getdelim], [[#include ]]) if test $ac_cv_func_getdelim = yes; then HAVE_GETDELIM=1 dnl Found it in some library. Verify that it works. diff --git a/m4/getline.m4 b/m4/getline.m4 index 03569f06b2..f68fa3a1ac 100644 --- a/m4/getline.m4 +++ b/m4/getline.m4 @@ -1,4 +1,4 @@ -# getline.m4 serial 30 +# getline.m4 serial 31 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation, dnl Inc. @@ -23,12 +23,9 @@ AC_DEFUN([gl_FUNC_GETLINE], AC_CHECK_DECLS_ONCE([getline]) - gl_getline_needs_run_time_check=no - AC_CHECK_FUNC([getline], - [dnl Found it in some library. Verify that it works. - gl_getline_needs_run_time_check=yes], - [am_cv_func_working_getline=no]) - if test $gl_getline_needs_run_time_check = yes; then + gl_CHECK_FUNCS_ANDROID([getline], [[#include ]]) + if test $ac_cv_func_getline = yes; then + dnl Found it in some library. Verify that it works. AC_CACHE_CHECK([for working getline function], [am_cv_func_working_getline], [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data @@ -85,6 +82,8 @@ AC_DEFUN([gl_FUNC_GETLINE], ]) ]) ]) + else + am_cv_func_working_getline=no fi if test $ac_cv_have_decl_getline = no; then diff --git a/m4/log2.m4 b/m4/log2.m4 index acf092fed1..4e08f48fe8 100644 --- a/m4/log2.m4 +++ b/m4/log2.m4 @@ -1,4 +1,4 @@ -# log2.m4 serial 10 +# log2.m4 serial 11 dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_LOG2], dnl Test whether log2() exists. save_LIBS="$LIBS" LIBS="$LIBS $LOG2_LIBM" - AC_CHECK_FUNCS([log2]) + gl_CHECK_FUNCS_ANDROID([log2], [[#include ]]) LIBS="$save_LIBS" if test $ac_cv_func_log2 = yes; then HAVE_LOG2=1 diff --git a/m4/log2f.m4 b/m4/log2f.m4 index f9da22e097..b85993c2c2 100644 --- a/m4/log2f.m4 +++ b/m4/log2f.m4 @@ -1,4 +1,4 @@ -# log2f.m4 serial 10 +# log2f.m4 serial 11 dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_LOG2F], dnl Test whether log2f() exists. save_LIBS="$LIBS" LIBS="$LIBS $LOG2F_LIBM" - AC_CHECK_FUNCS([log2f]) + gl_CHECK_FUNCS_ANDROID([log2f], [[#include ]]) LIBS="$save_LIBS" if test $ac_cv_func_log2f = yes; then HAVE_LOG2F=1 diff --git a/m4/log2l.m4 b/m4/log2l.m4 index f65c00398e..e4810d5a94 100644 --- a/m4/log2l.m4 +++ b/m4/log2l.m4 @@ -1,4 +1,4 @@ -# log2l.m4 serial 3 +# log2l.m4 serial 4 dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_LOG2L], dnl defined in the same library as log2(). save_LIBS="$LIBS" LIBS="$LIBS $LOG2_LIBM" - AC_CHECK_FUNCS([log2l]) + gl_CHECK_FUNCS_ANDROID([log2l], [[#include ]]) LIBS="$save_LIBS" if test $ac_cv_func_log2l = yes; then LOG2L_LIBM="$LOG2_LIBM" -- 2.34.1