Importing inttypes methods from FreeBSD

Corinna Vinschen vinschen@redhat.com
Wed Jul 12 12:07:00 GMT 2017


On Jul 12 15:20, Aditya Upadhyay wrote:
> So, instead of xlocale_private.h, can we use reent.h for thread local
> locale information ?

There already *is* thread-local locale information in struc _reent.
Use it.  Only if something is missing, add it there.

> Previously i had ported the code from mingw-w64,
> and it was working. Can we use that ported code here ?

No.

> > I had  ported these inttypes methods from mingw-w64 libraries
> > previously. it was working well for rtems and Testsuite for these
> > methods, psxinttypes01 was also working.But after suggestion, i have
> > ported these methods from FreeBSD. I have used xlocale_private.h which
> > is differently implemented in newlib already. Corinna suggested me to
> > use reent.h.

reent.h contains the definition of the _reent struct, which is what
constitutes thread-local storage in newlib.  You should make yourself
familiar with this structure and the available methods before adding
stuff.  struct _reent also contains a pointer to thread-local locale
information, the _locale member pointing to struct __locale_t, which is
defined in the usual headers.  Some thread-local locale stuff, especially
the mbstates, are in struct _misc_reent, pointed to by the _misc pointer
for historical reasons.

Please use what's available first, only add stuff if necessary.


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/20170712/70749bd3/attachment.sig>


More information about the Newlib mailing list