<div class="gmail_quote">2011/9/28 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><div></div><div class="h5">On Sep 28, 2011, at 4:17 PM, Ruben Van Boxem wrote:<br>
<br>
> Hi,<br>
><br>
> I have removed Windows' dependency on the ugly <locale> part that is going to be refactored by mirrorring Mac and FreeBSD through implementing all the necessary *_l functions and dependents.<br>
><br>
> Other notable changes:<br>
>  - support/win32/locale.h: fixed uselocale to enable per-thread locale, because the POSIX definition of this function requires that it only set the current thread's locale. Consequence is that after a call to this function, per-thread locale will remain enabled. This is intended behavior as far as I can see. As a result, I'm fairly confident the __locale_raii trick works as it should even in multithreaded contexts.<br>

>  - include/locale: I still included the variadic template alternatives to the vararg functions. As these wrappers are going to be removed, You could leave this out, but libc++ won't compile for GCC without them.<br>

>  - include/cwchar: I included the support header in order to get the functions required by the standard. this solves the cwchar test issue, but the <wchar.h> test will need to do this manually for _WIN32.<br>
><br>
> Please comment or apply, thanks.<br>
><br>
> Ruben<br>
><br>
><br>
</div></div>> <windows.patch><br>
<br>
Thanks Ruben,<br>
<br>
Some minor comments:<br>
<br>
---<br>
<br>
In buildit it looks like a line escaped outside of mingw:<br>
<br>
ar rcs libc++.a *.o<br></blockquote><div><br>Yeah, that's a static library step I missed to remove. Feel free to delete it.<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>
---<br>
<br>
In <locale> it looks like you're making some changes under:<br>
<br>
#ifndef _LIBCPP_STABLE_APPLE_ABI<br>
<br>
which is contrary to your first sentence above.  Did you send the wrong patch?<br></blockquote><div><br>I see, see below. I removed the now unnecessary workarounds.<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>
---<br>
<br>
In <__config> don't you want to:<br>
<br>
#if __APPLE__ || _WIN32<br>
#define _LIBCPP_STABLE_APPLE_ABI<br>
#endif<br>
<br>
instead of:<br>
<br>
#if __APPLE__ || __FreeBSD__ || _WIN32<br>
#define _LIBCPP_LOCALE__L_EXTENSIONS 1<br>
#endif<br>
<br>
?<br></blockquote><div><br>I guess you're right. I defined both in the new patch. libc++ compiles, but I'm kind of baffled by this because there are locale.cpp parts using _DefaultRuneLocale if _LIBCPP_STABLE_APPLE_ABI is defined. I didn't touch these at all :s so I'm kind of confused why this works at all for me... I'm not seeing what the compiler is seeing :(<br>
<br>These parts of locale.cpp are standard C locale things, so I guess the alternative I need to write is these bits using a hidden (static) C locale object I can always access for the values needed (this would involve modifying __cloc to not create a locale every time it is called, but I was waiting for the <locale> refactoring...). Why does FreeBSD not define _LLIBCPP_STABLE_APPLE_ABI?<br>
<br>I'm officially confumbled,<br><br>Ruben<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>
---<br>
<font color="#888888"><br>
Howard<br>
<br>
</font></blockquote></div><br>