blob: 3fe7a998a25002ee86a027440c90f05430a01d02 [file] [log] [blame]
William A. Kennington III2f210732020-08-02 16:12:36 -07001#include <stdplus/exception.hpp>
2
William A. Kennington III9a70f4e2021-05-01 17:16:57 -07003// These will only be used if the compiler doesn't support them
Patrick Williams5e3b13f2021-08-28 14:43:46 -05004#if !__has_builtin(__builtin_LINE)
William A. Kennington III9a70f4e2021-05-01 17:16:57 -07005int __builtin_LINE()
6{
7 return -1;
8}
9const char* __builtin_FILE()
10{
11 return "<unknown>";
12}
13const char* __builtin_FUNCTION()
14{
15 return "<unknown>";
16}
Patrick Williams5e3b13f2021-08-28 14:43:46 -050017#endif
William A. Kennington III9a70f4e2021-05-01 17:16:57 -070018
William A. Kennington III2f210732020-08-02 16:12:36 -070019namespace stdplus
20{
21namespace exception
22{
23
William A. Kennington III95aab6d2023-12-22 16:39:49 -080024Incomplete::Incomplete(const char* what) :
25 std::system_error(std::make_error_code(std::errc::illegal_byte_sequence),
26 what)
27{}
28
29Incomplete::Incomplete(const std::string& what) :
30 std::system_error(std::make_error_code(std::errc::illegal_byte_sequence),
31 what)
32{}
33
William A. Kennington III2f210732020-08-02 16:12:36 -070034WouldBlock::WouldBlock(const char* what) :
35 std::system_error(std::make_error_code(std::errc::operation_would_block),
36 what)
Patrick Williamsd1984dd2023-05-10 16:12:44 -050037{}
William A. Kennington III2f210732020-08-02 16:12:36 -070038
39WouldBlock::WouldBlock(const std::string& what) :
40 std::system_error(std::make_error_code(std::errc::operation_would_block),
41 what)
Patrick Williamsd1984dd2023-05-10 16:12:44 -050042{}
William A. Kennington III2f210732020-08-02 16:12:36 -070043
44Eof::Eof(const char* what) :
45 std::system_error(std::make_error_code(std::errc::no_message_available),
46 what)
Patrick Williamsd1984dd2023-05-10 16:12:44 -050047{}
William A. Kennington III2f210732020-08-02 16:12:36 -070048
49Eof::Eof(const std::string& what) :
50 std::system_error(std::make_error_code(std::errc::no_message_available),
51 what)
Patrick Williamsd1984dd2023-05-10 16:12:44 -050052{}
William A. Kennington III2f210732020-08-02 16:12:36 -070053
54} // namespace exception
55} // namespace stdplus