+2016-10-16 Bruno Haible <bruno@clisp.org>
+
+ Fix conflict between strerror_r-posix module and AC_FUNC_STRERROR_R.
+ * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Override the values set by the
+ AC_FUNC_STRERROR_R macro. Define HAVE_DECL_STRERROR_R_ORIG.
+ * lib/strerror_r.c: Use HAVE_DECL_STRERROR_R_ORIG instead of
+ HAVE_DECL_STRERROR_R.
+
2016-10-16 Bruno Haible <bruno@clisp.org>
Make the 'argp' module work without the 'error' module.
#endif
int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
-#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+#elif HAVE_DECL_STRERROR_R_ORIG && !(__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 15
+# strerror_r.m4 serial 16
dnl Copyright (C) 2002, 2007-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_have_decl_strerror_r = no; then
HAVE_DECL_STRERROR_R=0
fi
+ 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.])
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])
+ AC_DEFINE([HAVE_DECL_STRERROR_R], [1])
+ AC_DEFINE([STRERROR_R_CHAR_P], [0])
])
# Prerequisites of lib/strerror_r.c.