On 2016-08-24 12:29, Corinna Vinschen wrote:
On Aug 24 11:30, Brian Inglis wrote:
On 2016-08-24 02:22, Corinna Vinschen wrote:
On Aug 23 23:36, Brian Inglis wrote:
On 2016-08-23 22:15, Brian Inglis wrote:
On 2016-08-23 10:11, Corinna Vinschen wrote:
On Aug 23 07:27, Brian Inglis wrote:
Compared lists of locale_t headers and functions for POSIX, Cygwin,
and glibc, attached below for comparison, and found:
* missed string.h(strerror_l) on my first check;
   not sure if you can implement that easily on Windows?
* GNU also supports wchar.h(wcsftime_l) and time.h(strptime_l);
* GNU also defines string.h(str[n]casecmp_l) functions as an extension,
   as well as in POSIX specified strings.h.
I just applied a couple of patches to add the missing strerror_l,
strptime_l and wcsftime_l.  I also added the missing str[n]casecmp_l
prototypes to strings.h.  I'll create a new test release in a bit.
GNU duplicates the POSIX strings.h(str[n]casecmp_l) in string.h also.
i.e. str[n]casecmp_l should be defined under #if __POSIX_VISIBLE >= 200809
but not defined under #ifdef __GNU_VISIBLE in string*s*.h,
and defined under #ifdef __GNU_VISIBLE but not defined under
#if __POSIX_VISIBLE >= 200809 in *string*.h;
strerror_l should be under #if __POSIX_VISIBLE  >= 200809 in *string*.h,
or its #includes.
They were already declared in string,h.
Sorry for the poor explanation, but what I was failing to say clearly
was that:
* there does not appear to be any strerror_l declaration in string.h
[...]
and that str[n]casecmp_l conditionals __GNU_VISIBLE and __POSIX_VISIBLE >= 
200809
appear to be flipped around between string.h and strings.h declarations in:
[...]
Care to send patches to the newlib list?  Patches (git format-patch)
rule over descriptions alone :}

Knew there were good reasons I avoided git for a decade!
See https://en.wikipedia.org/wiki/Git_(slang)
Developers never heard of KISS, unlike you folks at Cygwin ;^> and the folks at 
hg.

git show attached in case my patch email does not get thru or is scrambled some 
way,
so it does not apply with git am, after my screwing around with git and mailx.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
commit 3be4400034a2bb9c28300b088ecb6271eaa44a2b
Author: Brian Inglis <brian.ing...@systematicsw.ab.ca>
Date:   Wed Aug 24 13:46:25 2016 -0600

    add string.h(strerror_l) as POSIX, change string.h(str[n]casecmp_l) from 
POSIX
    to GNU, change strings.h(str[n]casecmp_l) from GNU to POSIX, use _EXFUN

diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index 8f4fd2e..96703b5 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -48,13 +48,14 @@ char        *_EXFUN(strtok,(char *__restrict, const char 
*__restrict));
 size_t  _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t));
 
 #if __POSIX_VISIBLE >= 200809
-extern int strcasecmp_l (const char *, const char *, locale_t);
-extern int strncasecmp_l (const char *, const char *, size_t, locale_t);
-extern int strcoll_l (const char *, const char *, locale_t);
-extern size_t strxfrm_l (char *__restrict, const char *__restrict, size_t,
-                        locale_t);
+int     _EXFUN(strcoll_l,(const char *, const char *, locale_t);
+char   *_EXFUN(strerror_l,(int, locale_t);
+size_t  _EXFUN(strxfrm_l,(char *__restrict, const char *__restrict, size_t, 
locale_t));
+#endif
+#if __GNU_VISIBLE
+int     _EXFUN(strcasecmp_l,(const char *, const char *, locale_t));
+int     _EXFUN(strncasecmp_l,(const char *, const char *, size_t, locale_t));
 #endif
-
 #if __MISC_VISIBLE || __POSIX_VISIBLE
 char   *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char 
**__restrict));
 #endif
diff --git a/newlib/libc/include/strings.h b/newlib/libc/include/strings.h
index b462d07..60e995b 100644
--- a/newlib/libc/include/strings.h
+++ b/newlib/libc/include/strings.h
@@ -33,10 +33,10 @@ int  _EXFUN(ffs,(int));
 int     _EXFUN(strcasecmp,(const char *, const char *));
 int     _EXFUN(strncasecmp,(const char *, const char *, size_t));
 
-#if __GNU_VISIBLE
-extern int strcasecmp_l (const char *, const char *, locale_t);
-extern int strncasecmp_l (const char *, const char *, size_t, locale_t);
-#endif /* _GNU_VISIBLE */
+#if __POSIX_VISIBLE >= 200809
+int     _EXFUN(strcasecmp_l,(const char *, const char *, locale_t);
+int     _EXFUN(strncasecmp_l,(const char *, const char *, size_t, locale_t);
+#endif /* __POSIX_VISIBLE >= 200809 */
 
 _END_STD_C
 
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to