changeset 14764:2b72df632b91

strerror_r: Fix test failure on mingw. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define EXTEND_STRERROR_R. * lib/strerror_r.c (strerror_r): Test the various GNULIB_defined_* macros from errno.in.h instead.
author Bruno Haible <bruno@clisp.org>
date Thu, 19 May 2011 20:45:59 +0200
parents 19cd3c889b58
children 8e23facf1d9e
files ChangeLog lib/strerror_r.c m4/strerror_r.m4
diffstat 3 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-19  Bruno Haible  <bruno@clisp.org>
+
+	strerror_r: Fix test failure on mingw.
+	* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define
+	EXTEND_STRERROR_R.
+	* lib/strerror_r.c (strerror_r): Test the various GNULIB_defined_*
+	macros from errno.in.h instead.
+
 2011-05-19  Eric Blake  <eblake@redhat.com>
 
 	strerror: relax test for Solaris
--- a/lib/strerror_r.c
+++ b/lib/strerror_r.c
@@ -64,7 +64,19 @@
 strerror_r (int errnum, char *buf, size_t buflen)
 #undef strerror_r
 {
-#if EXTEND_STRERROR_R
+#if GNULIB_defined_ETXTBSY \
+    || GNULIB_defined_ESOCK \
+    || GNULIB_defined_ENOMSG \
+    || GNULIB_defined_EIDRM \
+    || GNULIB_defined_ENOLINK \
+    || GNULIB_defined_EPROTO \
+    || GNULIB_defined_EMULTIHOP \
+    || GNULIB_defined_EBADMSG \
+    || GNULIB_defined_EOVERFLOW \
+    || GNULIB_defined_ENOTSUP \
+    || GNULIB_defined_ESTALE \
+    || GNULIB_defined_EDQUOT \
+    || GNULIB_defined_ECANCELED
   {
     char const *msg = NULL;
     /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
--- a/m4/strerror_r.m4
+++ b/m4/strerror_r.m4
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 4
+# strerror_r.m4 serial 5
 dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -93,9 +93,6 @@
       dnl The system's strerror_r() cannot know about the new errno values we
       dnl add to <errno.h>. Replace it.
       REPLACE_STRERROR_R=1
-      AC_DEFINE([EXTEND_STRERROR_R], [1],
-        [Define to 1 if strerror_r needs to be extended so that it handles the
-         extra errno values.])
     fi
   fi
   if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then