cc7c8c27558fb6a9b6acf3deceba3e0b175ea1a5
[tpg/acess2.git] / Usermode / Libraries / libc++.so_src / exceptions.cc
1 /*
2  * Acess2 C++ Library
3  * - By John Hodge (thePowersGang)
4  *
5  * exceptions.cc
6  * - exception and friends
7  */
8 #include <string>
9 #include <exception>
10 #include <stdexcept>
11 #include <acess/sys.h>
12
13 // === CODE ===
14 namespace std {
15
16 exception::exception() throw()
17 {
18 }
19 exception::exception(const exception&) throw()
20 {
21 }
22 exception& exception::operator=(const exception&) throw()
23 {
24         return *this;
25 }
26 exception::~exception() throw()
27 {
28 }
29 const char* exception::what() const throw()
30 {
31         return "generic exception";
32 }
33
34 void terminate()
35 {
36         _SysDebug("terminate()");
37         _exit(0);
38 }
39
40 _bits::str_except::str_except(const string& what_arg):
41         m_str(what_arg)
42 {
43 }
44 _bits::str_except::~str_except() noexcept
45 {
46 }
47 _bits::str_except& _bits::str_except::operator=(const str_except& e) noexcept
48 {
49         m_str = e.m_str;
50         return *this;
51 }
52 const char* _bits::str_except::what() const throw()
53 {
54         return m_str.c_str();
55 }
56
57 // --- Standar Exceptions ---
58 logic_error::logic_error(const string& what_str):
59         _bits::str_except(what_str)
60 {
61 }
62
63 out_of_range::out_of_range(const string& what_str):
64         logic_error(what_str)
65 {
66 }
67
68 length_error::length_error(const string& what_str):
69         logic_error(what_str)
70 {
71 }
72
73 runtime_error::runtime_error(const string& what_str):
74         _bits::str_except(what_str)
75 {
76 }
77
78 }       // namespace std
79

UCC git Repository :: git.ucc.asn.au