Fix throw_test.cpp to not meddle with BOOST_SYSTEM_SOURCE as it needs to import from Boost.System while exporting throw_test()

This commit is contained in:
Peter Dimov
2018-09-16 04:32:33 +03:00
parent 7a06df877d
commit 41de9d916a
3 changed files with 13 additions and 27 deletions

View File

@@ -13,19 +13,16 @@
//--------------------------------------------------------------------------------------//
// define BOOST_SYSTEM_SOURCE so that <boost/system/config.hpp> knows
// the library is being built (possibly exporting rather than importing code)
#define BOOST_SYSTEM_SOURCE
#include <boost/system/system_error.hpp>
#include <boost/config.hpp>
namespace boost
#if defined(THROW_DYN_LINK)
# define EXPORT BOOST_SYMBOL_EXPORT
#else
# define EXPORT
#endif
EXPORT void throw_test()
{
namespace system
{
BOOST_SYSTEM_DECL void throw_test()
{
throw system_error(9999, system_category(), "boo boo");
}
}
throw boost::system::system_error( 9999, boost::system::system_category(), "boo boo" );
}