Chris@16: // Chris@16: // detail/throw_exception.hpp Chris@16: // ~~~~~~~~~~~~~~~~~~~~~~~~~~ Chris@16: // Chris@101: // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #ifndef BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP Chris@16: #define BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: # pragma once Chris@16: #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION) Chris@16: # include Chris@16: #endif // defined(BOOST_ASIO_BOOST_THROW_EXCEPTION) Chris@16: Chris@16: namespace boost { Chris@16: namespace asio { Chris@16: namespace detail { Chris@16: Chris@16: #if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION) Chris@16: using boost::throw_exception; Chris@16: #else // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION) Chris@16: Chris@16: // Declare the throw_exception function for all targets. Chris@16: template Chris@16: void throw_exception(const Exception& e); Chris@16: Chris@16: // Only define the throw_exception function when exceptions are enabled. Chris@16: // Otherwise, it is up to the application to provide a definition of this Chris@16: // function. Chris@16: # if !defined(BOOST_ASIO_NO_EXCEPTIONS) Chris@16: template Chris@16: void throw_exception(const Exception& e) Chris@16: { Chris@16: throw e; Chris@16: } Chris@16: # endif // !defined(BOOST_ASIO_NO_EXCEPTIONS) Chris@16: Chris@16: #endif // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION) Chris@16: Chris@16: } // namespace detail Chris@16: } // namespace asio Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP