>From dc4c5939bbcf0ba8e86be2246232f7012fcd25dd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 19 Jan 2023 21:55:20 +0100 Subject: [PATCH 05/15] Fix warnings for functions introduced in Android API level 16 or 17. * m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN): Test for posix_memalign using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/alignalloc.m4 (gl_ALIGNALLOC): Likewise. * m4/pagealign_alloc.m4 (gl_PREREQ_PAGEALIGN_ALLOC): Likewise. * modules/aligned-malloc (configure.ac): Likewise. --- ChangeLog | 9 +++++++++ m4/alignalloc.m4 | 3 ++- m4/pagealign_alloc.m4 | 4 ++-- m4/posix_memalign.m4 | 4 ++-- modules/aligned-malloc | 3 ++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d4ab35005..0704164a25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2023-01-19 Bruno Haible + + Fix warnings for functions introduced in Android API level 16 or 17. + * m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN): Test for posix_memalign + using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. + * m4/alignalloc.m4 (gl_ALIGNALLOC): Likewise. + * m4/pagealign_alloc.m4 (gl_PREREQ_PAGEALIGN_ALLOC): Likewise. + * modules/aligned-malloc (configure.ac): Likewise. + 2023-01-19 Bruno Haible Fix warnings for functions introduced in Android API level 16. diff --git a/m4/alignalloc.m4 b/m4/alignalloc.m4 index fa8fb7cd2b..ec199ed01c 100644 --- a/m4/alignalloc.m4 +++ b/m4/alignalloc.m4 @@ -1,3 +1,4 @@ +# alignalloc.m4 serial 1 dnl Copyright 2022-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, @@ -6,5 +7,5 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ALIGNALLOC], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([posix_memalign]) + gl_CHECK_FUNCS_ANDROID([posix_memalign], [[#include ]]) ]) diff --git a/m4/pagealign_alloc.m4 b/m4/pagealign_alloc.m4 index cdf2e182b4..1cfb3beca8 100644 --- a/m4/pagealign_alloc.m4 +++ b/m4/pagealign_alloc.m4 @@ -1,4 +1,4 @@ -#serial 6 +#serial 7 dnl Copyright (C) 2005-2007, 2009-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, @@ -16,6 +16,6 @@ AC_DEFUN([gl_PAGEALIGN_ALLOC], AC_DEFUN([gl_PREREQ_PAGEALIGN_ALLOC], [ AC_REQUIRE([gl_FUNC_MMAP_ANON]) - AC_CHECK_FUNCS_ONCE([posix_memalign]) + gl_CHECK_FUNCS_ANDROID([posix_memalign], [[#include ]]) AC_CHECK_HEADERS_ONCE([unistd.h]) ]) diff --git a/m4/posix_memalign.m4 b/m4/posix_memalign.m4 index b29f573adf..36d88e0323 100644 --- a/m4/posix_memalign.m4 +++ b/m4/posix_memalign.m4 @@ -1,4 +1,4 @@ -# posix_memalign.m4 serial 1 +# posix_memalign.m4 serial 2 dnl Copyright (C) 2020-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, @@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_POSIX_MEMALIGN], dnl Persuade glibc to declare posix_memalign(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([posix_memalign]) + gl_CHECK_FUNCS_ANDROID([posix_memalign], [[#include ]]) if test $ac_cv_func_posix_memalign = yes; then dnl On OpenBSD 6.1, posix_memalign (&p, 32, 2406) returns a pointer dnl that is not a multiple of 32. diff --git a/modules/aligned-malloc b/modules/aligned-malloc index 1ef05d1b76..ce22972436 100644 --- a/modules/aligned-malloc +++ b/modules/aligned-malloc @@ -14,8 +14,9 @@ memalign configure.ac: gl_MALLOC_ALIGNMENT AC_REQUIRE([AC_C_INLINE]) -AC_CHECK_FUNCS_ONCE([posix_memalign memalign]) +AC_CHECK_FUNCS_ONCE([memalign]) gl_CHECK_FUNCS_ANDROID([aligned_alloc], [[#include ]]) +gl_CHECK_FUNCS_ANDROID([posix_memalign], [[#include ]]) Makefile.am: -- 2.34.1