Build fails with an error in setlocale.h
Corinna Vinschen
vinschen@redhat.com
Tue Aug 16 10:58:00 GMT 2016
On Aug 16 12:48, Corinna Vinschen wrote:
> On Aug 16 11:37, Matthew Wahab wrote:
> > The error points to the declaration
> >
> > diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h
> > +extern size_t _wcsnrtombs_l (struct _reent *, char *, const wchar_t **,
> > + size_t, size_t, mbstate_t *, locale_t);
> > +
> > [...]
> > Looking at the surrounding code in that file, I think that locale_t should
> > have been __locale_t.
>
> Almost. It should have been `struct __locale_t *':
>
> diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h
> [...]
Actually, make that:
diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h
index de2bd67..03b1dd7 100644
--- a/newlib/libc/locale/setlocale.h
+++ b/newlib/libc/locale/setlocale.h
@@ -203,7 +203,7 @@ extern const char *__get_locale_env(struct _reent *, int);
extern struct lconv *__localeconv_l (struct __locale_t *locale);
extern size_t _wcsnrtombs_l (struct _reent *, char *, const wchar_t **,
- size_t, size_t, mbstate_t *, locale_t);
+ size_t, size_t, mbstate_t *, struct __locale_t *);
/* In POSIX terms the global locale is the process-wide locale. Use this
function to always refer to the global locale. */
diff --git a/newlib/libc/stdlib/wcsnrtombs.c b/newlib/libc/stdlib/wcsnrtombs.c
index 8ad8bcd..8e5c387 100644
--- a/newlib/libc/stdlib/wcsnrtombs.c
+++ b/newlib/libc/stdlib/wcsnrtombs.c
@@ -107,7 +107,7 @@ PORTABILITY
size_t
_wcsnrtombs_l (struct _reent *r, char *dst, const wchar_t **src, size_t nwc,
- size_t len, mbstate_t *ps, locale_t loc)
+ size_t len, mbstate_t *ps, struct __locale_t *loc)
{
char *ptr = dst;
char buff[10];
> > Let me know if there's anything else I should check,
>
> Can you test that the above patch works for you? I'll check it in then.
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/20160816/55c92c6d/attachment.sig>
More information about the Newlib
mailing list