Boost logo

Boost :

Subject: [boost] [config][predef] Is it OK for boost.config to depend on boost.predef?
From: Beman Dawes (bdawes_at_[hidden])
Date: 2014-05-28 09:50:54


There is a config pull request outstanding that includes <boost/predef.h>.

If it was almost any library other than config, I'd apply this without a
second thought. But Boost config is special in that if it breaks, virtually
the whole of boost breaks. So it makes sense to be cautious about
dependencies. Has there been any discussion about the relationship between
Boost.config and Boost.predef?

Even if we accept the patch, is <boost/predef.h> the right header? It just
forwards:

#include <boost/predef/language.h>
#include <boost/predef/architecture.h>
#include <boost/predef/compiler.h>
#include <boost/predef/library.h>
#include <boost/predef/os.h>
#include <boost/predef/other.h>
#include <boost/predef/platform.h>

The rationale for the pull request is a need in other Boost libraries to
detect Windows platform variants like BOOST_PLAT_WINDOWS_DESKTOP
andBOOST_PLAT_WINDOWS_RUNTIME. Boost.Predef does a nice job of that.
But the
only header strictly needed is <boost/predef/platform.h>.

So the desired effect can be achieved several ways:

1) #include <boost/predef.h> in the include/boost/config/platform/ headers.
2) #include <boost/predef/platform.h> in the include/boost/config/platform/
headers.
3) #include <boost/predef.h> in the files that actually use the desired
macros.
4) #include <boost/predef/platform.h> in the files that actually use the
desired macros.

If I had been writing the code myself, I probably would have selected
option (4). What do others think?

--Beman


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