Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===---------------------------- system_error ----------------------------===// |
| 3 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 4 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 5 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_SYSTEM_ERROR |
| 12 | #define _LIBCPP_SYSTEM_ERROR |
| 13 | |
| 14 | /* |
| 15 | system_error synopsis |
| 16 | |
| 17 | namespace std |
| 18 | { |
| 19 | |
| 20 | class error_category |
| 21 | { |
| 22 | public: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 23 | virtual ~error_category() noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 24 | |
| 25 | error_category(const error_category&) = delete; |
| 26 | error_category& operator=(const error_category&) = delete; |
| 27 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 28 | virtual const char* name() const noexcept = 0; |
| 29 | virtual error_condition default_error_condition(int ev) const noexcept; |
| 30 | virtual bool equivalent(int code, const error_condition& condition) const noexcept; |
| 31 | virtual bool equivalent(const error_code& code, int condition) const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 32 | virtual string message(int ev) const = 0; |
| 33 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 34 | bool operator==(const error_category& rhs) const noexcept; |
| 35 | bool operator!=(const error_category& rhs) const noexcept; |
| 36 | bool operator<(const error_category& rhs) const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 39 | const error_category& generic_category() noexcept; |
| 40 | const error_category& system_category() noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 41 | |
| 42 | template <class T> struct is_error_code_enum |
| 43 | : public false_type {}; |
| 44 | |
| 45 | template <class T> struct is_error_condition_enum |
| 46 | : public false_type {}; |
| 47 | |
| 48 | class error_code |
| 49 | { |
| 50 | public: |
| 51 | // constructors: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 52 | error_code() noexcept; |
| 53 | error_code(int val, const error_category& cat) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 54 | template <class ErrorCodeEnum> |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 55 | error_code(ErrorCodeEnum e) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 56 | |
| 57 | // modifiers: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 58 | void assign(int val, const error_category& cat) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 59 | template <class ErrorCodeEnum> |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 60 | error_code& operator=(ErrorCodeEnum e) noexcept; |
| 61 | void clear() noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 62 | |
| 63 | // observers: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 64 | int value() const noexcept; |
| 65 | const error_category& category() const noexcept; |
| 66 | error_condition default_error_condition() const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 67 | string message() const; |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 68 | explicit operator bool() const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | // non-member functions: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 72 | bool operator<(const error_code& lhs, const error_code& rhs) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 73 | template <class charT, class traits> |
| 74 | basic_ostream<charT,traits>& |
| 75 | operator<<(basic_ostream<charT,traits>& os, const error_code& ec); |
| 76 | |
| 77 | class error_condition |
| 78 | { |
| 79 | public: |
| 80 | // constructors: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 81 | error_condition() noexcept; |
| 82 | error_condition(int val, const error_category& cat) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 83 | template <class ErrorConditionEnum> |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 84 | error_condition(ErrorConditionEnum e) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 85 | |
| 86 | // modifiers: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 87 | void assign(int val, const error_category& cat) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 88 | template <class ErrorConditionEnum> |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 89 | error_condition& operator=(ErrorConditionEnum e) noexcept; |
| 90 | void clear() noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 91 | |
| 92 | // observers: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 93 | int value() const noexcept; |
| 94 | const error_category& category() const noexcept; |
| 95 | string message() const noexcept; |
| 96 | explicit operator bool() const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 97 | }; |
| 98 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 99 | bool operator<(const error_condition& lhs, const error_condition& rhs) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 100 | |
| 101 | class system_error |
| 102 | : public runtime_error |
| 103 | { |
| 104 | public: |
| 105 | system_error(error_code ec, const string& what_arg); |
| 106 | system_error(error_code ec, const char* what_arg); |
| 107 | system_error(error_code ec); |
| 108 | system_error(int ev, const error_category& ecat, const string& what_arg); |
| 109 | system_error(int ev, const error_category& ecat, const char* what_arg); |
| 110 | system_error(int ev, const error_category& ecat); |
| 111 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 112 | const error_code& code() const noexcept; |
| 113 | const char* what() const noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 114 | }; |
| 115 | |
| 116 | enum class errc |
| 117 | { |
| 118 | address_family_not_supported, // EAFNOSUPPORT |
| 119 | address_in_use, // EADDRINUSE |
| 120 | address_not_available, // EADDRNOTAVAIL |
| 121 | already_connected, // EISCONN |
| 122 | argument_list_too_long, // E2BIG |
| 123 | argument_out_of_domain, // EDOM |
| 124 | bad_address, // EFAULT |
| 125 | bad_file_descriptor, // EBADF |
| 126 | bad_message, // EBADMSG |
| 127 | broken_pipe, // EPIPE |
| 128 | connection_aborted, // ECONNABORTED |
| 129 | connection_already_in_progress, // EALREADY |
| 130 | connection_refused, // ECONNREFUSED |
| 131 | connection_reset, // ECONNRESET |
| 132 | cross_device_link, // EXDEV |
| 133 | destination_address_required, // EDESTADDRREQ |
| 134 | device_or_resource_busy, // EBUSY |
| 135 | directory_not_empty, // ENOTEMPTY |
| 136 | executable_format_error, // ENOEXEC |
| 137 | file_exists, // EEXIST |
| 138 | file_too_large, // EFBIG |
| 139 | filename_too_long, // ENAMETOOLONG |
| 140 | function_not_supported, // ENOSYS |
| 141 | host_unreachable, // EHOSTUNREACH |
| 142 | identifier_removed, // EIDRM |
| 143 | illegal_byte_sequence, // EILSEQ |
| 144 | inappropriate_io_control_operation, // ENOTTY |
| 145 | interrupted, // EINTR |
| 146 | invalid_argument, // EINVAL |
| 147 | invalid_seek, // ESPIPE |
| 148 | io_error, // EIO |
| 149 | is_a_directory, // EISDIR |
| 150 | message_size, // EMSGSIZE |
| 151 | network_down, // ENETDOWN |
| 152 | network_reset, // ENETRESET |
| 153 | network_unreachable, // ENETUNREACH |
| 154 | no_buffer_space, // ENOBUFS |
| 155 | no_child_process, // ECHILD |
| 156 | no_link, // ENOLINK |
| 157 | no_lock_available, // ENOLCK |
| 158 | no_message_available, // ENODATA |
| 159 | no_message, // ENOMSG |
| 160 | no_protocol_option, // ENOPROTOOPT |
| 161 | no_space_on_device, // ENOSPC |
| 162 | no_stream_resources, // ENOSR |
| 163 | no_such_device_or_address, // ENXIO |
| 164 | no_such_device, // ENODEV |
| 165 | no_such_file_or_directory, // ENOENT |
| 166 | no_such_process, // ESRCH |
| 167 | not_a_directory, // ENOTDIR |
| 168 | not_a_socket, // ENOTSOCK |
| 169 | not_a_stream, // ENOSTR |
| 170 | not_connected, // ENOTCONN |
| 171 | not_enough_memory, // ENOMEM |
| 172 | not_supported, // ENOTSUP |
| 173 | operation_canceled, // ECANCELED |
| 174 | operation_in_progress, // EINPROGRESS |
| 175 | operation_not_permitted, // EPERM |
| 176 | operation_not_supported, // EOPNOTSUPP |
| 177 | operation_would_block, // EWOULDBLOCK |
| 178 | owner_dead, // EOWNERDEAD |
| 179 | permission_denied, // EACCES |
| 180 | protocol_error, // EPROTO |
| 181 | protocol_not_supported, // EPROTONOSUPPORT |
| 182 | read_only_file_system, // EROFS |
| 183 | resource_deadlock_would_occur, // EDEADLK |
| 184 | resource_unavailable_try_again, // EAGAIN |
| 185 | result_out_of_range, // ERANGE |
| 186 | state_not_recoverable, // ENOTRECOVERABLE |
| 187 | stream_timeout, // ETIME |
| 188 | text_file_busy, // ETXTBSY |
| 189 | timed_out, // ETIMEDOUT |
| 190 | too_many_files_open_in_system, // ENFILE |
| 191 | too_many_files_open, // EMFILE |
| 192 | too_many_links, // EMLINK |
| 193 | too_many_symbolic_link_levels, // ELOOP |
| 194 | value_too_large, // EOVERFLOW |
| 195 | wrong_protocol_type // EPROTOTYPE |
| 196 | }; |
| 197 | |
| 198 | template <> struct is_error_condition_enum<errc> |
| 199 | : true_type { } |
| 200 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 201 | error_code make_error_code(errc e) noexcept; |
| 202 | error_condition make_error_condition(errc e) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 203 | |
| 204 | // Comparison operators: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 205 | bool operator==(const error_code& lhs, const error_code& rhs) noexcept; |
| 206 | bool operator==(const error_code& lhs, const error_condition& rhs) noexcept; |
| 207 | bool operator==(const error_condition& lhs, const error_code& rhs) noexcept; |
| 208 | bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept; |
| 209 | bool operator!=(const error_code& lhs, const error_code& rhs) noexcept; |
| 210 | bool operator!=(const error_code& lhs, const error_condition& rhs) noexcept; |
| 211 | bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept; |
| 212 | bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 213 | |
| 214 | template <> struct hash<std::error_code>; |
| 215 | |
| 216 | } // std |
| 217 | |
| 218 | */ |
| 219 | |
| 220 | #include <__config> |
| 221 | #include <cerrno> |
| 222 | #include <type_traits> |
| 223 | #include <stdexcept> |
| 224 | #include <__functional_base> |
| 225 | |
Howard Hinnant | 08e1747 | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 226 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 227 | #pragma GCC system_header |
Howard Hinnant | 08e1747 | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 228 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 229 | |
| 230 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 231 | |
| 232 | // is_error_code_enum |
| 233 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 234 | template <class _Tp> |
| 235 | struct _LIBCPP_VISIBLE is_error_code_enum |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 236 | : public false_type {}; |
| 237 | |
| 238 | // is_error_condition_enum |
| 239 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 240 | template <class _Tp> |
| 241 | struct _LIBCPP_VISIBLE is_error_condition_enum |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 242 | : public false_type {}; |
| 243 | |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 244 | // Some error codes are not present on all platforms, so we provide equivalents |
| 245 | // for them: |
| 246 | |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 247 | //enum class errc |
Howard Hinnant | f6d875f | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 248 | _LIBCPP_DECLARE_STRONG_ENUM(errc) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 249 | { |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 250 | address_family_not_supported = EAFNOSUPPORT, |
| 251 | address_in_use = EADDRINUSE, |
| 252 | address_not_available = EADDRNOTAVAIL, |
| 253 | already_connected = EISCONN, |
| 254 | argument_list_too_long = E2BIG, |
| 255 | argument_out_of_domain = EDOM, |
| 256 | bad_address = EFAULT, |
| 257 | bad_file_descriptor = EBADF, |
| 258 | bad_message = EBADMSG, |
| 259 | broken_pipe = EPIPE, |
| 260 | connection_aborted = ECONNABORTED, |
| 261 | connection_already_in_progress = EALREADY, |
| 262 | connection_refused = ECONNREFUSED, |
| 263 | connection_reset = ECONNRESET, |
| 264 | cross_device_link = EXDEV, |
| 265 | destination_address_required = EDESTADDRREQ, |
| 266 | device_or_resource_busy = EBUSY, |
| 267 | directory_not_empty = ENOTEMPTY, |
| 268 | executable_format_error = ENOEXEC, |
| 269 | file_exists = EEXIST, |
| 270 | file_too_large = EFBIG, |
| 271 | filename_too_long = ENAMETOOLONG, |
| 272 | function_not_supported = ENOSYS, |
| 273 | host_unreachable = EHOSTUNREACH, |
| 274 | identifier_removed = EIDRM, |
| 275 | illegal_byte_sequence = EILSEQ, |
| 276 | inappropriate_io_control_operation = ENOTTY, |
| 277 | interrupted = EINTR, |
| 278 | invalid_argument = EINVAL, |
| 279 | invalid_seek = ESPIPE, |
| 280 | io_error = EIO, |
| 281 | is_a_directory = EISDIR, |
| 282 | message_size = EMSGSIZE, |
| 283 | network_down = ENETDOWN, |
| 284 | network_reset = ENETRESET, |
| 285 | network_unreachable = ENETUNREACH, |
| 286 | no_buffer_space = ENOBUFS, |
| 287 | no_child_process = ECHILD, |
| 288 | no_link = ENOLINK, |
| 289 | no_lock_available = ENOLCK, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 290 | #ifdef ENODATA |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 291 | no_message_available = ENODATA, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 292 | #else |
| 293 | no_message_available = ENOMSG, |
| 294 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 295 | no_message = ENOMSG, |
| 296 | no_protocol_option = ENOPROTOOPT, |
| 297 | no_space_on_device = ENOSPC, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 298 | #ifdef ENOSR |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 299 | no_stream_resources = ENOSR, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 300 | #else |
| 301 | no_stream_resources = ENOMEM, |
| 302 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 303 | no_such_device_or_address = ENXIO, |
| 304 | no_such_device = ENODEV, |
| 305 | no_such_file_or_directory = ENOENT, |
| 306 | no_such_process = ESRCH, |
| 307 | not_a_directory = ENOTDIR, |
| 308 | not_a_socket = ENOTSOCK, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 309 | #ifdef ENOSTR |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 310 | not_a_stream = ENOSTR, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 311 | #else |
| 312 | not_a_stream = EINVAL, |
| 313 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 314 | not_connected = ENOTCONN, |
| 315 | not_enough_memory = ENOMEM, |
| 316 | not_supported = ENOTSUP, |
| 317 | operation_canceled = ECANCELED, |
| 318 | operation_in_progress = EINPROGRESS, |
| 319 | operation_not_permitted = EPERM, |
| 320 | operation_not_supported = EOPNOTSUPP, |
| 321 | operation_would_block = EWOULDBLOCK, |
| 322 | owner_dead = EOWNERDEAD, |
| 323 | permission_denied = EACCES, |
| 324 | protocol_error = EPROTO, |
| 325 | protocol_not_supported = EPROTONOSUPPORT, |
| 326 | read_only_file_system = EROFS, |
| 327 | resource_deadlock_would_occur = EDEADLK, |
| 328 | resource_unavailable_try_again = EAGAIN, |
| 329 | result_out_of_range = ERANGE, |
| 330 | state_not_recoverable = ENOTRECOVERABLE, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 331 | #ifdef ETIME |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 332 | stream_timeout = ETIME, |
David Chisnall | 81e6858 | 2010-08-11 16:52:41 +0000 | [diff] [blame] | 333 | #else |
| 334 | stream_timeout = ETIMEDOUT, |
| 335 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 336 | text_file_busy = ETXTBSY, |
| 337 | timed_out = ETIMEDOUT, |
| 338 | too_many_files_open_in_system = ENFILE, |
| 339 | too_many_files_open = EMFILE, |
| 340 | too_many_links = EMLINK, |
| 341 | too_many_symbolic_link_levels = ELOOP, |
| 342 | value_too_large = EOVERFLOW, |
| 343 | wrong_protocol_type = EPROTOTYPE |
| 344 | }; |
Howard Hinnant | f6d875f | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 345 | _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 346 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 347 | template <> |
| 348 | struct _LIBCPP_VISIBLE is_error_condition_enum<errc> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 349 | : true_type { }; |
| 350 | |
Howard Hinnant | f6d875f | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 351 | #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 352 | template <> |
| 353 | struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 354 | : true_type { }; |
Howard Hinnant | f6d875f | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 355 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 356 | |
| 357 | class error_condition; |
| 358 | class error_code; |
| 359 | |
| 360 | // class error_category |
| 361 | |
| 362 | class __do_message; |
| 363 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 364 | class _LIBCPP_VISIBLE error_category |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 365 | { |
| 366 | public: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 367 | virtual ~error_category() _NOEXCEPT; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 368 | |
| 369 | private: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 370 | error_category() _NOEXCEPT; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 371 | error_category(const error_category&);// = delete; |
| 372 | error_category& operator=(const error_category&);// = delete; |
| 373 | |
| 374 | public: |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 375 | virtual const char* name() const _NOEXCEPT = 0; |
| 376 | virtual error_condition default_error_condition(int __ev) const _NOEXCEPT; |
| 377 | virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT; |
| 378 | virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 379 | virtual string message(int __ev) const = 0; |
| 380 | |
| 381 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 382 | bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 383 | |
| 384 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 385 | bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 386 | |
| 387 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 388 | bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 389 | |
| 390 | friend class __do_message; |
| 391 | }; |
| 392 | |
| 393 | class _LIBCPP_HIDDEN __do_message |
| 394 | : public error_category |
| 395 | { |
| 396 | public: |
| 397 | virtual string message(int ev) const; |
| 398 | }; |
| 399 | |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 400 | const error_category& generic_category() _NOEXCEPT; |
| 401 | const error_category& system_category() _NOEXCEPT; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 402 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 403 | class _LIBCPP_VISIBLE error_condition |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 404 | { |
| 405 | int __val_; |
| 406 | const error_category* __cat_; |
| 407 | public: |
| 408 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 409 | error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 410 | |
| 411 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 412 | error_condition(int __val, const error_category& __cat) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 413 | : __val_(__val), __cat_(&__cat) {} |
| 414 | |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 415 | template <class _Ep> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 416 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 417 | error_condition(_Ep __e, |
| 418 | typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0 |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 419 | ) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 420 | {*this = make_error_condition(__e);} |
| 421 | |
| 422 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 423 | void assign(int __val, const error_category& __cat) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 424 | { |
| 425 | __val_ = __val; |
| 426 | __cat_ = &__cat; |
| 427 | } |
| 428 | |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 429 | template <class _Ep> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 430 | _LIBCPP_ALWAYS_INLINE |
| 431 | typename enable_if |
| 432 | < |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 433 | is_error_condition_enum<_Ep>::value, |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 434 | error_condition& |
| 435 | >::type |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 436 | operator=(_Ep __e) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 437 | {*this = make_error_condition(__e); return *this;} |
| 438 | |
| 439 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 440 | void clear() _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 441 | { |
| 442 | __val_ = 0; |
| 443 | __cat_ = &generic_category(); |
| 444 | } |
| 445 | |
| 446 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 447 | int value() const _NOEXCEPT {return __val_;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 448 | |
| 449 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 450 | const error_category& category() const _NOEXCEPT {return *__cat_;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 451 | string message() const; |
| 452 | |
| 453 | _LIBCPP_ALWAYS_INLINE |
| 454 | //explicit |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 455 | operator bool() const _NOEXCEPT {return __val_ != 0;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 456 | }; |
| 457 | |
| 458 | inline _LIBCPP_INLINE_VISIBILITY |
| 459 | error_condition |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 460 | make_error_condition(errc __e) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 461 | { |
| 462 | return error_condition(static_cast<int>(__e), generic_category()); |
| 463 | } |
| 464 | |
| 465 | inline _LIBCPP_INLINE_VISIBILITY |
| 466 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 467 | operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 468 | { |
| 469 | return __x.category() < __y.category() |
Howard Hinnant | ec3773c | 2011-12-01 20:21:04 +0000 | [diff] [blame] | 470 | || (__x.category() == __y.category() && __x.value() < __y.value()); |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | // error_code |
| 474 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 475 | class _LIBCPP_VISIBLE error_code |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 476 | { |
| 477 | int __val_; |
| 478 | const error_category* __cat_; |
| 479 | public: |
| 480 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 481 | error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 482 | |
| 483 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 484 | error_code(int __val, const error_category& __cat) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 485 | : __val_(__val), __cat_(&__cat) {} |
| 486 | |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 487 | template <class _Ep> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 488 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 489 | error_code(_Ep __e, |
| 490 | typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0 |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 491 | ) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 492 | {*this = make_error_code(__e);} |
| 493 | |
| 494 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 495 | void assign(int __val, const error_category& __cat) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 496 | { |
| 497 | __val_ = __val; |
| 498 | __cat_ = &__cat; |
| 499 | } |
| 500 | |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 501 | template <class _Ep> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 502 | _LIBCPP_ALWAYS_INLINE |
| 503 | typename enable_if |
| 504 | < |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 505 | is_error_code_enum<_Ep>::value, |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 506 | error_code& |
| 507 | >::type |
Howard Hinnant | 9996844 | 2011-11-29 18:15:50 +0000 | [diff] [blame] | 508 | operator=(_Ep __e) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 509 | {*this = make_error_code(__e); return *this;} |
| 510 | |
| 511 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 512 | void clear() _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 513 | { |
| 514 | __val_ = 0; |
| 515 | __cat_ = &system_category(); |
| 516 | } |
| 517 | |
| 518 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 519 | int value() const _NOEXCEPT {return __val_;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 520 | |
| 521 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 522 | const error_category& category() const _NOEXCEPT {return *__cat_;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 523 | |
| 524 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 525 | error_condition default_error_condition() const _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 526 | {return __cat_->default_error_condition(__val_);} |
| 527 | |
| 528 | string message() const; |
| 529 | |
| 530 | _LIBCPP_ALWAYS_INLINE |
| 531 | //explicit |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 532 | operator bool() const _NOEXCEPT {return __val_ != 0;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 533 | }; |
| 534 | |
| 535 | inline _LIBCPP_INLINE_VISIBILITY |
| 536 | error_code |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 537 | make_error_code(errc __e) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 538 | { |
| 539 | return error_code(static_cast<int>(__e), generic_category()); |
| 540 | } |
| 541 | |
| 542 | inline _LIBCPP_INLINE_VISIBILITY |
| 543 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 544 | operator<(const error_code& __x, const error_code& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 545 | { |
| 546 | return __x.category() < __y.category() |
Howard Hinnant | ec3773c | 2011-12-01 20:21:04 +0000 | [diff] [blame] | 547 | || (__x.category() == __y.category() && __x.value() < __y.value()); |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | inline _LIBCPP_INLINE_VISIBILITY |
| 551 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 552 | operator==(const error_code& __x, const error_code& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 553 | { |
| 554 | return __x.category() == __y.category() && __x.value() == __y.value(); |
| 555 | } |
| 556 | |
| 557 | inline _LIBCPP_INLINE_VISIBILITY |
| 558 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 559 | operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 560 | { |
| 561 | return __x.category().equivalent(__x.value(), __y) |
| 562 | || __y.category().equivalent(__x, __y.value()); |
| 563 | } |
| 564 | |
| 565 | inline _LIBCPP_INLINE_VISIBILITY |
| 566 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 567 | operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 568 | { |
| 569 | return __y == __x; |
| 570 | } |
| 571 | |
| 572 | inline _LIBCPP_INLINE_VISIBILITY |
| 573 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 574 | operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 575 | { |
| 576 | return __x.category() == __y.category() && __x.value() == __y.value(); |
| 577 | } |
| 578 | |
| 579 | inline _LIBCPP_INLINE_VISIBILITY |
| 580 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 581 | operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT |
| 582 | {return !(__x == __y);} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 583 | |
| 584 | inline _LIBCPP_INLINE_VISIBILITY |
| 585 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 586 | operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT |
| 587 | {return !(__x == __y);} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 588 | |
| 589 | inline _LIBCPP_INLINE_VISIBILITY |
| 590 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 591 | operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT |
| 592 | {return !(__x == __y);} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 593 | |
| 594 | inline _LIBCPP_INLINE_VISIBILITY |
| 595 | bool |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 596 | operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT |
| 597 | {return !(__x == __y);} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 598 | |
| 599 | template <> |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 600 | struct _LIBCPP_VISIBLE hash<error_code> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 601 | : public unary_function<error_code, size_t> |
| 602 | { |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 603 | _LIBCPP_INLINE_VISIBILITY |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 604 | size_t operator()(const error_code& __ec) const _NOEXCEPT |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 605 | { |
| 606 | return static_cast<size_t>(__ec.value()); |
| 607 | } |
| 608 | }; |
| 609 | |
| 610 | // system_error |
| 611 | |
Howard Hinnant | 8d7a955 | 2010-09-23 17:31:07 +0000 | [diff] [blame] | 612 | class _LIBCPP_VISIBLE system_error |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 613 | : public runtime_error |
| 614 | { |
| 615 | error_code __ec_; |
| 616 | public: |
| 617 | system_error(error_code __ec, const string& __what_arg); |
| 618 | system_error(error_code __ec, const char* __what_arg); |
| 619 | system_error(error_code __ec); |
| 620 | system_error(int __ev, const error_category& __ecat, const string& __what_arg); |
| 621 | system_error(int __ev, const error_category& __ecat, const char* __what_arg); |
| 622 | system_error(int __ev, const error_category& __ecat); |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 623 | ~system_error() _NOEXCEPT; |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 624 | |
| 625 | _LIBCPP_ALWAYS_INLINE |
Howard Hinnant | 1e15fd1 | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 626 | const error_code& code() const _NOEXCEPT {return __ec_;} |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 627 | |
| 628 | private: |
| 629 | static string __init(const error_code&, string); |
| 630 | }; |
| 631 | |
| 632 | void __throw_system_error(int ev, const char* what_arg); |
| 633 | |
| 634 | _LIBCPP_END_NAMESPACE_STD |
| 635 | |
| 636 | #endif // _LIBCPP_SYSTEM_ERROR |