Boost logo

Boost :

Subject: Re: [boost] [config][predef] Is it OK for boost.config to depend on boost.predef?
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2014-05-28 14:26:48


On Wed, May 28, 2014 at 12:45 PM, Robert Ramey <
robertmacleranramey_at_[hidden]> wrote:

>
> The whole existence of boost predef was a huge surprise to me.
>

It was reviewed and accepted ;-)

> Looking at the dates it seems its been in boost for a while. I perused
> the documentation. I'm still not getting how this doesn't overlap with
> config..hpp. I thought that config.hpp was designed to address the issue
> of portability between platforms.
>

Boost Config is indeed designed to address portability between platforms.
As a requirement of that design it also has to deal with detecting the
different platforms it's trying to define feature/defect macros for.
Detecting the platform is not a requirement for Config to work. And you can
run the Config configure program to generate a set of portability
feature/defect definitions without knowing about the platform.

> So I would expect that a facility such as
>
> #include <boost/predef/platform/windows_desktop.h>
> #include <boost/predef/platform/windows_runtime.h>
>
> would depend upon config.hpp rather than the other way around.
>
> And since config.hpp is designed to determine the platform automatically,
> I'm very surpassed to see predef at all.
>

"config.hpp" has to partially determine the "platform" by need not by
design.

> Any additional information you want to submit would be interesting to see.
>

Predef's design is to *not* detect or define feature/defect macros. All it
does is the detection of the platform (compiler, libraries, etc). With
enough fine grained platform information one can use it to define know
feature/defect macros. Predef defines a much larger superset of the Config
platform defs <http://tinyurl.com/o68ovjz> in a consistent (and consistent
to check) manner.

Or more succinctly:

* Predef detects the environment you are compiling in.

* Config defines what is or isn't broken with that environment relative to
the ideal/standard -conforming environment.

HTH

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

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