1 // Copyright (C) 2001-2013 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 3, 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 // Under Section 7 of GPL version 3, you are granted additional 15 // permissions described in the GCC Runtime Library Exception, version 16 // 3.1, as published by the Free Software Foundation. 17 18 // You should have received a copy of the GNU General Public License and 19 // a copy of the GCC Runtime Library Exception along with this program; 20 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 21 // <http://www.gnu.org/licenses/>. 22 23 #include <bits/functexcept.h> 24 #include <cstdlib> 25 #include <exception> 26 #include <stdexcept> 27 #include <new> 28 #include <typeinfo> 29 #include <ios> 30 #include <system_error> 31 #include <future> 32 #include <functional> 33 #include <regex> 34 35 #ifdef _GLIBCXX_USE_NLS 36 # include <libintl.h> 37 # define _(msgid) gettext (msgid) 38 #else 39 # define _(msgid) (msgid) 40 #endif 41 42 namespace std _GLIBCXX_VISIBILITY(default) 43 { 44 _GLIBCXX_BEGIN_NAMESPACE_VERSION 45 46 void __throw_bad_exception()47 __throw_bad_exception() 48 { _GLIBCXX_THROW_OR_ABORT(bad_exception()); } 49 50 void __throw_bad_alloc()51 __throw_bad_alloc() 52 { _GLIBCXX_THROW_OR_ABORT(bad_alloc()); } 53 54 void __throw_bad_cast()55 __throw_bad_cast() 56 { _GLIBCXX_THROW_OR_ABORT(bad_cast()); } 57 58 void __throw_bad_typeid()59 __throw_bad_typeid() 60 { _GLIBCXX_THROW_OR_ABORT(bad_typeid()); } 61 62 void __throw_logic_error(const char * __s)63 __throw_logic_error(const char* __s __attribute__((unused))) 64 { _GLIBCXX_THROW_OR_ABORT(logic_error(_(__s))); } 65 66 void __throw_domain_error(const char * __s)67 __throw_domain_error(const char* __s __attribute__((unused))) 68 { _GLIBCXX_THROW_OR_ABORT(domain_error(_(__s))); } 69 70 void __throw_invalid_argument(const char * __s)71 __throw_invalid_argument(const char* __s __attribute__((unused))) 72 { _GLIBCXX_THROW_OR_ABORT(invalid_argument(_(__s))); } 73 74 void __throw_length_error(const char * __s)75 __throw_length_error(const char* __s __attribute__((unused))) 76 { _GLIBCXX_THROW_OR_ABORT(length_error(_(__s))); } 77 78 void __throw_out_of_range(const char * __s)79 __throw_out_of_range(const char* __s __attribute__((unused))) 80 { _GLIBCXX_THROW_OR_ABORT(out_of_range(_(__s))); } 81 82 void __throw_runtime_error(const char * __s)83 __throw_runtime_error(const char* __s __attribute__((unused))) 84 { _GLIBCXX_THROW_OR_ABORT(runtime_error(_(__s))); } 85 86 void __throw_range_error(const char * __s)87 __throw_range_error(const char* __s __attribute__((unused))) 88 { _GLIBCXX_THROW_OR_ABORT(range_error(_(__s))); } 89 90 void __throw_overflow_error(const char * __s)91 __throw_overflow_error(const char* __s __attribute__((unused))) 92 { _GLIBCXX_THROW_OR_ABORT(overflow_error(_(__s))); } 93 94 void __throw_underflow_error(const char * __s)95 __throw_underflow_error(const char* __s __attribute__((unused))) 96 { _GLIBCXX_THROW_OR_ABORT(underflow_error(_(__s))); } 97 98 void __throw_ios_failure(const char * __s)99 __throw_ios_failure(const char* __s __attribute__((unused))) 100 { _GLIBCXX_THROW_OR_ABORT(ios_base::failure(_(__s))); } 101 102 void __throw_system_error(int __i)103 __throw_system_error(int __i __attribute__((unused))) 104 { _GLIBCXX_THROW_OR_ABORT(system_error(error_code(__i, 105 generic_category()))); } 106 107 void __throw_future_error(int __i)108 __throw_future_error(int __i __attribute__((unused))) 109 { _GLIBCXX_THROW_OR_ABORT(future_error(make_error_code(future_errc(__i)))); } 110 111 void __throw_bad_function_call()112 __throw_bad_function_call() 113 { _GLIBCXX_THROW_OR_ABORT(bad_function_call()); } 114 115 void __throw_regex_error(regex_constants::error_type __ecode)116 __throw_regex_error(regex_constants::error_type __ecode 117 __attribute__((unused))) 118 { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode)); } 119 120 _GLIBCXX_END_NAMESPACE_VERSION 121 } // namespace 122