Re: [xml] Build failure on darwin

As has already been reported a few times, 2.9.0 won't build on any version of OS X. The problem line is 
always this:

threads.c:918: error: expected expression before '{' token

The line in question is:

once_control = PTHREAD_ONCE_INIT;

This happens to work on linux, but it's not legal. As the name and the manpage example code imply, and the 
POSIX documentation makes clear, PTHREAD_ONCE_INIT can only be used in initializations, not assignments. This 
is because some platforms defined PTHREAD_ONCE_INIT as an aggregate initializer.

Linux is not such a platform, but Darwin is. From the 10.8.1 version of pthread.h:


Also, if I understand what the code is trying to accomplish (to allow the pthread_once to get called again 
after you've done this), it's really sketchy and probably shouldn't work reliably even on platforms where it 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]