1*e4b17023SJohn Marino // Copyright (C) 2001, 2002, 2003, 2005, 2009, 2010 2*e4b17023SJohn Marino // Free Software Foundation, Inc. 3*e4b17023SJohn Marino // 4*e4b17023SJohn Marino // This file is part of the GNU ISO C++ Library. This library is free 5*e4b17023SJohn Marino // software; you can redistribute it and/or modify it under the 6*e4b17023SJohn Marino // terms of the GNU General Public License as published by the 7*e4b17023SJohn Marino // Free Software Foundation; either version 3, or (at your option) 8*e4b17023SJohn Marino // any later version. 9*e4b17023SJohn Marino 10*e4b17023SJohn Marino // This library is distributed in the hope that it will be useful, 11*e4b17023SJohn Marino // but WITHOUT ANY WARRANTY; without even the implied warranty of 12*e4b17023SJohn Marino // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*e4b17023SJohn Marino // GNU General Public License for more details. 14*e4b17023SJohn Marino 15*e4b17023SJohn Marino // Under Section 7 of GPL version 3, you are granted additional 16*e4b17023SJohn Marino // permissions described in the GCC Runtime Library Exception, version 17*e4b17023SJohn Marino // 3.1, as published by the Free Software Foundation. 18*e4b17023SJohn Marino 19*e4b17023SJohn Marino // You should have received a copy of the GNU General Public License and 20*e4b17023SJohn Marino // a copy of the GCC Runtime Library Exception along with this program; 21*e4b17023SJohn Marino // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 22*e4b17023SJohn Marino // <http://www.gnu.org/licenses/>. 23*e4b17023SJohn Marino 24*e4b17023SJohn Marino #include <bits/functexcept.h> 25*e4b17023SJohn Marino #include <cstdlib> 26*e4b17023SJohn Marino #include <exception> 27*e4b17023SJohn Marino #include <stdexcept> 28*e4b17023SJohn Marino #include <new> 29*e4b17023SJohn Marino #include <typeinfo> 30*e4b17023SJohn Marino #include <ios> 31*e4b17023SJohn Marino #include <system_error> 32*e4b17023SJohn Marino #include <future> 33*e4b17023SJohn Marino #include <functional> 34*e4b17023SJohn Marino #include <regex> 35*e4b17023SJohn Marino 36*e4b17023SJohn Marino #ifdef _GLIBCXX_USE_NLS 37*e4b17023SJohn Marino # include <libintl.h> 38*e4b17023SJohn Marino # define _(msgid) gettext (msgid) 39*e4b17023SJohn Marino #else 40*e4b17023SJohn Marino # define _(msgid) (msgid) 41*e4b17023SJohn Marino #endif 42*e4b17023SJohn Marino 43*e4b17023SJohn Marino namespace std _GLIBCXX_VISIBILITY(default) 44*e4b17023SJohn Marino { 45*e4b17023SJohn Marino _GLIBCXX_BEGIN_NAMESPACE_VERSION 46*e4b17023SJohn Marino 47*e4b17023SJohn Marino #if __EXCEPTIONS 48*e4b17023SJohn Marino void __throw_bad_exception(void)49*e4b17023SJohn Marino __throw_bad_exception(void) 50*e4b17023SJohn Marino { throw bad_exception(); } 51*e4b17023SJohn Marino 52*e4b17023SJohn Marino void __throw_bad_alloc(void)53*e4b17023SJohn Marino __throw_bad_alloc(void) 54*e4b17023SJohn Marino { throw bad_alloc(); } 55*e4b17023SJohn Marino 56*e4b17023SJohn Marino void __throw_bad_cast(void)57*e4b17023SJohn Marino __throw_bad_cast(void) 58*e4b17023SJohn Marino { throw bad_cast(); } 59*e4b17023SJohn Marino 60*e4b17023SJohn Marino void __throw_bad_typeid(void)61*e4b17023SJohn Marino __throw_bad_typeid(void) 62*e4b17023SJohn Marino { throw bad_typeid(); } 63*e4b17023SJohn Marino 64*e4b17023SJohn Marino void __throw_logic_error(const char * __s)65*e4b17023SJohn Marino __throw_logic_error(const char* __s) 66*e4b17023SJohn Marino { throw logic_error(_(__s)); } 67*e4b17023SJohn Marino 68*e4b17023SJohn Marino void __throw_domain_error(const char * __s)69*e4b17023SJohn Marino __throw_domain_error(const char* __s) 70*e4b17023SJohn Marino { throw domain_error(_(__s)); } 71*e4b17023SJohn Marino 72*e4b17023SJohn Marino void __throw_invalid_argument(const char * __s)73*e4b17023SJohn Marino __throw_invalid_argument(const char* __s) 74*e4b17023SJohn Marino { throw invalid_argument(_(__s)); } 75*e4b17023SJohn Marino 76*e4b17023SJohn Marino void __throw_length_error(const char * __s)77*e4b17023SJohn Marino __throw_length_error(const char* __s) 78*e4b17023SJohn Marino { throw length_error(_(__s)); } 79*e4b17023SJohn Marino 80*e4b17023SJohn Marino void __throw_out_of_range(const char * __s)81*e4b17023SJohn Marino __throw_out_of_range(const char* __s) 82*e4b17023SJohn Marino { throw out_of_range(_(__s)); } 83*e4b17023SJohn Marino 84*e4b17023SJohn Marino void __throw_runtime_error(const char * __s)85*e4b17023SJohn Marino __throw_runtime_error(const char* __s) 86*e4b17023SJohn Marino { throw runtime_error(_(__s)); } 87*e4b17023SJohn Marino 88*e4b17023SJohn Marino void __throw_range_error(const char * __s)89*e4b17023SJohn Marino __throw_range_error(const char* __s) 90*e4b17023SJohn Marino { throw range_error(_(__s)); } 91*e4b17023SJohn Marino 92*e4b17023SJohn Marino void __throw_overflow_error(const char * __s)93*e4b17023SJohn Marino __throw_overflow_error(const char* __s) 94*e4b17023SJohn Marino { throw overflow_error(_(__s)); } 95*e4b17023SJohn Marino 96*e4b17023SJohn Marino void __throw_underflow_error(const char * __s)97*e4b17023SJohn Marino __throw_underflow_error(const char* __s) 98*e4b17023SJohn Marino { throw underflow_error(_(__s)); } 99*e4b17023SJohn Marino 100*e4b17023SJohn Marino void __throw_ios_failure(const char * __s)101*e4b17023SJohn Marino __throw_ios_failure(const char* __s) 102*e4b17023SJohn Marino { throw ios_base::failure(_(__s)); } 103*e4b17023SJohn Marino 104*e4b17023SJohn Marino void __throw_system_error(int __i)105*e4b17023SJohn Marino __throw_system_error(int __i) 106*e4b17023SJohn Marino { throw system_error(error_code(__i, generic_category())); } 107*e4b17023SJohn Marino 108*e4b17023SJohn Marino void __throw_future_error(int __i)109*e4b17023SJohn Marino __throw_future_error(int __i) 110*e4b17023SJohn Marino { throw future_error(make_error_code(future_errc(__i))); } 111*e4b17023SJohn Marino 112*e4b17023SJohn Marino void __throw_bad_function_call()113*e4b17023SJohn Marino __throw_bad_function_call() 114*e4b17023SJohn Marino { throw bad_function_call(); } 115*e4b17023SJohn Marino 116*e4b17023SJohn Marino void __throw_regex_error(regex_constants::error_type __ecode)117*e4b17023SJohn Marino __throw_regex_error(regex_constants::error_type __ecode) 118*e4b17023SJohn Marino { throw regex_error(__ecode); } 119*e4b17023SJohn Marino #else 120*e4b17023SJohn Marino void 121*e4b17023SJohn Marino __throw_bad_exception(void) 122*e4b17023SJohn Marino { std::abort(); } 123*e4b17023SJohn Marino 124*e4b17023SJohn Marino void 125*e4b17023SJohn Marino __throw_bad_alloc(void) 126*e4b17023SJohn Marino { std::abort(); } 127*e4b17023SJohn Marino 128*e4b17023SJohn Marino void 129*e4b17023SJohn Marino __throw_bad_cast(void) 130*e4b17023SJohn Marino { std::abort(); } 131*e4b17023SJohn Marino 132*e4b17023SJohn Marino void 133*e4b17023SJohn Marino __throw_bad_typeid(void) 134*e4b17023SJohn Marino { std::abort(); } 135*e4b17023SJohn Marino 136*e4b17023SJohn Marino void 137*e4b17023SJohn Marino __throw_logic_error(const char*) 138*e4b17023SJohn Marino { std::abort(); } 139*e4b17023SJohn Marino 140*e4b17023SJohn Marino void 141*e4b17023SJohn Marino __throw_domain_error(const char*) 142*e4b17023SJohn Marino { std::abort(); } 143*e4b17023SJohn Marino 144*e4b17023SJohn Marino void 145*e4b17023SJohn Marino __throw_invalid_argument(const char*) 146*e4b17023SJohn Marino { std::abort(); } 147*e4b17023SJohn Marino 148*e4b17023SJohn Marino void 149*e4b17023SJohn Marino __throw_length_error(const char*) 150*e4b17023SJohn Marino { std::abort(); } 151*e4b17023SJohn Marino 152*e4b17023SJohn Marino void 153*e4b17023SJohn Marino __throw_out_of_range(const char*) 154*e4b17023SJohn Marino { std::abort(); } 155*e4b17023SJohn Marino 156*e4b17023SJohn Marino void 157*e4b17023SJohn Marino __throw_runtime_error(const char*) 158*e4b17023SJohn Marino { std::abort(); } 159*e4b17023SJohn Marino 160*e4b17023SJohn Marino void 161*e4b17023SJohn Marino __throw_range_error(const char*) 162*e4b17023SJohn Marino { std::abort(); } 163*e4b17023SJohn Marino 164*e4b17023SJohn Marino void 165*e4b17023SJohn Marino __throw_overflow_error(const char*) 166*e4b17023SJohn Marino { std::abort(); } 167*e4b17023SJohn Marino 168*e4b17023SJohn Marino void 169*e4b17023SJohn Marino __throw_underflow_error(const char*) 170*e4b17023SJohn Marino { std::abort(); } 171*e4b17023SJohn Marino 172*e4b17023SJohn Marino void 173*e4b17023SJohn Marino __throw_ios_failure(const char*) 174*e4b17023SJohn Marino { std::abort(); } 175*e4b17023SJohn Marino 176*e4b17023SJohn Marino void 177*e4b17023SJohn Marino __throw_system_error(int) 178*e4b17023SJohn Marino { std::abort(); } 179*e4b17023SJohn Marino 180*e4b17023SJohn Marino void 181*e4b17023SJohn Marino __throw_future_error(int) 182*e4b17023SJohn Marino { std::abort(); } 183*e4b17023SJohn Marino 184*e4b17023SJohn Marino void 185*e4b17023SJohn Marino __throw_bad_function_call() 186*e4b17023SJohn Marino { std::abort(); } 187*e4b17023SJohn Marino 188*e4b17023SJohn Marino void 189*e4b17023SJohn Marino __throw_regex_error(regex_constants::error_type __ecode) 190*e4b17023SJohn Marino { std::abort(); } 191*e4b17023SJohn Marino #endif //__EXCEPTIONS 192*e4b17023SJohn Marino 193*e4b17023SJohn Marino _GLIBCXX_END_NAMESPACE_VERSION 194*e4b17023SJohn Marino } // namespace 195