[PATCH] 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
Corinna Vinschen
vinschen@redhat.com
Thu Aug 25 07:50:00 GMT 2016
On Aug 24 14:36, Brian Inglis wrote:
> 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
Applied with changes. The usage of _EXFUN for new declarations has been
deprecated, and strings.h was missing the include to get the definition
of locale_t.
I also fixed the log message a bit. The subject line was a teeny little
bit long :)
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160825/c3df20e1/attachment.sig>
More information about the Newlib
mailing list