<div class="gmail_quote">2011/9/26 Jean-Daniel Dupas <span dir="ltr"><<a href="mailto:devlists@shadowlab.org">devlists@shadowlab.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Le 26 sept. 2011 à 16:08, Ruben Van Boxem a écrit :<br>
<div><div></div><div class="h5"><br>
> 2011/9/26 Howard Hinnant <<a href="mailto:hhinnant@apple.com">hhinnant@apple.com</a>><br>
> On Sep 26, 2011, at 4:38 AM, Ruben Van Boxem wrote:<br>
><br>
> > If the __foo_l functions are just the wrappers that they seem to be, I can certainly live with removing this layer of indirection and me implementing the missing functions that are now wrongfully bypassed. I think expecting all xlocale functions to be present is fair for future implementations/ports. This would mean some additions to the support/win32/locale.h header only, which would concentrate any real problems there, which is a good thing. All platform-related fixme's and their future fixes (at least the win32 ones) would go in one centralized place, away from the public libc++ headers and core libc++. Other ports can do the same.<br>

> ><br>
> > In that block of code, there is also a construct<br>
> > __locale_raii __current(uselocale(__l), uselocale);<br>
> >   int __res = sprintf(__s, __format, __args...);<br>
> ><br>
> > Does this do the right thing; a very wasteful implementation of the correct behavior, or is this just an attempt to not make things worse. This would be important for me implementing missing *_l functions. If the above worked like I hope it does, that becomes very easy, albeit unperformant.<br>

><br>
> I believe it does the right thing, presuming you have uselocale that sets the per-thread locale to __l.<br>
><br>
> That is great news! For this to function correctly, I need to call "_configthreadlocale"  (<a href="http://msdn.microsoft.com/en-us/library/26c0tb7x%28v=vs.80%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/26c0tb7x%28v=vs.80%29.aspx</a>) somewhere before anything else, only once. Is there an existing static initialization function in libc++ I could add this call to?<br>

><br>
<br>
</div></div>I'm not a Windows expert, but isn't DllMain design for this kind of initialization ?<br>
<br>
It is called once per thread create passing the DLL_THREAD_ATTACH argument.<br></blockquote><div><br>I've though about this, but this would break for static libc++.<br><br>This issue is worse/different than I first thought. The _configthreadlocale function needs to be called per thread, so this is frankly out of libc++'s control and should be left to the user.<br>
<br>Ruben<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
> Thanks!<br>
><br>
> Ruben<br>
<div><div></div><div class="h5">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</div></div><font color="#888888">-- Jean-Daniel<br>
<br>
<br>
<br>
<br>
</font></blockquote></div><br>