[Config] A proposal to Boost.Config.

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@flast.jp others: flast@ac-room.org s0911476@coins.tsukuba.ac.jp

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 )
I don't see how that could ever be portable - there's no guarantee that every platform has such a header? BTW we normally only add Boost.Config macros for Boost's internal use, is this such a case? If so some more information on the problem you want to solve might help... Cheers, John.

I don't see how that could ever be portable - there's no guarantee that every platform has such a header?
BTW we normally only add Boost.Config macros for Boost's internal use, is this such a case? If so some more information on the problem you want to solve might help...
Cheers, John. I want such macro when I use Escape Sequence, ioctl, etc... This also applies to Boost, for example Boost.Thread switches header itself.
Boost.Config switches header at each platform, nevertheless does not provide that way. I think that's too bad. However, if it is determined to be unsuitable to provide at Boost.Config, I agree. Thanks. -- TAKAHASHI Kohei College of Information Science, University of Tsukuba private mail: flast@flast.jp others: flast@ac-room.org s0911476@coins.tsukuba.ac.jp
participants (2)
-
John Maddock
-
Kohei Takahashi