| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
|
2 |
|
// Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
|
| 3 |
|
|
3 |
|
|
| 4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
| 5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
| 6 |
|
|
6 |
|
|
| 7 |
|
// Official repository: https://github.com/cppalliance/capy
|
7 |
|
// Official repository: https://github.com/cppalliance/capy
|
| 8 |
|
|
8 |
|
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#include <boost/capy/error.hpp>
|
10 |
|
#include <boost/capy/error.hpp>
|
| 11 |
|
|
11 |
|
|
| 12 |
|
|
12 |
|
|
| 13 |
|
|
13 |
|
|
| 14 |
|
|
14 |
|
|
| 15 |
|
|
15 |
|
|
| 16 |
|
|
16 |
|
|
| 17 |
|
|
17 |
|
|
| 18 |
|
|
18 |
|
|
| 19 |
|
|
19 |
|
|
| 20 |
|
|
20 |
|
|
| 21 |
|
|
21 |
|
|
| 22 |
|
|
22 |
|
|
| 23 |
|
|
23 |
|
|
| 24 |
|
|
24 |
|
|
| 25 |
|
|
25 |
|
|
| 26 |
|
|
26 |
|
|
| 27 |
|
|
27 |
|
|
| 28 |
|
switch(static_cast<error>(code))
|
28 |
|
switch(static_cast<error>(code))
|
| 29 |
|
|
29 |
|
|
| 30 |
|
case error::eof: return "eof";
|
30 |
|
case error::eof: return "eof";
|
| 31 |
|
case error::canceled: return "operation canceled";
|
31 |
|
case error::canceled: return "operation canceled";
|
| 32 |
|
case error::test_failure: return "test failure";
|
32 |
|
case error::test_failure: return "test failure";
|
| 33 |
|
case error::stream_truncated: return "stream truncated";
|
33 |
|
case error::stream_truncated: return "stream truncated";
|
| 34 |
|
case error::not_found: return "not found";
|
34 |
|
case error::not_found: return "not found";
|
| 35 |
|
|
35 |
|
|
| 36 |
|
|
36 |
|
|
| 37 |
|
|
37 |
|
|
| 38 |
|
|
38 |
|
|
| 39 |
|
|
39 |
|
|
| 40 |
|
//-----------------------------------------------
|
40 |
|
//-----------------------------------------------
|
| 41 |
|
|
41 |
|
|
| 42 |
|
// msvc 14.0 has a bug that warns about inability
|
42 |
|
// msvc 14.0 has a bug that warns about inability
|
| 43 |
|
// to use constexpr construction here, even though
|
43 |
|
// to use constexpr construction here, even though
|
| 44 |
|
// there's no constexpr construction
|
44 |
|
// there's no constexpr construction
|
| 45 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
45 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 46 |
|
|
46 |
|
|
| 47 |
|
# pragma warning( disable : 4592 )
|
47 |
|
# pragma warning( disable : 4592 )
|
| 48 |
|
|
48 |
|
|
| 49 |
|
|
49 |
|
|
| 50 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
50 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
| 51 |
|
constinit error_cat_type error_cat;
|
51 |
|
constinit error_cat_type error_cat;
|
| 52 |
|
|
52 |
|
|
| 53 |
|
error_cat_type error_cat;
|
53 |
|
error_cat_type error_cat;
|
| 54 |
|
|
54 |
|
|
| 55 |
|
|
55 |
|
|
| 56 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
56 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 57 |
|
|
57 |
|
|
| 58 |
|
|
58 |
|
|
| 59 |
|
|
59 |
|
|
| 60 |
|
|
60 |
|
|
| 61 |
|
|
61 |
|
|
| 62 |
|
|
62 |
|
|
| 63 |
|
|
63 |
|
|