Boost logo

Boost Users :

Subject: Re: [Boost-users] VxWorks support in boost 1.41
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-12-19 00:12:55


Geoff Shapiro wrote:
> Having recently upgraded to just released 1.41 version of boost, I noticed the
> new support for the VxWorks platform. I am now in the process of porting over a
> body of code using boost to a VxWorks/PPC platform and obviously want to take
> advantage of the builtin support, but I've run into a problem and would like
> advice on the "boost" way of rectifying the problem.
> I am using VxWorks 6.7 to be running on an MPC8548 PPC. When I try to compile my
> project files in the standard manner for incorporating boost with tr1 support
> (.../boost/boost/tr1/tr1 and .../boost first in the header search paths,
> #include <memory> as first thing in files), I am getting a compile warning. The
> complaint is for already defined preprocessor macros -- in
> boost/config/vxworks.hpp at lines 23 and 24 there are definitions:
> #define _POSIX_TIMERS 1
> #define _POSIX_THREADS 1
> A little further down, this header file includes boilerplate code in
> boost/config/posix_features.hpp and that header file then includes unistd.h, a
> system file. For VxWorks 6.7, unistd.h also has defines for the above
> preprocessor macros, but sets their values to 200112L.
> While the warning may be able to ignored and is probably benign, IF unistd.h is
> always included after vxworks.hpp (I am not sure this will be the case for all
> of our files), I would rather see this fixed. What would be the best way to fix
> this so as to remain conformant with the "boost" philosophy for platform
> independence?

Would something like this work:

#include <unistd.h>

#define _POSIX_TIMERS 1

#define _POSIX_THREADS 1

In Christ,
Steven Watanabe

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at