strerror_r-posix: Revert commits from 2016-10-16,2016-11-04,2016-11-14.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Apr 2017 16:27:44 +0000 (18:27 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 24 Apr 2017 22:00:02 +0000 (00:00 +0200)
* m4/strerror_r.m4: Revert changes since 2016-10-16.
* lib/strerror_r.c: Likewise.

ChangeLog
lib/strerror_r.c
m4/strerror_r.m4

index 75e7d8abc9b3eaaabddc7d847c2c75cc33e14542..4c91f4dd2e95d514fbc8b35f38a30998706bf3f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-04-23  Bruno Haible  <bruno@clisp.org>
+
+       strerror_r-posix: Revert commits from 2016-10-16,2016-11-04,2016-11-14.
+       * m4/strerror_r.m4: Revert changes since 2016-10-16.
+       * lib/strerror_r.c: Likewise.
+
 2017-04-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        Target a C99 subset, not a C89 subset
index 09ec8d9e15d7d643567e3aa8129a4c52449cd10a..d7b0f778f05dfc79c9eea4ad2f3fe0d5908b3af1 100644 (file)
@@ -40,7 +40,7 @@ extern
 #endif
 int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
 
-#elif HAVE_DECL_STRERROR_R_ORIG && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
 
 /* The system's strerror_r function is OK, except that its third argument
    is 'int', not 'size_t', or its return type is wrong.  */
index 1e3e7a751882491d38b63db4ed17b868318cd1a7..28cd0d42d49e449518dbb27da699af353c64291e 100644 (file)
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 18
+# strerror_r.m4 serial 19
 dnl Copyright (C) 2002, 2007-2017 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,10 +14,10 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
 
   dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
   dnl are not defined.
-  AC_CHECK_DECL([strerror_r],
-    [HAVE_DECL_STRERROR_R=1], [HAVE_DECL_STRERROR_R=0])
-  AC_DEFINE_UNQUOTED([HAVE_DECL_STRERROR_R_ORIG], [$HAVE_DECL_STRERROR_R],
-    [Define to 1 if you have the declaration of 'strerror_r' in the system include files, or to 0 otherwise.])
+  AC_CHECK_DECLS_ONCE([strerror_r])
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
 
   if test $ac_cv_func_strerror_r = yes; then
     if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
@@ -36,20 +36,6 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
       REPLACE_STRERROR_R=1
     fi
   fi
-
-  # Overwrite the findings of AC_FUNC_STRERROR_R (for code that uses that).
-  AC_REQUIRE([AC_FUNC_STRERROR_R])
-])
-
-# If this module is in use, we unconditionally want POSIX semantics; so
-# replace autoconf's macro with a version that does not probe
-AC_DEFUN([AC_FUNC_STRERROR_R], [
-  AC_DEFINE([HAVE_DECL_STRERROR_R], [1],
-    [Define to 1, since you should have the declaration of strerror_r.])
-  AC_DEFINE([HAVE_STRERROR_R], [1],
-    [Define to 1, since you should have the function strerror_r.])
-  AC_DEFINE([STRERROR_R_CHAR_P], [0],
-    [Define to 0, since strerror_r should not return char *.])
 ])
 
 # Prerequisites of lib/strerror_r.c.
@@ -68,7 +54,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_REQUIRE([gl_FUNC_STRERROR_0])
 
-  AC_CHECK_FUNC([strerror_r])
+  AC_CHECK_FUNCS_ONCE([strerror_r])
   if test $ac_cv_func_strerror_r = yes; then
     if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
       dnl The POSIX prototype is:  int strerror_r (int, char *, size_t);