Boost logo

Boost :

From: Gary_Gale_at_[hidden]
Date: 2002-12-19 10:05:21


> I don't think that we can work around this by defining
> _XOPEN_SOURCE in the
> boost headers: it would imply that the boost headers would have to be
> included before any other header, or nasty things will happen :-(
>
> I guess we could check for the _XOPEN_SOURCE value in
> posix_features.hpp as
> well as for _XOPEN_VERSION, maybe this is the right thing to
> do for all
> Unixes, I don't know, anyone any ideas?
>
> John Maddock
> http://ourworld.compuserve.com/homepages/john_maddock/index.htm

Thanks for the feedback John,

I agree that posix_features.h is the logical place to put this, although it
would still have to be conditionalised for linux and for gcc < version 3.

Providing it can be ensured that boost/config.hpp is included before
pthread.h then something along the lines of

#if defined(__linux) || defined(__linux__) || defined(linux)
#if defined(__GNUC__) && (__GNUC__ < 3)
#define _XOPEN_SOURCE 500
#define __USE_UNIX98 1
#define __USE_XOPEN_EXTENDED 1
#endif

should do the trick, as it's basically duplicating what's already in
features.h if _XOPEN_SOURCE is defined; although it's a rather unlovely way
of getting around this.

Seeing as this needs to be constrained to linux and to a specific version of
gcc we shouldn't have any issues with other flavours of *nix being affected
although views from users of other Linux distros, such as Mandrake, SUSE and
Debian to name but a few, would be welcome at this point.

Gary


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