[cfe-dev] libc++ compilation fails due to _STD expanding to "::std:: "

Ruben Van Boxem vanboxem.ruben at gmail.com
Tue Jun 28 07:48:48 PDT 2011


2011/6/28 Ruben Van Boxem <vanboxem.ruben at gmail.com>:
> 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!
>

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!




More information about the cfe-dev mailing list