Boost logo

Boost Users :

Subject: [Boost-users] Boost and Mac OS X SDK 'nil' Conflicts
From: Grant Erickson (gerickson_at_[hidden])
Date: 2009-05-14 17:28:37


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?

Regards,

Grant


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net