>From facb752a0f9b4d609d678791a7a9aecb580ff6e2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 12:41:14 +0100 Subject: [PATCH 27/47] Resolve conflicts for functions introduced in Android API level 21. * m4/fts.m4 (gl_FUNC_FTS_CORE): Use rpl_* symbols also when the system will have fts_open in a future version. * m4/iswblank.m4 (gl_FUNC_ISWBLANK): Conditionally set REPLACE_ISWBLANK. * m4/mbtowc.m4 (gl_FUNC_MBTOWC): Conditionally set REPLACE_MBTOWC. * m4/vdprintf.m4 (gl_REPLACE_VDPRINTF): Conditionally set REPLACE_VDPRINTF. * m4/wcsnrtombs.m4 (gl_FUNC_WCSNRTOMBS): Conditionally set REPLACE_WCSNRTOMBS. --- ChangeLog | 9 +++++++++ m4/fts.m4 | 10 +++++++--- m4/iswblank.m4 | 8 ++++++-- m4/mbtowc.m4 | 5 ++++- m4/vdprintf.m4 | 8 ++++++-- m4/wcsnrtombs.m4 | 5 ++++- 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8a57d2d70..c00928615f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,15 @@ Resolve conflicts for functions introduced in Android API level 21. + * m4/fts.m4 (gl_FUNC_FTS_CORE): Use rpl_* symbols also when the system + will have fts_open in a future version. + * m4/iswblank.m4 (gl_FUNC_ISWBLANK): Conditionally set REPLACE_ISWBLANK. + * m4/mbtowc.m4 (gl_FUNC_MBTOWC): Conditionally set REPLACE_MBTOWC. + * m4/vdprintf.m4 (gl_REPLACE_VDPRINTF): Conditionally set + REPLACE_VDPRINTF. + * m4/wcsnrtombs.m4 (gl_FUNC_WCSNRTOMBS): Conditionally set + REPLACE_WCSNRTOMBS. + * m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Conditionally set REPLACE_MBSNRTOWCS. * lib/wchar.in.h (mbsnrtowcs): Disable _GL_CXXALIASWARN invocation on diff --git a/m4/fts.m4 b/m4/fts.m4 index eec034287c..6f521f5141 100644 --- a/m4/fts.m4 +++ b/m4/fts.m4 @@ -1,4 +1,4 @@ -#serial 23 +#serial 24 dnl Copyright (C) 2005-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, @@ -30,8 +30,12 @@ AC_DEFUN([gl_FUNC_FTS_CORE], fi gl_CHECK_FUNCS_ANDROID([fts_open], [[#include ]]) - if test $ac_cv_func_fts_open = yes; then - dnl The system already has the symbols fts_open, etc. + if case "$gl_cv_onwards_func_fts_open" in \ + yes | future*) true ;; \ + *) false ;; \ + esac; then + dnl The system already has the symbols fts_open, etc. or will have them + dnl in a future version. dnl Avoid conflicts between these symbols and ours at the linker level. AC_DEFINE([fts_open], [rpl_fts_open], [Define to the overridden function name]) diff --git a/m4/iswblank.m4 b/m4/iswblank.m4 index f3f96bb784..b1220b1e93 100644 --- a/m4/iswblank.m4 +++ b/m4/iswblank.m4 @@ -1,4 +1,4 @@ -# iswblank.m4 serial 6 +# iswblank.m4 serial 7 dnl Copyright (C) 2011-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,11 @@ AC_DEFUN([gl_FUNC_ISWBLANK], ]]) if test $ac_cv_func_iswblank = no; then HAVE_ISWBLANK=0 - if test $ac_cv_have_decl_iswblank = yes; then + if test $ac_cv_have_decl_iswblank = yes \ + || case "$gl_cv_onwards_func_iswblank" in \ + future*) true ;; \ + *) false ;; \ + esac; then REPLACE_ISWBLANK=1 fi fi diff --git a/m4/mbtowc.m4 b/m4/mbtowc.m4 index 88eb39a6de..02ed6ebb33 100644 --- a/m4/mbtowc.m4 +++ b/m4/mbtowc.m4 @@ -1,4 +1,4 @@ -# mbtowc.m4 serial 4 +# mbtowc.m4 serial 5 dnl Copyright (C) 2011-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, @@ -11,6 +11,9 @@ AC_DEFUN([gl_FUNC_MBTOWC], gl_CHECK_FUNCS_ANDROID([mbtowc], [[#include ]]) if test $ac_cv_func_mbtowc = no; then HAVE_MBTOWC=0 + case "$gl_cv_onwards_func_mbtowc" in + future*) REPLACE_MBTOWC=1 ;; + esac else if false; then REPLACE_MBTOWC=1 diff --git a/m4/vdprintf.m4 b/m4/vdprintf.m4 index 1420efdb51..1df2bc1505 100644 --- a/m4/vdprintf.m4 +++ b/m4/vdprintf.m4 @@ -1,4 +1,4 @@ -# vdprintf.m4 serial 2 +# vdprintf.m4 serial 3 dnl Copyright (C) 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, @@ -18,7 +18,11 @@ AC_DEFUN([gl_REPLACE_VDPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_LIBOBJ([vdprintf]) - if test $ac_cv_func_vdprintf = yes; then + if test $ac_cv_func_vdprintf = yes \ + || case "$gl_cv_onwards_func_vdprintf" in \ + future*) true ;; \ + *) false ;; \ + esac; then REPLACE_VDPRINTF=1 fi gl_PREREQ_VDPRINTF diff --git a/m4/wcsnrtombs.m4 b/m4/wcsnrtombs.m4 index af6d26c78d..ab22f6cd63 100644 --- a/m4/wcsnrtombs.m4 +++ b/m4/wcsnrtombs.m4 @@ -1,4 +1,4 @@ -# wcsnrtombs.m4 serial 8 +# wcsnrtombs.m4 serial 9 dnl Copyright (C) 2008-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, @@ -14,6 +14,9 @@ AC_DEFUN([gl_FUNC_WCSNRTOMBS], gl_CHECK_FUNCS_ANDROID([wcsnrtombs], [[#include ]]) if test $ac_cv_func_wcsnrtombs = no; then HAVE_WCSNRTOMBS=0 + case "$gl_cv_onwards_func_wcsnrtombs" in + future*) REPLACE_WCSNRTOMBS=1 ;; + esac else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCSNRTOMBS=1 -- 2.34.1