<div class="gmail_quote">2011/9/26 Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com">hhinnant@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">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>
</div>I believe it does the right thing, presuming you have uselocale that sets the per-thread locale to __l.<br></blockquote><div><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">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>Thanks!<br><br>Ruben<br></div></div>