|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-11-21 09:27:59
John Maddock's suggested ABI clash prevention wrapper code looks like this
for the prefix:
#include <boost/config.hpp>
// this must occur after all of the includes and before any code
appears:
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
and for the suffix:
// the suffix header occurs after all of our code:
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
That approach avoids including the BOOST_ABI_PREFIX/BOOST_ABI_SUFFIX
headers if they would be empty anyhow (because the compiler has no ABI
pragmas).
It does, however, clutter up the source code.
It would be possible avoid some of that clutter by supplying two additional
headers, say <boost/abi_prefix.hpp> and <boost/abi_suffix.hpp>. The
contents would essentially be the two respective code snippets about.
Usage would simply be:
#include <boost/abi_prefix.hpp> // after all other includes
...
#include <boost/abi_suffix.hpp> // after all code
Note that these additional headers don't have to be used. A Boost developer
would still be free choose the lengthier form above if that suited her
preferences. The two forms are functionally equivalent.
Comments?
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk