/src/bios-bmc-smm-error-logger/subprojects/stdplus/src/exception.cpp
Line | Count | Source |
1 | | #include <stdplus/exception.hpp> |
2 | | |
3 | | // These will only be used if the compiler doesn't support them |
4 | | #if !__has_builtin(__builtin_LINE) |
5 | | int __builtin_LINE() |
6 | | { |
7 | | return -1; |
8 | | } |
9 | | const char* __builtin_FILE() |
10 | | { |
11 | | return "<unknown>"; |
12 | | } |
13 | | const char* __builtin_FUNCTION() |
14 | | { |
15 | | return "<unknown>"; |
16 | | } |
17 | | #endif |
18 | | |
19 | | namespace stdplus |
20 | | { |
21 | | namespace exception |
22 | | { |
23 | | |
24 | | Incomplete::Incomplete(const char* what) : |
25 | 0 | std::system_error(std::make_error_code(std::errc::illegal_byte_sequence), |
26 | 0 | what) |
27 | 0 | {} |
28 | | |
29 | | Incomplete::Incomplete(const std::string& what) : |
30 | 0 | std::system_error(std::make_error_code(std::errc::illegal_byte_sequence), |
31 | 0 | what) |
32 | 0 | {} |
33 | | |
34 | | WouldBlock::WouldBlock(const char* what) : |
35 | 0 | std::system_error(std::make_error_code(std::errc::operation_would_block), |
36 | 0 | what) |
37 | 0 | {} |
38 | | |
39 | | WouldBlock::WouldBlock(const std::string& what) : |
40 | 0 | std::system_error(std::make_error_code(std::errc::operation_would_block), |
41 | 0 | what) |
42 | 0 | {} |
43 | | |
44 | | Eof::Eof(const char* what) : |
45 | 0 | std::system_error(std::make_error_code(std::errc::no_message_available), |
46 | 0 | what) |
47 | 0 | {} |
48 | | |
49 | | Eof::Eof(const std::string& what) : |
50 | 0 | std::system_error(std::make_error_code(std::errc::no_message_available), |
51 | 0 | what) |
52 | 0 | {} |
53 | | |
54 | | } // namespace exception |
55 | | } // namespace stdplus |