Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-10-06 03:02:21


Jonathan Wakely wrote:

> On Tue, Oct 05, 2004 at 06:23:46PM +0200, Markus Schöpflin wrote:
>>
>> The native compiler (toolset tru64cxx65) doesn't define _REENTRANT and
>> things seem to work out correctly.
>
> If you use the tru64cxx65 equivalent of -pthread then I bet it _does_
> define _REENTRANT. The problem is that GCC was changed so that
> _REENTRANT is defined whether or not -pthread is used.

Yep, you're right. -pthread toggles the definition of _REENTRANT on cxx.
Interestingly it does this also with gcc when you look at the output of the
predefined macros of the compiler.

>> GCC's include files OTOH unconditionally define _REENTRANT before
>> including "pthread.h" which forces boost to also include "pthread.h",
>> if I understand things correctly.
>
> Near enough, yeah.
>
>> But reentrant is not defined at the point where "pthread.h" is
>> included which leads to the problem described.
>
> Why not though, that's the question.
>
> Since <boost/config.h> is included first by shared_ptr.hpp, that should
> include <string> (or any other libstdc++ header) which should define
> _REENTRANT and therefore it should be set when we come to pthread.h
>
> If you want to, run the test with the GCC flag -save-temps and send me
> the preprocessed .ii file, and I'll get medieval on it.

Will do in private mail. Thanks in advance.

Markus


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk