| 1 | #ifndef BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED |
|---|---|
| 2 | #define BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED |
| 3 | |
| 4 | // Copyright 2023 Peter Dimov |
| 5 | // Distributed under the Boost Software License, Version 1.0. |
| 6 | // https://www.boost.org/LICENSE_1_0.txt |
| 7 | |
| 8 | #include <boost/throw_exception.hpp> |
| 9 | #include <boost/config.hpp> |
| 10 | #include <system_error> |
| 11 | |
| 12 | namespace boost { |
| 13 | namespace compat { |
| 14 | namespace detail { |
| 15 | |
| 16 | BOOST_NORETURN BOOST_NOINLINE inline void throw_system_error( std::errc e, boost::source_location const& loc = BOOST_CURRENT_LOCATION ) |
| 17 | { |
| 18 | boost::throw_exception( e: std::system_error( std::make_error_code( e: e ) ), loc ); |
| 19 | } |
| 20 | |
| 21 | } // namespace detail |
| 22 | } // namespace compat |
| 23 | } // namespace boost |
| 24 | |
| 25 | #endif // BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED |
| 26 |
