[cfe-dev] [PATCH] Libc++ Windows fixes

Howard Hinnant hhinnant at apple.com
Wed Sep 28 13:43:41 PDT 2011


On Sep 28, 2011, at 4:17 PM, Ruben Van Boxem wrote:

> Hi,
> 
> 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.
> 
> Other notable changes:
>  - 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.
>  - 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.
>  - 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.
> 
> Please comment or apply, thanks.
> 
> Ruben
> 
> 
> <windows.patch>

Thanks Ruben,

Some minor comments:

---

In buildit it looks like a line escaped outside of mingw:

ar rcs libc++.a *.o 

---

In <locale> it looks like you're making some changes under:

#ifndef _LIBCPP_STABLE_APPLE_ABI

which is contrary to your first sentence above.  Did you send the wrong patch?

---

In <__config> don't you want to:

#if __APPLE__ || _WIN32
#define _LIBCPP_STABLE_APPLE_ABI
#endif

instead of:

#if __APPLE__ || __FreeBSD__ || _WIN32
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif

?

---

Howard




More information about the cfe-dev mailing list