From d9559536909c5c8f819321cabc05f12652c7f9fd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 8 Sep 2021 19:18:37 -0700 Subject: strerror_r-posix: port even better to Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/strerror_r.c: Use STRERROR_R_CHAR_P to decide whether the system strerror_r returns char *, and HAVE_DECL_STRERROR_R to decide whether it either does that or returns an integer. In the former case, use the system strerror_r even on platforms like Android API level 23 that don’t have __xpg_strerror_r; also check for strerror_r failure just in case. * m4/error.m4 (gl_PREREQ_ERROR): * m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Use system extensions on Android, to avoid mishandling strerror_r on API level 23 and later. * modules/error, modules/strerror_r-posix (configure.ac): Surround gl_PREREQ_ERROR with AS_IF instead of plain if, so that AC_REQUIREs are propagated out. --- modules/strerror_r-posix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/strerror_r-posix') diff --git a/modules/strerror_r-posix b/modules/strerror_r-posix index f91bc0e7cc..25f049365a 100644 --- a/modules/strerror_r-posix +++ b/modules/strerror_r-posix @@ -14,10 +14,10 @@ strerror-override [test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = configure.ac: gl_FUNC_STRERROR_R -if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then +AS_IF([test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1], [ AC_LIBOBJ([strerror_r]) gl_PREREQ_STRERROR_R -fi +]) gl_STRING_MODULE_INDICATOR([strerror_r]) dnl For the modules argp, error. gl_MODULE_INDICATOR([strerror_r-posix]) -- cgit v1.2.1