This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Change strerror_r definition for cygwin
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: newlib at sourceware dot org
- Date: Thu, 25 Aug 2005 19:03:42 -0400
- Subject: [PATCH] Change strerror_r definition for cygwin
It seems like newlib's strerror_r implementation is not compliant with
standards. We need to have strerror_r return an integer for cygwin so
I've made the change below.
OTOH, if this change should be the default, let me know and I'll be
happy to change libc/string/strerror_r.c .
cgf
2005-08-25 Christopher Faylor <cgf@timesys.com>
* libc/include/string.h: For Cygwin, Define strerror_r as per ISO C.
Index: libc/include/string.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/string.h,v
retrieving revision 1.15
diff -u -p -r1.15 string.h
--- libc/include/string.h 24 Jan 2005 18:46:08 -0000 1.15
+++ libc/include/string.h 25 Aug 2005 23:00:18 -0000
@@ -62,7 +62,11 @@ char *_EXFUN(strdup,(const char *));
char *_EXFUN(_strdup_r,(struct _reent *, const char *));
char *_EXFUN(strndup,(const char *, size_t));
char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
+#ifdef __CYGWIN__
+int _EXFUN(strerror_r,(int, char *, size_t));
+#else
char *_EXFUN(strerror_r,(int, char *, size_t));
+#endif
size_t _EXFUN(strlcat,(char *, const char *, size_t));
size_t _EXFUN(strlcpy,(char *, const char *, size_t));
int _EXFUN(strncasecmp,(const char *, const char *, size_t));