|
Boost : |
Subject: [boost] [Config] A proposal to Boost.Config.
From: Kohei Takahashi (flast_at_[hidden])
Date: 2011-04-26 02:39:37
Hi,
Boost.Config provides BOOST_PLATFORM macro (it will expand to strings).
However, it cannot use to switch including header like followings.
#include <boost/config.hpp>
#include "somedir/" BOOST_PLATFORM "/someheader.hpp"
So, I propose a new macro BOOST_PLATFORM_LABEL (change to more suitable
name).
That provide not stringized platform name like this.
#define BOOST_PLATFORM_LABEL linux
By using such macro, will be able to switch including header.
#include <boost/config.hpp>
#include <boost/preprocessor/stringize.hpp>
#include
BOOST_PP_STRINGIZE( somedir/BOOST_PLATFORM_LABEL/someheader.hpp )
However, such macro has a problem.
For example, it fail including when *linux* (or another label) defined
to other symbol.
#include <boost/config.hpp>
#include <boost/preprocessor/stringize.hpp>
#define linux others
#include
BOOST_PP_STRINGIZE( somedir/BOOST_PLATFORM_LABEL/someheader.hpp ) //
Oops! Expand to somedir/others/someheader.hpp in linux.
How do you feel this macro?
Thanks.
-- TAKAHASHI Kohei College of Information Science, University of Tsukuba private mail: flast_at_[hidden] others: flast_at_[hidden] s0911476_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk