summaryrefslogtreecommitdiff
path: root/modules/strerror_r-posix
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-09-08 19:18:37 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-09-08 19:25:49 -0700
commitd9559536909c5c8f819321cabc05f12652c7f9fd (patch)
treea9c298956c3a81cffcec848657f7f7ab0b74ff32 /modules/strerror_r-posix
parentd99c9622d55cd37084af00843e1feffc0a71fc62 (diff)
downloadgnulib-d9559536909c5c8f819321cabc05f12652c7f9fd.tar.gz
strerror_r-posix: port even better to Android
* 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.
Diffstat (limited to 'modules/strerror_r-posix')
-rw-r--r--modules/strerror_r-posix4
1 files changed, 2 insertions, 2 deletions
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])