Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost and Mac OS X SDK 'nil' Conflicts
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-05-14 18:09:45


Grant Erickson wrote:
> There doesn't appear to be an issue for this in Trac or any semblance of a
> discussion thread; however, the Mac OS SDK definition of 'nil' seems to
> cause Boost 1_39_0 (perhaps other versions) to emit a copious number of
> warning and error messages when included AFTER any OS X SDK header such as:
> #include <CoreFoundation/CoreFoundation.h>
> #include <IOKit/IOKitLib.h>
> #include <boost/accumulators/accumulators.hpp>
> #include <boost/accumulators/statistics/stats.hpp>
> #include <boost/accumulators/statistics/rolling_mean.hpp>
> using namespace boost;
> using namespace accumulators;
> As near as I can tell CoreServices/MacTypes.h is the source of the
> definition:
> #define nil NULL
> Fortunately, this can be resolved by reordering the include directives to
> include OS X headers AFTER Boost; however, it seems like these headers
> should play nicely together.
> Has Boost reserved 'nil' for some time or might something like 'nil_t' be
> used alternatively?

Boost is only using nil inside its own namespace, so the
problem is really that nil should not be defined as a macro.

In Christ,
Steven Watanabe

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