xref: /minix3/external/bsd/libc++/dist/libcxxrt/src/stdexcept.cc (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc /*
2*4684ddb6SLionel Sambuc  * Copyright 2010-2011 PathScale, Inc. All rights reserved.
3*4684ddb6SLionel Sambuc  *
4*4684ddb6SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
5*4684ddb6SLionel Sambuc  * modification, are permitted provided that the following conditions are met:
6*4684ddb6SLionel Sambuc  *
7*4684ddb6SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright notice,
8*4684ddb6SLionel Sambuc  *    this list of conditions and the following disclaimer.
9*4684ddb6SLionel Sambuc  *
10*4684ddb6SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright notice,
11*4684ddb6SLionel Sambuc  *    this list of conditions and the following disclaimer in the documentation
12*4684ddb6SLionel Sambuc  *    and/or other materials provided with the distribution.
13*4684ddb6SLionel Sambuc  *
14*4684ddb6SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
15*4684ddb6SLionel Sambuc  * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16*4684ddb6SLionel Sambuc  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17*4684ddb6SLionel Sambuc  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18*4684ddb6SLionel Sambuc  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19*4684ddb6SLionel Sambuc  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20*4684ddb6SLionel Sambuc  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21*4684ddb6SLionel Sambuc  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22*4684ddb6SLionel Sambuc  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23*4684ddb6SLionel Sambuc  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24*4684ddb6SLionel Sambuc  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*4684ddb6SLionel Sambuc  */
26*4684ddb6SLionel Sambuc 
27*4684ddb6SLionel Sambuc /**
28*4684ddb6SLionel Sambuc  * stdexcept.cc - provides stub implementations of the exceptions required by the runtime.
29*4684ddb6SLionel Sambuc  */
30*4684ddb6SLionel Sambuc #include "stdexcept.h"
31*4684ddb6SLionel Sambuc 
32*4684ddb6SLionel Sambuc namespace std {
33*4684ddb6SLionel Sambuc 
34*4684ddb6SLionel Sambuc exception::exception() throw() {}
35*4684ddb6SLionel Sambuc exception::~exception() {}
36*4684ddb6SLionel Sambuc exception::exception(const exception&) throw() {}
37*4684ddb6SLionel Sambuc exception& exception::operator=(const exception&) throw()
38*4684ddb6SLionel Sambuc {
39*4684ddb6SLionel Sambuc 	return *this;
40*4684ddb6SLionel Sambuc }
41*4684ddb6SLionel Sambuc const char* exception::what() const throw()
42*4684ddb6SLionel Sambuc {
43*4684ddb6SLionel Sambuc 	return "std::exception";
44*4684ddb6SLionel Sambuc }
45*4684ddb6SLionel Sambuc 
46*4684ddb6SLionel Sambuc bad_alloc::bad_alloc() throw() {}
47*4684ddb6SLionel Sambuc bad_alloc::~bad_alloc() {}
48*4684ddb6SLionel Sambuc bad_alloc::bad_alloc(const bad_alloc&) throw() {}
49*4684ddb6SLionel Sambuc bad_alloc& bad_alloc::operator=(const bad_alloc&) throw()
50*4684ddb6SLionel Sambuc {
51*4684ddb6SLionel Sambuc 	return *this;
52*4684ddb6SLionel Sambuc }
53*4684ddb6SLionel Sambuc const char* bad_alloc::what() const throw()
54*4684ddb6SLionel Sambuc {
55*4684ddb6SLionel Sambuc 	return "cxxrt::bad_alloc";
56*4684ddb6SLionel Sambuc }
57*4684ddb6SLionel Sambuc 
58*4684ddb6SLionel Sambuc 
59*4684ddb6SLionel Sambuc 
60*4684ddb6SLionel Sambuc bad_cast::bad_cast() throw() {}
61*4684ddb6SLionel Sambuc bad_cast::~bad_cast() {}
62*4684ddb6SLionel Sambuc bad_cast::bad_cast(const bad_cast&) throw() {}
63*4684ddb6SLionel Sambuc bad_cast& bad_cast::operator=(const bad_cast&) throw()
64*4684ddb6SLionel Sambuc {
65*4684ddb6SLionel Sambuc 	return *this;
66*4684ddb6SLionel Sambuc }
67*4684ddb6SLionel Sambuc const char* bad_cast::what() const throw()
68*4684ddb6SLionel Sambuc {
69*4684ddb6SLionel Sambuc 	return "std::bad_cast";
70*4684ddb6SLionel Sambuc }
71*4684ddb6SLionel Sambuc 
72*4684ddb6SLionel Sambuc bad_typeid::bad_typeid() throw() {}
73*4684ddb6SLionel Sambuc bad_typeid::~bad_typeid() {}
74*4684ddb6SLionel Sambuc bad_typeid::bad_typeid(const bad_typeid &__rhs) throw() {}
75*4684ddb6SLionel Sambuc bad_typeid& bad_typeid::operator=(const bad_typeid &__rhs) throw()
76*4684ddb6SLionel Sambuc {
77*4684ddb6SLionel Sambuc 	return *this;
78*4684ddb6SLionel Sambuc }
79*4684ddb6SLionel Sambuc 
80*4684ddb6SLionel Sambuc const char* bad_typeid::what() const throw()
81*4684ddb6SLionel Sambuc {
82*4684ddb6SLionel Sambuc 	return "std::bad_typeid";
83*4684ddb6SLionel Sambuc }
84*4684ddb6SLionel Sambuc 
85*4684ddb6SLionel Sambuc } // namespace std
86*4684ddb6SLionel Sambuc 
87