+2011-05-19 Eric Blake <eblake@redhat.com>
+
+ strerror_r: fix on newer cygwin
+ * lib/strerror_r.c (rpl_strerror_r): Cygwin now has
+ __xpg_strerror_r, use it.
+
2011-05-19 Bruno Haible <bruno@clisp.org>
strerror_r: Avoid clobbering the strerror buffer when possible.
# endif
-#if HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__)
+#if (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4, cygwin >= 1.7.9 */
+
+# define USE_XPG_STRERROR_R 1
+
+#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__)
/* The system's strerror_r function is OK, except that its third argument
is 'int', not 'size_t', or its return type is wrong. */
# define USE_SYSTEM_STRERROR_R 1
-#elif (__GLIBC__ >= 2 || defined __UCLIBC__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4 */
-
-# define USE_XPG_STRERROR_R 1
-
#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) */
/* Use the system's strerror(). */
ret = strerror_r (errnum, buf, buflen);
}
# elif defined __CYGWIN__
- /* Cygwin only provides the glibc interface, is thread-safe, and
+ /* Cygwin 1.7.8 only provides the glibc interface, is thread-safe, and
always succeeds (although it may truncate). */
strerror_r (errnum, buf, buflen);
ret = 0;