X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibc%2B%2B.so_src%2Fexceptions.cc;h=cc7c8c27558fb6a9b6acf3deceba3e0b175ea1a5;hb=5cab4c07bc13888dc7956194ef9595508072a4eb;hp=117ceeb23f7e13a890470163cb022cba2cfda5dd;hpb=145dd00e5c5a36f844be327e16a00b2983245423;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc++.so_src/exceptions.cc b/Usermode/Libraries/libc++.so_src/exceptions.cc index 117ceeb2..cc7c8c27 100644 --- a/Usermode/Libraries/libc++.so_src/exceptions.cc +++ b/Usermode/Libraries/libc++.so_src/exceptions.cc @@ -3,7 +3,7 @@ * - By John Hodge (thePowersGang) * * exceptions.cc - * - ::std::exception and friends + * - exception and friends */ #include #include @@ -11,55 +11,69 @@ #include // === CODE === -::std::exception::exception() throw(): - m_what_str("-empty-") -{ -} -::std::exception::exception(const exception& other) throw(): - m_what_str(other.m_what_str) +namespace std { + +exception::exception() throw() { } -::std::exception::exception(const string& str) throw(): - m_what_str(str) +exception::exception(const exception&) throw() { } -::std::exception& ::std::exception::operator=(const exception& other) throw() +exception& exception::operator=(const exception&) throw() { - m_what_str = other.m_what_str; return *this; } -::std::exception::~exception() throw() +exception::~exception() throw() { } -const char* ::std::exception::what() const throw() +const char* exception::what() const throw() { - return m_what_str.c_str(); + return "generic exception"; } -void ::std::terminate() +void terminate() { - _SysDebug("::std::terminate()"); + _SysDebug("terminate()"); _exit(0); } +_bits::str_except::str_except(const string& what_arg): + m_str(what_arg) +{ +} +_bits::str_except::~str_except() noexcept +{ +} +_bits::str_except& _bits::str_except::operator=(const str_except& e) noexcept +{ + m_str = e.m_str; + return *this; +} +const char* _bits::str_except::what() const throw() +{ + return m_str.c_str(); +} + // --- Standar Exceptions --- -::std::logic_error::logic_error(const ::std::string& what_str): - exception(what_str) +logic_error::logic_error(const string& what_str): + _bits::str_except(what_str) { } -::std::out_of_range::out_of_range(const ::std::string& what_str): +out_of_range::out_of_range(const string& what_str): logic_error(what_str) { } -::std::length_error::length_error(const ::std::string& what_str): +length_error::length_error(const string& what_str): logic_error(what_str) { } -::std::runtime_error::runtime_error(const ::std::string& what_str): - exception(what_str) +runtime_error::runtime_error(const string& what_str): + _bits::str_except(what_str) { } +} // namespace std +