diff --git a/include/boost/exception/detail/attribute_noreturn.hpp b/include/boost/exception/detail/attribute_noreturn.hpp new file mode 100644 index 0000000..1cb0763 --- /dev/null +++ b/include/boost/exception/detail/attribute_noreturn.hpp @@ -0,0 +1,19 @@ +//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_61531AB0680611DEADD5846855D89593 +#define UUID_61531AB0680611DEADD5846855D89593 + +#include + +#if defined(BOOST_MSVC) +#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn) +#elif defined(__GNUC__) +#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn)) +#else +#define BOOST_ATTRIBUTE_NORETURN +#endif + +#endif diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index da14339..2250bef 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -20,7 +20,7 @@ // http://www.boost.org/libs/utility/throw_exception.html // -#include +#include #include #include @@ -54,7 +54,7 @@ void throw_exception( std::exception const & e ); // user defined inline void throw_exception_assert_compatibility( std::exception const & ) { } -template inline void throw_exception( E const & e ) +template BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e ) { //All boost exceptions are required to derive std::exception, //to ensure compatibility with BOOST_NO_EXCEPTIONS.