>From 307c5c697b42f3e60b6a672d31223585121a464d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 02:25:19 +0100 Subject: [PATCH 13/47] Resolve conflicts for functions introduced in Android API level 18. * m4/log2.m4 (gl_FUNC_LOG2): Conditionally set REPLACE_LOG2. * m4/log2f.m4 (gl_FUNC_LOG2F): Conditionally set REPLACE_LOG2F. * m4/log2l.m4 (gl_FUNC_LOG2L): Conditionally set REPLACE_LOG2L. * lib/math.in.h (log2f): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 6 ++++++ lib/math.in.h | 2 ++ m4/log2.m4 | 5 ++++- m4/log2f.m4 | 5 ++++- m4/log2l.m4 | 5 ++++- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39c23bce80..acd6ddfe0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ Resolve conflicts for functions introduced in Android API level 18. + * m4/log2.m4 (gl_FUNC_LOG2): Conditionally set REPLACE_LOG2. + * m4/log2f.m4 (gl_FUNC_LOG2F): Conditionally set REPLACE_LOG2F. + * m4/log2l.m4 (gl_FUNC_LOG2L): Conditionally set REPLACE_LOG2L. + * lib/math.in.h (log2f): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * m4/getdelim.m4 (gl_FUNC_GETDELIM): Conditionally set REPLACE_GETDELIM. * m4/getline.m4 (gl_FUNC_GETLINE): Conditionally set REPLACE_GETLINE. * lib/stdio.in.h (getdelim, getline): Disable _GL_CXXALIASWARN diff --git a/lib/math.in.h b/lib/math.in.h index a1cb22936b..70b75e2399 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -1696,7 +1696,9 @@ _GL_FUNCDECL_SYS (log2f, float, (float x)); # endif _GL_CXXALIAS_SYS (log2f, float, (float x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (log2f); +# endif #elif defined GNULIB_POSIXCHECK # undef log2f # if HAVE_RAW_DECL_LOG2F diff --git a/m4/log2.m4 b/m4/log2.m4 index 4e08f48fe8..809853ed3b 100644 --- a/m4/log2.m4 +++ b/m4/log2.m4 @@ -1,4 +1,4 @@ -# log2.m4 serial 11 +# log2.m4 serial 12 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, @@ -100,6 +100,9 @@ int main (int argc, char *argv[]) else HAVE_LOG2=0 HAVE_DECL_LOG2=0 + case "$gl_cv_onwards_func_log2" in + future*) REPLACE_LOG2=1 ;; + esac fi if test $HAVE_LOG2 = 0 || test $REPLACE_LOG2 = 1; then dnl Find libraries needed to link lib/log2.c. diff --git a/m4/log2f.m4 b/m4/log2f.m4 index b85993c2c2..3c47f1aa87 100644 --- a/m4/log2f.m4 +++ b/m4/log2f.m4 @@ -1,4 +1,4 @@ -# log2f.m4 serial 11 +# log2f.m4 serial 12 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, @@ -101,6 +101,9 @@ int main (int argc, char *argv[]) else HAVE_LOG2F=0 HAVE_DECL_LOG2F=0 + case "$gl_cv_onwards_func_log2f" in + future*) REPLACE_LOG2F=1 ;; + esac fi if test $HAVE_LOG2F = 0 || test $REPLACE_LOG2F = 1; then dnl Find libraries needed to link lib/log2f.c. diff --git a/m4/log2l.m4 b/m4/log2l.m4 index e4810d5a94..57639a2af5 100644 --- a/m4/log2l.m4 +++ b/m4/log2l.m4 @@ -1,4 +1,4 @@ -# log2l.m4 serial 4 +# log2l.m4 serial 5 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, @@ -37,6 +37,9 @@ AC_DEFUN([gl_FUNC_LOG2L], else HAVE_LOG2L=0 HAVE_DECL_LOG2L=0 + case "$gl_cv_onwards_func_log2l" in + future*) REPLACE_LOG2L=1 ;; + esac fi if test $HAVE_LOG2L = 0 || test $REPLACE_LOG2L = 1; then dnl Find libraries needed to link lib/log2l.c. -- 2.34.1