# functexcept.cc

    00001 // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
    00002 //
    00003 // This file is part of the GNU ISO C++ Library.  This library is free
    00004 // software; you can redistribute it and/or modify it under the
    00005 // terms of the GNU General Public License as published by the
    00006 // Free Software Foundation; either version 2, or (at your option)
    00007 // any later version.
    00008
    00009 // This library is distributed in the hope that it will be useful,
    00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012 // GNU General Public License for more details.
    00013
    00014 // You should have received a copy of the GNU General Public License along
    00015 // with this library; see the file COPYING.  If not, write to the Free
    00016 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    00017 // USA.
    00018
    00019 // As a special exception, you may use this file as part of a free software
    00020 // library without restriction.  Specifically, if other files instantiate
    00021 // templates or use macros or inline functions from this file, or you compile
    00022 // this file and link it with other files to produce an executable, this
    00023 // file does not by itself cause the resulting executable to be covered by
    00024 // the GNU General Public License.  This exception does not however
    00025 // invalidate any other reasons why the executable file might be covered by
    00026 // the GNU General Public License.
    00027
    00028 #include <bits/functexcept.h>
    00029 #include <cstdlib>
    00030 #include <exception>
    00031 #include <stdexcept>
    00032 #include <new>
    00033 #include <typeinfo>
    00034 #include <ios>
    00035
    00036 namespace std
    00037 {
    00038 #if __EXCEPTIONS
    00039   void
    00040   __throw_bad_exception(void)
    00041   { throw bad_exception(); }
    00042
    00043   void
    00044   __throw_bad_alloc(void)
    00045   { throw bad_alloc(); }
    00046
    00047   void
    00048   __throw_bad_cast(void)
    00049   { throw bad_cast(); }
    00050
    00051   void
    00052   __throw_bad_typeid(void)
    00053   { throw bad_typeid(); }
    00054
    00055   void
    00056   __throw_logic_error(const char* __s)
    00057   { throw logic_error(__s); }
    00058
    00059   void
    00060   __throw_domain_error(const char* __s)
    00061   { throw domain_error(__s); }
    00062
    00063   void
    00064   __throw_invalid_argument(const char* __s)
    00065   { throw invalid_argument(__s); }
    00066
    00067   void
    00068   __throw_length_error(const char* __s)
    00069   { throw length_error(__s); }
    00070
    00071   void
    00072   __throw_out_of_range(const char* __s)
    00073   { throw out_of_range(__s); }
    00074
    00075   void
    00076   __throw_runtime_error(const char* __s)
    00077   { throw runtime_error(__s); }
    00078
    00079   void
    00080   __throw_range_error(const char* __s)
    00081   { throw range_error(__s); }
    00082
    00083   void
    00084   __throw_overflow_error(const char* __s)
    00085   { throw overflow_error(__s); }
    00086
    00087   void
    00088   __throw_underflow_error(const char* __s)
    00089   { throw underflow_error(__s); }
    00090
    00091   void
    00092   __throw_ios_failure(const char* __s)
    00093   { throw ios_base::failure(__s); }
    00094 #else
    00095   void
    00096   __throw_bad_exception(void)
    00097   { abort(); }
    00098
    00099   void
    00100   __throw_bad_alloc(void)
    00101   { abort(); }
    00102
    00103   void
    00104   __throw_bad_cast(void)
    00105   { abort(); }
    00106
    00107   void
    00108   __throw_bad_typeid(void)
    00109   { abort(); }
    00110
    00111   void
    00112   __throw_logic_error(const char*)
    00113   { abort(); }
    00114
    00115   void
    00116   __throw_domain_error(const char*)
    00117   { abort(); }
    00118
    00119   void
    00120   __throw_invalid_argument(const char*)
    00121   { abort(); }
    00122
    00123   void
    00124   __throw_length_error(const char*)
    00125   { abort(); }
    00126
    00127   void
    00128   __throw_out_of_range(const char*)
    00129   { abort(); }
    00130
    00131   void
    00132   __throw_runtime_error(const char*)
    00133   { abort(); }
    00134
    00135   void
    00136   __throw_range_error(const char*)
    00137   { abort(); }
    00138
    00139   void
    00140   __throw_overflow_error(const char*)
    00141   { abort(); }
    00142
    00143   void
    00144   __throw_underflow_error(const char*)
    00145   { abort(); }
    00146
    00147   void
    00148   __throw_ios_failure(const char*)
    00149   { abort(); }
    00150 #endif //__EXCEPTIONS
    00151 }