OSDN Git Service

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