+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
#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. */
-# 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,
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
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.
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);