]> Savannah Git Hosting - gnulib.git/commitdiff
strerror_r-posix: port better to Android
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 8 Sep 2021 16:45:46 +0000 (09:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 8 Sep 2021 16:46:43 +0000 (09:46 -0700)
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of
gl_USE_SYSTEM_EXTENSIONS from here ...
(gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that
actually needs it.  This avoids a bug where 'configure' tests
whether strerror_r has the POSIX API before enabling GNU
extensions.  On Android, enabling GNU extensions switches from the
POSIX to the GNU API.  Problem reported by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html

ChangeLog
m4/strerror_r.m4

index d2dd671c5bc69831b4479647af76f9953525546e..1db7e333bc7ecd39c62599516b5caf01da77ed29 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2021-09-08  Paul Eggert  <eggert@cs.ucla.edu>
 
+       strerror_r-posix: port better to Android
+       * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of
+       gl_USE_SYSTEM_EXTENSIONS from here ...
+       (gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that
+       actually needs it.  This avoids a bug where 'configure' tests
+       whether strerror_r has the POSIX API before enabling GNU
+       extensions.  On Android, enabling GNU extensions switches from the
+       POSIX to the GNU API.  Problem reported by Lucy Phipps in:
+       https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html
+
        string, wchar: port rpl_free decl to Android
        * lib/string.in.h, lib/wchar.in.h:
        (free): When replacing it, declare the unreplaced version too.
index 0689e46dc6bd633ac9e352533e9f206855c750f8..29b309221fa1210c6d67c912f841304f14a7b5cb 100644 (file)
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 21
+# strerror_r.m4 serial 22
 dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,9 +9,6 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
   AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
 
-  dnl Persuade Solaris <string.h> to declare strerror_r().
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
   dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
   dnl are not defined.
   AC_CHECK_DECLS_ONCE([strerror_r])
@@ -52,6 +49,11 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
 [
   AC_REQUIRE([gl_HEADER_ERRNO_H])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  dnl Persuade Android <string.h> to use the GNU strerror_r API,
+  dnl and Solaris <string.h> to declare strerror_r.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_REQUIRE([gl_FUNC_STRERROR_0])
 
   AC_CHECK_FUNCS_ONCE([strerror_r])