[cfe-dev] libc++ MinGW build failure
Howard Hinnant
hhinnant at apple.com
Sun Nov 11 10:28:39 PST 2012
On Nov 11, 2012, at 12:51 PM, Ruben Van Boxem <vanboxem.ruben at gmail.com> wrote:
>> 2012/11/11 Howard Hinnant <hhinnant at apple.com>
>>
>> On Nov 11, 2012, at 12:31 PM, Ruben Van Boxem <vanboxem.ruben at gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I wanted to take another look at libc++ on Windows,
>>
>> Thanks!
>>
>> > but I get a build failure due to (I think) libc++ itself:
>> >
>> > + clang++ -c -g -Os -fPIC -std=c++0x -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -nostdinc++ -I../include ../src/condition_variable.cpp
>> > In file included from ../src/condition_variable.cpp:10:
>> > ../include\condition_variable:158:25: error: constructor for 'std::__1::condition_variable_any' must explicitly initialize the member '__cv_' which does not have a default constructor
>> > condition_variable_any::condition_variable_any()
>> > ^
>>
>> Just looking at this first one: condition_variable is required to have a default constructor. condition_variable (in <__mutex_base>) is currently only implemented on top of pthread_cond_t, and does have a default constructor if pthread_cond_t exists. Does pthread_cond_t exist in your environment?
>>
> Yes, I rely on winpthreads to provide the stuff used by libc++ (I really should take the time to learn all this and write a proper Win32 implementation, but I'm currently too lazy to do so ;-)). pthread_cond_t is defined in pthread.h. I checked the preprocessed source (attached) and it is indeed typedef'ed. This worked last time I updated the test results :/
So can you default construct a condition_variable? I note in your preprocess:
constexpr condition_variable() : __cv_((pthread_cond_t *)((void *) (size_t) -1)) {}
which looks like a valid condition_variable default constructor to me, as long as it compiles...
Howard
More information about the cfe-dev
mailing list