[cfe-dev] libc++ on Windows (Rationale)

Howard Hinnant hhinnant at apple.com
Tue Aug 24 07:57:50 PDT 2010


On Aug 24, 2010, at 8:03 AM, Fernando Pelliccioni wrote:

> Hi,
> 
> I am trying to compile LibC++ on WinXP (32) using MinGW (GCC 4.6).
> 
> I've seen some extensions are used, as the "xlocale.h", which makes it difficult to compile in Windows using MinGW. No way to use MSVC.
> 
> I wonder..., What is the goal of the creators of Clang and LibC++ in terms of portability? Is there any reason why Windows should not be supported? Or just a matter of time, is started by the Unix-Like operating systems?
> 
> I would like to contribute to the project, to make Clang and LibC++, in the future, the default compiler C++ for almost any platform.

I can speak for libc++:  libc++ is meant to be a high quality open source C++ standard library.  The initial implementation has been targeted straight at Apple's platforms, with the notion that it should take advantage of the underlying OS when available and where appropriate (e.g. <xlocale.h>).  One of the reasons for open sourcing this code however is so that others are free to port libc++ to other platforms where they can take advantage of other OS's features.

Porting <locale> is going to require significant effort and knowledge of the target OS, unless it is acceptable to the porters to support only a minimum "C" locale.  Such minimal support was not acceptable to me for the Apple platforms.

At no time has it been envisioned that every line of code in libc++ shall be portable.  Instead it is envisioned that libc++ will have to be adapted to different OS's to make the most out of each OS.  The goal of any C++ standard library should be to (when necessary) consist of non-portable code so that its clients don't have to write non-portable code.  Naturally though, libc++ code should not be gratuitously non-portable.

-Howard





More information about the cfe-dev mailing list