1 | #ifndef BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_MESSAGE_HPP_INCLUDED |
2 | #define BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_MESSAGE_HPP_INCLUDED |
3 | |
4 | // Implementation of system_error_category_message |
5 | // |
6 | // Copyright 2018, 2022 Peter Dimov |
7 | // |
8 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
9 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
10 | // |
11 | // See library home page at http://www.boost.org/libs/system |
12 | |
13 | #include <boost/system/api_config.hpp> |
14 | |
15 | #if !defined(BOOST_POSIX_API) && !defined(BOOST_WINDOWS_API) |
16 | # error BOOST_POSIX_API or BOOST_WINDOWS_API must be defined |
17 | #endif |
18 | |
19 | #if defined(BOOST_WINDOWS_API) |
20 | |
21 | #include <boost/system/detail/system_category_message_win32.hpp> |
22 | |
23 | namespace boost |
24 | { |
25 | namespace system |
26 | { |
27 | namespace detail |
28 | { |
29 | |
30 | inline std::string system_error_category_message( int ev ) |
31 | { |
32 | return system_category_message_win32( ev ); |
33 | } |
34 | |
35 | inline char const * system_error_category_message( int ev, char * buffer, std::size_t len ) noexcept |
36 | { |
37 | return system_category_message_win32( ev, buffer, len ); |
38 | } |
39 | |
40 | } // namespace detail |
41 | } // namespace system |
42 | } // namespace boost |
43 | |
44 | #else // #if defined(BOOST_WINDOWS_API) |
45 | |
46 | #include <boost/system/detail/generic_category_message.hpp> |
47 | |
48 | namespace boost |
49 | { |
50 | namespace system |
51 | { |
52 | namespace detail |
53 | { |
54 | |
55 | inline std::string system_error_category_message( int ev ) |
56 | { |
57 | return generic_error_category_message( ev ); |
58 | } |
59 | |
60 | inline char const * system_error_category_message( int ev, char * buffer, std::size_t len ) noexcept |
61 | { |
62 | return generic_error_category_message( ev, buffer, len ); |
63 | } |
64 | |
65 | } // namespace detail |
66 | } // namespace system |
67 | } // namespace boost |
68 | |
69 | #endif // #if defined(BOOST_WINDOWS_API) |
70 | |
71 | #endif // #ifndef BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_MESSAGE_HPP_INCLUDED |
72 | |