1 // Copyright 2022 Peter Dimov
2 // Distributed under the Boost Software License, Version 1.0.
3 // https://www.boost.org/LICENSE_1_0.txt
6 # pragma warning(disable: 4702) // unreachable code
7 # pragma warning(disable: 4530) // C++ exception handler used
8 # pragma warning(disable: 4577) // 'noexcept' used
11 #include <boost/core/verbose_terminate_handler.hpp>
12 #include <boost/throw_exception.hpp>
15 #if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
21 #if defined(_MSC_VER) && (_MSC_VER > 1310)
22 // disable message boxes on assert(), abort()
23 ::_set_abort_behavior(0, _WRITE_ABORT_MSG
| _CALL_REPORTFAULT
);
25 #if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
26 // disable message boxes on iterator debugging violations
27 _CrtSetReportMode( _CRT_ASSERT
, _CRTDBG_MODE_FILE
);
28 _CrtSetReportFile( _CRT_ASSERT
, _CRTDBG_FILE_STDERR
);
31 std::set_terminate( boost::core::verbose_terminate_handler
);
33 boost::throw_with_location( std::exception() );
36 #if defined(BOOST_NO_EXCEPTIONS)
38 void boost::throw_exception( std::exception
const& x
)
40 std::fprintf( stderr
, "throw_exception: %s\n\n", x
.what() );
44 void boost::throw_exception( std::exception
const& x
, boost::source_location
const& )
46 std::fprintf( stderr
, "throw_exception: %s\n\n", x
.what() );