libc++ compilation fails due to _STD expanding to "::std:: "

Hi,

I traced the problem to _STD not getting replaced correctly, in some
places, like line 153 of __locale, where _STD gets expanded to
"::std:: ". I have attached preprocessed output of the CMake command:

g++.exe -E -Dcxx_EXPORTS -DNDEBUG -IM:\Development\Source\libc++\include -nostdinc++ -std=c++0x -fPIC -o algorithm.preprocessed -c M:\Development\Source\libc++\src\algorithm.cpp

you can see the error at line 28459 of the preprocessor output. In
other places where the _LIBCPP_NAMESPACE macro is used, it expands
correctly to "__1" (just search the preprocessed output.

To work around the issue, I can define _STD as "::std::__1" on line
147 of __locale, but that does not fix the problem. I'm using GCC
4.6.1 on Windows x64 building with CMake.

Thanks for any help!

algorithm_preprocessed.zip (155 KB)

Small correction with a bit more consequences: the _STD macro is used
in Windows headers (both mingw-w64 and MSVC 10.0) making it very hard
to keep using it for libc++.

Would adding another underscore be acceptable, or getting rid of it
completely be an option?

Thanks!

Hello,

Small correction with a bit more consequences: the _STD macro is used
in Windows headers (both mingw-w64 and MSVC 10.0) making it very hard
to keep using it for libc++.

Would adding another underscore be acceptable, or getting rid of it
completely be an option?

Why not use _LIBCPP_STD, that should be unique? Or would that be too long?

Jonathan