[cfe-dev] [PATCH] Libc++ Windows fixes (Attention all libc++ ports!!!)

Howard Hinnant hhinnant at apple.com
Mon Sep 26 07:02:22 PDT 2011


On Sep 26, 2011, at 4:38 AM, Ruben Van Boxem wrote:

> 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.
> 
> In that block of code, there is also a construct 
> __locale_raii __current(uselocale(__l), uselocale);
>   int __res = sprintf(__s, __format, __args...);
> 
> 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.

I believe it does the right thing, presuming you have uselocale that sets the per-thread locale to __l.

Howard




More information about the cfe-dev mailing list