1*404b540aSrobert // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
2*404b540aSrobert //
3*404b540aSrobert // This file is part of the GNU ISO C++ Library.  This library is free
4*404b540aSrobert // software; you can redistribute it and/or modify it under the
5*404b540aSrobert // terms of the GNU General Public License as published by the
6*404b540aSrobert // Free Software Foundation; either version 2, or (at your option)
7*404b540aSrobert // any later version.
8*404b540aSrobert 
9*404b540aSrobert // This library is distributed in the hope that it will be useful,
10*404b540aSrobert // but WITHOUT ANY WARRANTY; without even the implied warranty of
11*404b540aSrobert // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*404b540aSrobert // GNU General Public License for more details.
13*404b540aSrobert 
14*404b540aSrobert // You should have received a copy of the GNU General Public License along
15*404b540aSrobert // with this library; see the file COPYING.  If not, write to the Free
16*404b540aSrobert // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17*404b540aSrobert // USA.
18*404b540aSrobert 
19*404b540aSrobert // As a special exception, you may use this file as part of a free software
20*404b540aSrobert // library without restriction.  Specifically, if other files instantiate
21*404b540aSrobert // templates or use macros or inline functions from this file, or you compile
22*404b540aSrobert // this file and link it with other files to produce an executable, this
23*404b540aSrobert // file does not by itself cause the resulting executable to be covered by
24*404b540aSrobert // the GNU General Public License.  This exception does not however
25*404b540aSrobert // invalidate any other reasons why the executable file might be covered by
26*404b540aSrobert // the GNU General Public License.
27*404b540aSrobert 
28*404b540aSrobert #include <bits/functexcept.h>
29*404b540aSrobert #include <cstdlib>
30*404b540aSrobert #include <exception>
31*404b540aSrobert #include <stdexcept>
32*404b540aSrobert #include <new>
33*404b540aSrobert #include <typeinfo>
34*404b540aSrobert #include <ios>
35*404b540aSrobert 
36*404b540aSrobert #ifdef _GLIBCXX_USE_NLS
37*404b540aSrobert # include <libintl.h>
38*404b540aSrobert # define _(msgid)   gettext (msgid)
39*404b540aSrobert #else
40*404b540aSrobert # define _(msgid)   (msgid)
41*404b540aSrobert #endif
42*404b540aSrobert 
_GLIBCXX_BEGIN_NAMESPACE(std)43*404b540aSrobert _GLIBCXX_BEGIN_NAMESPACE(std)
44*404b540aSrobert 
45*404b540aSrobert #if __EXCEPTIONS
46*404b540aSrobert   void
47*404b540aSrobert   __throw_bad_exception(void)
48*404b540aSrobert   { throw bad_exception(); }
49*404b540aSrobert 
50*404b540aSrobert   void
__throw_bad_alloc(void)51*404b540aSrobert   __throw_bad_alloc(void)
52*404b540aSrobert   { throw bad_alloc(); }
53*404b540aSrobert 
54*404b540aSrobert   void
__throw_bad_cast(void)55*404b540aSrobert   __throw_bad_cast(void)
56*404b540aSrobert   { throw bad_cast(); }
57*404b540aSrobert 
58*404b540aSrobert   void
__throw_bad_typeid(void)59*404b540aSrobert   __throw_bad_typeid(void)
60*404b540aSrobert   { throw bad_typeid(); }
61*404b540aSrobert 
62*404b540aSrobert   void
__throw_logic_error(const char * __s)63*404b540aSrobert   __throw_logic_error(const char* __s)
64*404b540aSrobert   { throw logic_error(_(__s)); }
65*404b540aSrobert 
66*404b540aSrobert   void
__throw_domain_error(const char * __s)67*404b540aSrobert   __throw_domain_error(const char* __s)
68*404b540aSrobert   { throw domain_error(_(__s)); }
69*404b540aSrobert 
70*404b540aSrobert   void
__throw_invalid_argument(const char * __s)71*404b540aSrobert   __throw_invalid_argument(const char* __s)
72*404b540aSrobert   { throw invalid_argument(_(__s)); }
73*404b540aSrobert 
74*404b540aSrobert   void
__throw_length_error(const char * __s)75*404b540aSrobert   __throw_length_error(const char* __s)
76*404b540aSrobert   { throw length_error(_(__s)); }
77*404b540aSrobert 
78*404b540aSrobert   void
__throw_out_of_range(const char * __s)79*404b540aSrobert   __throw_out_of_range(const char* __s)
80*404b540aSrobert   { throw out_of_range(_(__s)); }
81*404b540aSrobert 
82*404b540aSrobert   void
__throw_runtime_error(const char * __s)83*404b540aSrobert   __throw_runtime_error(const char* __s)
84*404b540aSrobert   { throw runtime_error(_(__s)); }
85*404b540aSrobert 
86*404b540aSrobert   void
__throw_range_error(const char * __s)87*404b540aSrobert   __throw_range_error(const char* __s)
88*404b540aSrobert   { throw range_error(_(__s)); }
89*404b540aSrobert 
90*404b540aSrobert   void
__throw_overflow_error(const char * __s)91*404b540aSrobert   __throw_overflow_error(const char* __s)
92*404b540aSrobert   { throw overflow_error(_(__s)); }
93*404b540aSrobert 
94*404b540aSrobert   void
__throw_underflow_error(const char * __s)95*404b540aSrobert   __throw_underflow_error(const char* __s)
96*404b540aSrobert   { throw underflow_error(_(__s)); }
97*404b540aSrobert 
98*404b540aSrobert   void
__throw_ios_failure(const char * __s)99*404b540aSrobert   __throw_ios_failure(const char* __s)
100*404b540aSrobert   { throw ios_base::failure(_(__s)); }
101*404b540aSrobert #else
102*404b540aSrobert   void
103*404b540aSrobert   __throw_bad_exception(void)
104*404b540aSrobert   { std::abort(); }
105*404b540aSrobert 
106*404b540aSrobert   void
107*404b540aSrobert   __throw_bad_alloc(void)
108*404b540aSrobert   { std::abort(); }
109*404b540aSrobert 
110*404b540aSrobert   void
111*404b540aSrobert   __throw_bad_cast(void)
112*404b540aSrobert   { std::abort(); }
113*404b540aSrobert 
114*404b540aSrobert   void
115*404b540aSrobert   __throw_bad_typeid(void)
116*404b540aSrobert   { std::abort(); }
117*404b540aSrobert 
118*404b540aSrobert   void
119*404b540aSrobert   __throw_logic_error(const char*)
120*404b540aSrobert   { std::abort(); }
121*404b540aSrobert 
122*404b540aSrobert   void
123*404b540aSrobert   __throw_domain_error(const char*)
124*404b540aSrobert   { std::abort(); }
125*404b540aSrobert 
126*404b540aSrobert   void
127*404b540aSrobert   __throw_invalid_argument(const char*)
128*404b540aSrobert   { std::abort(); }
129*404b540aSrobert 
130*404b540aSrobert   void
131*404b540aSrobert   __throw_length_error(const char*)
132*404b540aSrobert   { std::abort(); }
133*404b540aSrobert 
134*404b540aSrobert   void
135*404b540aSrobert   __throw_out_of_range(const char*)
136*404b540aSrobert   { std::abort(); }
137*404b540aSrobert 
138*404b540aSrobert   void
139*404b540aSrobert   __throw_runtime_error(const char*)
140*404b540aSrobert   { std::abort(); }
141*404b540aSrobert 
142*404b540aSrobert   void
143*404b540aSrobert   __throw_range_error(const char*)
144*404b540aSrobert   { std::abort(); }
145*404b540aSrobert 
146*404b540aSrobert   void
147*404b540aSrobert   __throw_overflow_error(const char*)
148*404b540aSrobert   { std::abort(); }
149*404b540aSrobert 
150*404b540aSrobert   void
151*404b540aSrobert   __throw_underflow_error(const char*)
152*404b540aSrobert   { std::abort(); }
153*404b540aSrobert 
154*404b540aSrobert   void
155*404b540aSrobert   __throw_ios_failure(const char*)
156*404b540aSrobert   { std::abort(); }
157*404b540aSrobert #endif //__EXCEPTIONS
158*404b540aSrobert 
159*404b540aSrobert _GLIBCXX_END_NAMESPACE
160