On Mon, Oct 21, 2013 at 02:14:32PM +0200, Martin Pelikan wrote: > > Applications don't care where a symbol comes from. > > Build scripts and Makefiles might expect them to be in libc and > > would need to link an additional library, but that's trivial to do. > > For all such ports? Ok then :-)
How many ports do you expect will require xlocale? > > I would suggest to implement a small and non-OS-specific stub for > > libcxx that they can use on any OS lacking xlocale support. > > Replace/enhance the existing shim for Solaris as part of this effort. > > Work with the libcxx team to integrate your changes there. > > > > If they tell you that they won't run on a non-xlocale OS that isn't > > Solaris, implement the shim anyway and add it to our ports tree. > > > > The shim is going to be a lot less work, and doesn't preclude an > > implentation inside libc at a later stage. > > Thanks for showing the right direction. I'll look into it as soon as > I have more time; at least I know what is needed and how big is it. If xlocale is needed beyond libcxx, take a look at the misc/libutf8 port in the CVS Attic. Perhaps a port like that could serve as an API shim for xlocale until libc support for xlocale arrives. If you'd still rather do this in libc itself, e.g. because a simple shim won't provide enough functionality to make libcxx work, or because you really need it coupled up with libc locale internals, don't just copy files over from FreeBSD and make us review it all. Figure out what the steps are to get us from here to there and let us review each step. I think starting with just the locale_t data type and related functions (duplocale() etc.) on this page would be a good first step: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html This interface extension is small enough to be added in one diff, I think. I don't care if you base the implementation on FreeBSD or write your own, as long as the diff is concise and adds nicely on top what we've already got. All the clutter from new *_l() convenience functions can come later. This page provides a high-level overview of xlocale interfaces, BTW: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/xlocale.3.html That's quite a lot. I wouldn't want to add all that in one chunk.