This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] add -fno-exceptions support
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, jason at cygnus dot com
- Subject: [v3] add -fno-exceptions support
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Mon, 12 Feb 2001 15:48:11 -0800
This patch allows one to compile libstdc++-v3 with -fno-exceptions, if
so desired. This functionality was part of libstdc++-v2, and seems to
be a desired feature:
http://gcc.gnu.org/ml/libstdc++/2001-q1/msg00221.html
Here's an implementation of this. Adding this to the configure line
automatically does the correct things to the Makefiles:
--enable-cxx-flags='-fno-exceptions'
Seems pretty painless for the end-user.
Some of the previous piecemeal efforts have been removed
(include/bits/stl_range_errors and bits/exception_support.h), and
replaced by include/bits/functexcept.h and src/functexcept.cc. In
addition, stdexcept and stdexcept.cc have been cleaned up.
This is pretty much the maximum amount of uglification that I'd like
to see. I think this is acceptable.
I'm posting this for comments only: __EXCEPTIONS is still broken so I
can't really be sure that nothing breaks with this. This does compile
and link both -fno-exceptions and -fexceptions cases though, so it
should be ok.
-benjamin
2001-02-09 Benjamin Kosnik <bkoz@redhat.com>
Add support for -fno-exceptions.
* include/bits/exception_support.h: Remove.
* include/bits/basic_string.h: Remove exception_support.
(string::_M_check): Replace __OUTOFRANGE with __throw_out_of_range.
(string::at): Same.
(string::substr): Same.
* include/bits/basic_string.tcc (string::reserve): Replace
__LENGTHERROR with __throw_length_error.
(string::_S_create): Same.
(string::resize): Same.
(string::_M_replace): Same.
(string::replace): Same.
(string::copy): Replace __OUTOFRANGE with __throw_out_of_range.
(string::compare): Same.
* include/bits/stl_vector.h: Remove exception_support.
* src/Makefile.am (base_headers): Remove here.
* src/Makefile.in: Regenerate.
* include/bits/stl_range_errors.h: Remove.
* include/bits/stl_deque.h: Use __throw_range_error.
* include/bits/std_deque.h: Include functexcept.h.
* include/bits/std_vector.h: Same.
* src/Makefile.am (base_headers): Remove here.
* src/Makefile.in: Regenerate.
* include/bits/functexcept.h: New file.
* src/functexcept.cc: New file. Definitions for function-based
exception routines.
* src/Makefile.am (sources): Add functexcept.cc.
* src/Makefile.in: Regenerate.
* include/bits/stl_config.h (__STL_USE_EXCEPTIONS): Wrap with
__EXCEPTIONS.
* include/bits/localefwd.h: Include functexcept.h.
* include/bits/std_iosfwd.h: Same.
* include/bits/basic_ios.h: Use __throw_ios_failure instead of
throw basic_ios::failure.
* include/bits/fstream.tcc (filebuf::_M_allocate_buffers):
Use __throw_exception_again.
(filebuf::_M_filebuf_init): Same.
* include/bits/streambuf.tcc (__copy_streambufs): Same.
* include/bits/ostream.tcc (ostream::operator<<): Same.
* include/bits/istream.tcc (istream::operator>>): Same.
* include/bits/basic_string.tcc (string::_M_mutate): Same.
(string::_S_construct): Same.
(string::_M_clone): Same.
* include/bits/locale_facets.tcc (use_facet(const locale&)): Use
__throw_bad_cast.
(num_put<_CharT, _OutIter>::do_put): Use __throw_exception_again.
* src/localename.cc (locale::_Imp::_Imp(const _Impl&, size_t): Use
__throw_exception_again.
(locale::_Imp::_Imp(string, size_t): Same.
(locale::_Imp::_M_replace_facet): Use __throw_runtime_error.
* src/locale.cc (locale::_M_coalesce): Use __throw_exception_again.
(locale::locale(const char*)): Use __throw_runtime_error.
(locale::classic): Use __throw_exception_again.
(locale::_S_normalize_category): Use __throw_runtime_error.
* src/stdexcept.cc: Remove cruft.
* libsupc++/new_opnt.cc: Include functexcept.h.
* libsupc++/vec.cc: Same.
(__cxa_vec_new2): Use __throw_exception_again.
(__cxa_vec_new3): Same.
(__cxa_vec_ctor): Same.
(__cxa_vec_delete3): Same.
(__cxa_vec_cctor): Same.
(__cxa_vec_delete2): Same.
(__cxa_vec_dtor): Same.
* libsupc++/exception_support.cc: Include bits/functexcept.h. Only
compile exception-handling bits if __EXCEPTIONS is defined.
* libsupc++/new_op.cc (new): Include functexcept.h. Use
std::__throw_bad_alloc() instead of throw bad_alloc.
Index: include/bits/basic_ios.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/basic_ios.h,v
retrieving revision 1.1
diff -c -p -r1.1 basic_ios.h
*** basic_ios.h 2000/10/05 11:27:01 1.1
--- basic_ios.h 2001/02/12 23:26:01
***************
*** 1,6 ****
// Iostreams base classes -*- C++ -*-
! // Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
--- 1,6 ----
// Iostreams base classes -*- C++ -*-
! // Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
*************** namespace std {
*** 105,111 ****
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
! throw failure("basic_ios::clear(iostate) caused exception");
}
inline void
--- 105,111 ----
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
! __throw_ios_failure("basic_ios::clear(iostate) caused exception");
}
inline void
Index: include/bits/basic_string.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/basic_string.h,v
retrieving revision 1.4
diff -c -p -r1.4 basic_string.h
*** basic_string.h 2001/02/07 20:26:24 1.4
--- basic_string.h 2001/02/12 23:26:06
***************
*** 34,40 ****
#ifndef _CPP_BITS_STRING_H
#define _CPP_BITS_STRING_H 1
- #include <bits/exception_support.h>
#include <bits/atomicity.h>
namespace std {
--- 34,39 ----
*************** namespace std {
*** 261,267 ****
iterator
_M_check(size_type __pos) const
{
! __OUTOFRANGE(__pos > this->size());
return _M_ibegin() + __pos;
}
--- 260,267 ----
iterator
_M_check(size_type __pos) const
{
! if (__pos > this->size())
! __throw_out_of_range("basic_string::_M_check");
return _M_ibegin() + __pos;
}
*************** namespace std {
*** 432,445 ****
const_reference
at(size_type __n) const
{
! __OUTOFRANGE(__n >= this->size());
return _M_data()[__n];
}
reference
at(size_type __n)
{
! __OUTOFRANGE(__n >= size());
_M_leak();
return _M_data()[__n];
}
--- 432,447 ----
const_reference
at(size_type __n) const
{
! if (__n >= this->size())
! __throw_out_of_range("basic_string::at");
return _M_data()[__n];
}
reference
at(size_type __n)
{
! if (__n >= size())
! __throw_out_of_range("basic_string::at");
_M_leak();
return _M_data()[__n];
}
*************** namespace std {
*** 809,815 ****
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
! __OUTOFRANGE(__pos > this->size());
return basic_string(*this, __pos, __n);
}
--- 811,818 ----
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
! if (__pos > this->size())
! __throw_out_of_range("basic_string::substr");
return basic_string(*this, __pos, __n);
}
Index: include/bits/basic_string.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/basic_string.tcc,v
retrieving revision 1.2
diff -c -p -r1.2 basic_string.tcc
*** basic_string.tcc 2001/01/12 21:24:15 1.2
--- basic_string.tcc 2001/02/12 23:26:08
*************** namespace std
*** 87,130 ****
_Rep* __r = _Rep::_S_create(__i, __a);
traits_type::copy(__r->_M_refdata(), __buf, __i);
__r->_M_length = __i;
! try {
! // NB: this loop looks precisely this way because
! // it avoids comparing __beg != __end any more
! // than strictly necessary; != might be expensive!
! for (;;)
! {
! _CharT* __p = __r->_M_refdata() + __r->_M_length;
! _CharT* __last = __r->_M_refdata() + __r->_M_capacity;
! for (;;)
! {
! if (__beg == __end)
! {
! __r->_M_length = __p - __r->_M_refdata();
! *__p = _Rep::_S_terminal; // grrr.
! return __r->_M_refdata();
! }
! if (__p == __last)
! break;
! *__p++ = *__beg;
! ++__beg;
! }
! // Allocate more space.
! size_type __len = __p - __r->_M_refdata();
! _Rep* __another = _Rep::_S_create(__len + 1, __a);
! traits_type::copy(__another->_M_refdata(),
! __r->_M_refdata(), __len);
! __r->_M_destroy(__a);
! __r = __another;
! __r->_M_length = __len;
! }
! }
! catch (...) {
__r->_M_destroy(__a);
! throw;
! }
return 0;
}
!
template<typename _CharT, typename _Traits, typename _Alloc>
template <class _InIter>
_CharT*
--- 87,132 ----
_Rep* __r = _Rep::_S_create(__i, __a);
traits_type::copy(__r->_M_refdata(), __buf, __i);
__r->_M_length = __i;
! try
! {
! // NB: this loop looks precisely this way because
! // it avoids comparing __beg != __end any more
! // than strictly necessary; != might be expensive!
! for (;;)
! {
! _CharT* __p = __r->_M_refdata() + __r->_M_length;
! _CharT* __last = __r->_M_refdata() + __r->_M_capacity;
! for (;;)
! {
! if (__beg == __end)
! {
! __r->_M_length = __p - __r->_M_refdata();
! *__p = _Rep::_S_terminal; // grrr.
! return __r->_M_refdata();
! }
! if (__p == __last)
! break;
! *__p++ = *__beg;
! ++__beg;
! }
! // Allocate more space.
! size_type __len = __p - __r->_M_refdata();
! _Rep* __another = _Rep::_S_create(__len + 1, __a);
! traits_type::copy(__another->_M_refdata(),
! __r->_M_refdata(), __len);
! __r->_M_destroy(__a);
! __r = __another;
! __r->_M_length = __len;
! }
! }
! catch(...)
! {
__r->_M_destroy(__a);
! __throw_exception_again;
! }
return 0;
}
!
template<typename _CharT, typename _Traits, typename _Alloc>
template <class _InIter>
_CharT*
*************** namespace std
*** 139,151 ****
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, __a);
! try {
! _S_copy_chars(__r->_M_refdata(), __beg, __end);
! }
! catch (...) {
! __r->_M_destroy(__a);
! throw;
! }
__r->_M_length = __dnew;
__r->_M_refdata()[__dnew] = _Rep::_S_terminal; // grrr.
--- 141,153 ----
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, __a);
! try
! { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
! catch(...)
! {
! __r->_M_destroy(__a);
! __throw_exception_again;
! }
__r->_M_length = __dnew;
__r->_M_refdata()[__dnew] = _Rep::_S_terminal; // grrr.
*************** namespace std
*** 162,175 ****
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__n, __a);
! try {
! if (__n)
! traits_type::assign(__r->_M_refdata(), __n, __c);
! }
! catch (...) {
! __r->_M_destroy(__a);
! throw;
! }
__r->_M_length = __n;
__r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr
return __r->_M_refdata();
--- 164,179 ----
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__n, __a);
! try
! {
! if (__n)
! traits_type::assign(__r->_M_refdata(), __n, __c);
! }
! catch(...)
! {
! __r->_M_destroy(__a);
! __throw_exception_again;
! }
__r->_M_length = __n;
__r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr
return __r->_M_refdata();
*************** namespace std
*** 276,292 ****
// Must reallocate.
allocator_type __a = get_allocator();
_Rep* __r = _Rep::_S_create(__new_size, __a);
! try {
! if (__pos)
! traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
! if (__how_much)
! traits_type::copy(__r->_M_refdata() + __pos + __len2,
! __src, __how_much);
! }
! catch (...) {
! __r->_M_dispose(get_allocator());
! throw;
! }
_M_rep()->_M_dispose(__a);
_M_data(__r->_M_refdata());
}
--- 280,298 ----
// Must reallocate.
allocator_type __a = get_allocator();
_Rep* __r = _Rep::_S_create(__new_size, __a);
! try
! {
! if (__pos)
! traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
! if (__how_much)
! traits_type::copy(__r->_M_refdata() + __pos + __len2,
! __src, __how_much);
! }
! catch(...)
! {
! __r->_M_dispose(get_allocator());
! __throw_exception_again;
! }
_M_rep()->_M_dispose(__a);
_M_data(__r->_M_refdata());
}
*************** namespace std
*** 307,313 ****
{
if (__res > this->capacity() || _M_rep()->_M_is_shared())
{
! __LENGTHERROR(__res > this->max_size());
allocator_type __a = get_allocator();
_CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
_M_rep()->_M_dispose(__a);
--- 313,320 ----
{
if (__res > this->capacity() || _M_rep()->_M_is_shared())
{
! if (__res > this->max_size())
! __throw_length_error("basic_string::reserve");
allocator_type __a = get_allocator();
_CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
_M_rep()->_M_dispose(__a);
*************** namespace std
*** 351,363 ****
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_create(size_t __capacity, const _Alloc& __alloc)
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
! typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
! __LENGTHERROR(__capacity > _S_max_size);
#else
! __LENGTHERROR(__capacity == npos);
#endif
// NB: Need an array of char_type[__capacity], plus a
// terminating null char_type() element, plus enough for the
--- 358,371 ----
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_create(size_t __capacity, const _Alloc& __alloc)
{
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
! if (__capacity > _S_max_size)
#else
! if (__capacity == npos)
#endif
+ __throw_length_error("basic_string::_S_create");
// NB: Need an array of char_type[__capacity], plus a
// terminating null char_type() element, plus enough for the
*************** namespace std
*** 381,393 ****
_Rep* __r = _Rep::_S_create(_M_length + __res, __alloc);
if (_M_length)
{
! try {
! traits_type::copy(__r->_M_refdata(), _M_refdata(), _M_length);
! }
! catch (...) {
! __r->_M_destroy(__alloc);
! throw;
! }
}
__r->_M_length = _M_length;
return __r->_M_refdata();
--- 389,401 ----
_Rep* __r = _Rep::_S_create(_M_length + __res, __alloc);
if (_M_length)
{
! try
! { traits_type::copy(__r->_M_refdata(), _M_refdata(), _M_length); }
! catch(...)
! {
! __r->_M_destroy(__alloc);
! __throw_exception_again;
! }
}
__r->_M_length = _M_length;
return __r->_M_refdata();
*************** namespace std
*** 410,416 ****
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
{
! __LENGTHERROR(__n > max_size());
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
--- 418,425 ----
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
{
! if (__n > max_size())
! __throw_length_error("basic_string::resize");
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
*************** namespace std
*** 441,447 ****
size_type __dmax = this->max_size();
size_type __dnew = static_cast<size_type>(distance(__k1, __k2));
! __LENGTHERROR(__dmax <= __dnew);
size_type __off = __i1 - _M_ibegin();
_M_mutate(__off, __dold, __dnew);
// Invalidated __i1, __i2
--- 450,457 ----
size_type __dmax = this->max_size();
size_type __dnew = static_cast<size_type>(distance(__k1, __k2));
! if (__dmax <= __dnew)
! __throw_length_error("basic_string::_M_replace");
size_type __off = __i1 - _M_ibegin();
_M_mutate(__off, __dold, __dnew);
// Invalidated __i1, __i2
*************** namespace std
*** 551,557 ****
{
size_type __n1 = __i2 - __i1;
size_type __off1 = __i1 - _M_ibegin();
! __LENGTHERROR(max_size() - (this->size() - __n1) <= __n2);
_M_mutate (__off1, __n1, __n2);
// Invalidated __i1, __i2
if (__n2)
--- 561,568 ----
{
size_type __n1 = __i2 - __i1;
size_type __off1 = __i1 - _M_ibegin();
! if (max_size() - (this->size() - __n1) <= __n2)
! __throw_length_error("basic_string::replace");
_M_mutate (__off1, __n1, __n2);
// Invalidated __i1, __i2
if (__n2)
*************** namespace std
*** 564,570 ****
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
! __OUTOFRANGE(__pos > this->size());
if (__n > this->size() - __pos)
__n = this->size() - __pos;
--- 575,582 ----
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
! if (__pos > this->size())
! __throw_out_of_range("basic_string::copy");
if (__n > this->size() - __pos)
__n = this->size() - __pos;
*************** namespace std
*** 751,757 ****
{
size_type __size = this->size();
size_type __osize = __str.size();
! __OUTOFRANGE(__pos > __size);
size_type __rsize= min(__size - __pos, __n);
size_type __len = min(__rsize, __osize);
--- 763,770 ----
{
size_type __size = this->size();
size_type __osize = __str.size();
! if (__pos > __size)
! __throw_out_of_range("basic_string::compare");
size_type __rsize= min(__size - __pos, __n);
size_type __len = min(__rsize, __osize);
*************** namespace std
*** 769,776 ****
{
size_type __size = this->size();
size_type __osize = __str.size();
! __OUTOFRANGE(__pos1 > __size);
! __OUTOFRANGE(__pos2 > __osize);
size_type __rsize = min(__size - __pos1, __n1);
size_type __rosize = min(__osize - __pos2, __n2);
--- 782,789 ----
{
size_type __size = this->size();
size_type __osize = __str.size();
! if (__pos1 > __size || __pos2 > __osize)
! __throw_out_of_range("basic_string::compare");
size_type __rsize = min(__size - __pos1, __n1);
size_type __rosize = min(__osize - __pos2, __n2);
*************** namespace std
*** 803,809 ****
size_type __n2) const
{
size_type __size = this->size();
! __OUTOFRANGE(__pos > __size);
size_type __osize = min(traits_type::length(__s), __n2);
size_type __rsize = min(__size - __pos, __n1);
--- 816,823 ----
size_type __n2) const
{
size_type __size = this->size();
! if (__pos > __size)
! __throw_out_of_range("basic_string::compare");
size_type __osize = min(traits_type::length(__s), __n2);
size_type __rsize = min(__size - __pos, __n1);
Index: include/bits/fstream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/fstream.tcc,v
retrieving revision 1.4
diff -c -p -r1.4 fstream.tcc
*** fstream.tcc 2001/01/16 07:55:25 1.4
--- fstream.tcc 2001/02/12 23:26:09
*************** namespace std
*** 49,55 ****
catch(...)
{
delete _M_file;
! throw;
}
}
}
--- 49,55 ----
catch(...)
{
delete _M_file;
! __throw_exception_again;
}
}
}
*************** namespace std
*** 67,73 ****
catch(...)
{
delete [] _M_buf;
! throw;
}
// Allocate pback buffer.
--- 67,73 ----
catch(...)
{
delete [] _M_buf;
! __throw_exception_again;
}
// Allocate pback buffer.
*************** namespace std
*** 76,82 ****
catch(...)
{
delete [] _M_pback;
! throw;
}
}
}
--- 76,82 ----
catch(...)
{
delete [] _M_pback;
! __throw_exception_again;
}
}
}
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.5
diff -c -p -r1.5 istream.tcc
*** istream.tcc 2001/02/07 01:54:19 1.5
--- istream.tcc 2001/02/12 23:26:11
*************** namespace std {
*** 92,98 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 92,98 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 114,120 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 114,120 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 136,142 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 136,142 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 160,166 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 160,166 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 184,190 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 184,190 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 208,214 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 208,214 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 232,238 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 232,238 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 256,262 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 256,262 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 280,286 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 280,286 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 304,310 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 304,310 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 329,335 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 329,335 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 353,359 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 353,359 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 378,384 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 378,384 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 402,408 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 402,408 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 426,432 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 426,432 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 450,456 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 450,456 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 495,501 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __c;
--- 495,501 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __c;
*************** namespace std {
*** 527,533 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 527,533 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 568,574 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
*__s = char_type(NULL);
--- 568,574 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
*__s = char_type(NULL);
*************** namespace std {
*** 664,670 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
*__s = char_type(NULL);
--- 664,670 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
*__s = char_type(NULL);
*************** namespace std {
*** 708,714 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 708,714 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 732,738 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __c;
--- 732,738 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __c;
*************** namespace std {
*** 776,782 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
}
--- 776,782 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
}
*************** namespace std {
*** 813,819 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
}
--- 813,819 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
}
*************** namespace std {
*** 841,847 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
else
--- 841,847 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
else
*************** namespace std {
*** 869,875 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
else
--- 869,875 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
else
*************** namespace std {
*** 899,905 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __ret;
--- 899,905 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __ret;
*************** namespace std {
*** 923,929 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __ret;
--- 923,929 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __ret;
*************** namespace std {
*** 950,956 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 950,956 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 976,982 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 976,982 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 999,1005 ****
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
else
--- 999,1005 ----
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
else
*************** namespace std {
*** 1059,1065 ****
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
if (!__extracted)
--- 1059,1065 ----
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
if (!__extracted)
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.8
diff -c -p -r1.8 locale_facets.tcc
*** locale_facets.tcc 2001/02/07 01:54:19 1.8
--- locale_facets.tcc 2001/02/12 23:26:14
*************** namespace std
*** 75,81 ****
__vec_facet* __facet = __loc._M_impl->_M_facets;
const locale::facet* __fp = (*__facet)[__i];
if (__fp == 0 || __i >= __facet->size())
! throw bad_cast();
return static_cast<const _Facet&>(*__fp);
}
--- 75,81 ----
__vec_facet* __facet = __loc._M_impl->_M_facets;
const locale::facet* __fp = (*__facet)[__i];
if (__fp == 0 || __i >= __facet->size())
! __throw_bad_cast();
return static_cast<const _Facet&>(*__fp);
}
*************** namespace std
*** 1098,1104 ****
}
catch (...) {
__io.flags(__fmt);
! throw;
}
}
--- 1098,1104 ----
}
catch (...) {
__io.flags(__fmt);
! __throw_exception_again;
}
}
Index: include/bits/localefwd.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/localefwd.h,v
retrieving revision 1.11
diff -c -p -r1.11 localefwd.h
*** localefwd.h 2001/02/07 20:26:24 1.11
--- localefwd.h 2001/02/12 23:26:16
***************
*** 35,44 ****
#define _CPP_BITS_LOCCORE_H 1
#include <bits/c++config.h>
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
! #include <bits/c++locale.h> // Defines __c_locale.
namespace std
{
--- 35,45 ----
#define _CPP_BITS_LOCCORE_H 1
#include <bits/c++config.h>
+ #include <bits/c++locale.h> // Defines __c_locale.
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
! #include <bits/functexcept.h>
namespace std
{
Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.2
diff -c -p -r1.2 ostream.tcc
*** ostream.tcc 2001/02/07 01:54:19 1.2
--- ostream.tcc 2001/02/12 23:26:17
*************** namespace std {
*** 59,65 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 59,65 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 81,87 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 81,87 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 103,109 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 103,109 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 125,131 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 125,131 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 155,161 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 155,161 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 177,183 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 177,183 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 206,212 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 206,212 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 228,234 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 228,234 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 251,257 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 251,257 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 273,279 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 273,279 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 295,301 ****
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return *this;
--- 295,301 ----
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return *this;
*************** namespace std {
*** 512,518 ****
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __out;
--- 512,518 ----
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __out;
*************** namespace std {
*** 545,551 ****
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __out;
--- 545,551 ----
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __out;
*************** namespace std {
*** 577,583 ****
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __out;
--- 577,583 ----
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __out;
*************** namespace std {
*** 620,626 ****
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __out;
--- 620,626 ----
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __out;
*************** namespace std {
*** 653,659 ****
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! throw;
}
}
return __out;
--- 653,659 ----
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
}
}
return __out;
Index: include/bits/std_deque.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_deque.h,v
retrieving revision 1.1
diff -c -p -r1.1 std_deque.h
*** std_deque.h 2000/10/05 11:27:01 1.1
--- std_deque.h 2001/02/12 23:26:17
***************
*** 27,33 ****
#ifndef _CPP_DEQUE
#define _CPP_DEQUE 1
! #include <bits/stl_range_errors.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
--- 27,33 ----
#ifndef _CPP_DEQUE
#define _CPP_DEQUE 1
! #include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
Index: include/bits/std_iosfwd.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_iosfwd.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_iosfwd.h
*** std_iosfwd.h 2001/02/07 20:26:24 1.2
--- std_iosfwd.h 2001/02/12 23:26:17
***************
*** 1,6 ****
// Forwarding declarations -*- C++ -*-
! // Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
--- 1,6 ----
// Forwarding declarations -*- C++ -*-
! // Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
***************
*** 37,42 ****
--- 37,43 ----
#include <bits/c++config.h>
#include <bits/std_cwchar.h> // For mbstate_t
#include <bits/stringfwd.h> // For string forward declarations.
+ #include <bits/functexcept.h>
namespace std
{
Index: include/bits/std_vector.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_vector.h,v
retrieving revision 1.1
diff -c -p -r1.1 std_vector.h
*** std_vector.h 2000/10/05 11:27:01 1.1
--- std_vector.h 2001/02/12 23:26:17
***************
*** 27,33 ****
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
! #include <bits/stl_range_errors.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
--- 27,33 ----
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
! #include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
Index: include/bits/stl_config.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/stl_config.h,v
retrieving revision 1.3
diff -c -p -r1.3 stl_config.h
*** stl_config.h 2000/11/25 19:36:53 1.3
--- stl_config.h 2001/02/12 23:26:19
***************
*** 265,271 ****
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
! # define __STL_USE_EXCEPTIONS
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
# define __STL_USE_STD_ALLOCATORS
--- 265,273 ----
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
! # ifdef __EXCEPTIONS
! # define __STL_USE_EXCEPTIONS
! # endif
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
# define __STL_USE_STD_ALLOCATORS
Index: include/bits/stl_deque.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/stl_deque.h,v
retrieving revision 1.1
diff -c -p -r1.1 stl_deque.h
*** stl_deque.h 2000/10/05 11:27:01 1.1
--- stl_deque.h 2001/02/12 23:26:23
*************** public: // Basic
*** 499,505 ****
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
! __stl_throw_range_error("deque");
}
reference at(size_type __n)
--- 499,505 ----
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
! __throw_range_error("deque");
}
reference at(size_type __n)
Index: include/bits/stl_vector.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/stl_vector.h,v
retrieving revision 1.1
diff -c -p -r1.1 stl_vector.h
*** stl_vector.h 2000/10/05 11:27:01 1.1
--- stl_vector.h 2001/02/12 23:26:25
***************
*** 31,37 ****
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
! #include <bits/exception_support.h>
#include <bits/concept_checks.h>
--- 31,37 ----
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
! #include <bits/functexcept.h>
#include <bits/concept_checks.h>
Index: include/bits/streambuf.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/streambuf.tcc,v
retrieving revision 1.3
diff -c -p -r1.3 streambuf.tcc
*** streambuf.tcc 2001/02/07 01:54:19 1.3
--- streambuf.tcc 2001/02/12 23:26:26
*************** namespace std {
*** 215,221 ****
}
catch(exception& __fail) {
if ((__ios.exceptions() & ios_base::failbit) != 0)
! throw;
}
return __ret;
}
--- 215,221 ----
}
catch(exception& __fail) {
if ((__ios.exceptions() & ios_base::failbit) != 0)
! __throw_exception_again;
}
return __ret;
}
Index: libsupc++/exception_support.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/exception_support.cc,v
retrieving revision 1.8
diff -c -p -r1.8 exception_support.cc
*** exception_support.cc 2001/01/24 03:04:36 1.8
--- exception_support.cc 2001/02/12 23:26:27
***************
*** 35,40 ****
--- 35,41 ----
#include "exception"
#include <cstddef>
#include "exception_support.h"
+ #include <bits/functexcept.h>
/* Define terminate, unexpected, set_terminate, set_unexpected as
well as the default terminate func and default unexpected func. */
*************** std::unexpected ()
*** 83,100 ****
}
/* Language-specific EH info pointer, defined in libgcc2. */
-
extern "C" cp_eh_info **__get_eh_info (); // actually void **
/* Exception allocate and free, defined in libgcc2. */
extern "C" void *__eh_alloc(std::size_t);
extern "C" void __eh_free(void *);
/* Is P the type_info node for a pointer of some kind? */
-
extern bool __is_pointer (void *);
/* OLD Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). This fudges the actualy returned value to
point to the beginning of what USE to be the cp_eh_info structure.
--- 84,101 ----
}
/* Language-specific EH info pointer, defined in libgcc2. */
extern "C" cp_eh_info **__get_eh_info (); // actually void **
+ #define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
/* Exception allocate and free, defined in libgcc2. */
extern "C" void *__eh_alloc(std::size_t);
extern "C" void __eh_free(void *);
/* Is P the type_info node for a pointer of some kind? */
extern bool __is_pointer (void *);
+ #ifdef __EXCEPTIONS
/* OLD Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). This fudges the actualy returned value to
point to the beginning of what USE to be the cp_eh_info structure.
*************** __cp_exception_info (void)
*** 106,113 ****
return &((*__get_eh_info ())->value);
}
- #define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
-
/* Old Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). */
--- 107,112 ----
*************** __check_null_eh_spec (void)
*** 348,353 ****
--- 347,353 ----
{
__check_eh_spec (0, 0);
}
+ #endif //__EXCEPTIONS
// Helpers for rtti. Although these don't return, we give them return types so
// that the type system is not broken.
*************** __check_null_eh_spec (void)
*** 363,381 ****
extern "C" void *
THROW_BAD_CAST ()
{
! throw std::bad_cast ();
return 0;
}
extern "C" std::type_info const &
THROW_BAD_TYPEID ()
{
! throw std::bad_typeid ();
return typeid (void);
}
/* Has the current exception been caught? */
-
bool
std::uncaught_exception () throw()
{
--- 363,380 ----
extern "C" void *
THROW_BAD_CAST ()
{
! std::__throw_bad_cast();
return 0;
}
extern "C" std::type_info const &
THROW_BAD_TYPEID ()
{
! std::__throw_bad_typeid();
return typeid (void);
}
/* Has the current exception been caught? */
bool
std::uncaught_exception () throw()
{
*************** what () const throw()
*** 389,391 ****
--- 388,398 ----
{
return typeid (*this).name ();
}
Index: libsupc++/new_op.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/new_op.cc,v
retrieving revision 1.2
diff -c -p -r1.2 new_op.cc
*** new_op.cc 2000/10/21 16:50:28 1.2
--- new_op.cc 2001/02/12 23:26:28
***************
*** 1,5 ****
// Support routines for the -*- C++ -*- dynamic memory management.
! // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
//
--- 1,5 ----
// Support routines for the -*- C++ -*- dynamic memory management.
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
***************
*** 28,35 ****
// the GNU General Public License.
#include "new"
using std::new_handler;
- using std::bad_alloc;
extern "C" void *malloc (std::size_t);
extern new_handler __new_handler;
--- 28,36 ----
// the GNU General Public License.
#include "new"
+ #include <bits/functexcept.h>
+
using std::new_handler;
extern "C" void *malloc (std::size_t);
extern new_handler __new_handler;
*************** operator new (std::size_t sz) throw (std
*** 47,56 ****
{
new_handler handler = __new_handler;
if (! handler)
! throw bad_alloc ();
handler ();
p = (void *) malloc (sz);
}
return p;
}
--- 48,60 ----
{
new_handler handler = __new_handler;
if (! handler)
! std::__throw_bad_alloc();
handler ();
p = (void *) malloc (sz);
}
return p;
}
+
+
+
Index: libsupc++/new_opnt.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/new_opnt.cc,v
retrieving revision 1.2
diff -c -p -r1.2 new_opnt.cc
*** new_opnt.cc 2000/10/21 16:50:28 1.2
--- new_opnt.cc 2001/02/12 23:26:28
***************
*** 1,5 ****
// Support routines for the -*- C++ -*- dynamic memory management.
! // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
//
--- 1,6 ----
// Support routines for the -*- C++ -*- dynamic memory management.
!
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
***************
*** 28,33 ****
--- 29,36 ----
// the GNU General Public License.
#include "new"
+ #include <bits/functexcept.h>
+
using std::new_handler;
using std::bad_alloc;
Index: libsupc++/vec.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/vec.cc,v
retrieving revision 1.3
diff -c -p -r1.3 vec.cc
*** vec.cc 2000/11/19 02:22:53 1.3
--- vec.cc 2001/02/12 23:26:29
***************
*** 1,8 ****
// new abi support -*- C++ -*-
! // Copyright (C) 2000
! // Free Software Foundation, Inc.
! // Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
--- 1,9 ----
// new abi support -*- C++ -*-
!
! // Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
+ // This file is part of GNU CC.
+ //
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
***************
*** 27,50 ****
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
#include <cxxabi.h>
#include <new>
#include <exception>
#include "exception_support.h"
namespace __cxxabiv1
{
!
! namespace
! {
! struct uncatch_exception {
! uncatch_exception () { p = __uncatch_exception (); }
! ~uncatch_exception () { __recatch_exception (p); }
!
! cp_eh_info *p;
! };
}
/* allocate and construct array */
--- 28,53 ----
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+ // Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
+
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
#include <cxxabi.h>
#include <new>
#include <exception>
+ #include <bits/functexcept.h>
#include "exception_support.h"
namespace __cxxabiv1
{
! namespace
! {
! struct uncatch_exception
! {
! uncatch_exception () { p = __uncatch_exception (); }
! ~uncatch_exception () { __recatch_exception (p); }
! cp_eh_info *p;
! };
}
/* allocate and construct array */
*************** __cxa_vec_new2 (std::size_t element_coun
*** 88,94 ****
uncatch_exception ue;
dealloc (base - padding_size);
}
! throw;
}
return base;
}
--- 91,97 ----
uncatch_exception ue;
dealloc (base - padding_size);
}
! __throw_exception_again;
}
return base;
}
*************** __cxa_vec_new3 (std::size_t element_coun
*** 121,127 ****
uncatch_exception ue;
dealloc (base - padding_size, size);
}
! throw;
}
return base;
}
--- 124,130 ----
uncatch_exception ue;
dealloc (base - padding_size, size);
}
! __throw_exception_again;
}
return base;
}
*************** __cxa_vec_ctor (void *array_address,
*** 149,155 ****
uncatch_exception ue;
__cxa_vec_dtor (array_address, ix, element_size, destructor);
}
! throw;
}
}
--- 152,158 ----
uncatch_exception ue;
__cxa_vec_dtor (array_address, ix, element_size, destructor);
}
! __throw_exception_again;
}
}
*************** __cxa_vec_cctor (void *dest_array,
*** 180,186 ****
uncatch_exception ue;
__cxa_vec_dtor (dest_array, ix, element_size, destructor);
}
! throw;
}
}
--- 183,189 ----
uncatch_exception ue;
__cxa_vec_dtor (dest_array, ix, element_size, destructor);
}
! __throw_exception_again;
}
}
*************** __cxa_vec_dtor (void *array_address,
*** 218,224 ****
__cxa_vec_dtor (array_address, ix, element_size,
destructor);
}
! throw;
}
}
}
--- 221,227 ----
__cxa_vec_dtor (array_address, ix, element_size,
destructor);
}
! __throw_exception_again;
}
}
}
*************** __cxa_vec_delete2 (void *array_address,
*** 259,265 ****
uncatch_exception ue;
dealloc (base);
}
! throw;
}
}
dealloc (base);
--- 262,268 ----
uncatch_exception ue;
dealloc (base);
}
! __throw_exception_again;
}
}
dealloc (base);
*************** __cxa_vec_delete3 (void *array_address,
*** 291,297 ****
uncatch_exception ue;
dealloc (base, size);
}
! throw;
}
}
dealloc (base, size);
--- 294,300 ----
uncatch_exception ue;
dealloc (base, size);
}
! __throw_exception_again;
}
}
dealloc (base, size);
*************** __cxa_vec_delete3 (void *array_address,
*** 300,302 ****
--- 303,314 ----
} // namespace __cxxabiv1
#endif // defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.71
diff -c -p -r1.71 Makefile.am
*** Makefile.am 2001/02/07 20:26:24 1.71
--- Makefile.am 2001/02/12 23:26:30
*************** base_headers = \
*** 73,79 ****
bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
- bits/exception_support.h \
bits/std_fstream.h bits/std_iomanip.h \
bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
--- 73,78 ----
*************** base_headers = \
*** 97,103 ****
bits/stl_relops.h bits/stl_set.h \
bits/stl_stack.h bits/stl_tempbuf.h \
bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
! bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
bits/concept_checks.h bits/container_concepts.h \
bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
--- 96,102 ----
bits/stl_relops.h bits/stl_set.h \
bits/stl_stack.h bits/stl_tempbuf.h \
bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
! bits/type_traits.h bits/std_algorithm.h \
bits/concept_checks.h bits/container_concepts.h \
bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
*************** build_headers = \
*** 166,175 ****
sources = \
limitsMEMBERS.cc \
! complex_io.cc \
! stdexcept.cc bitset.cc \
globals.cc \
! c++io.cc ios.cc strstream.cc \
c++locale.cc locale.cc localename.cc codecvt.cc \
locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
--- 165,173 ----
sources = \
limitsMEMBERS.cc \
! stdexcept.cc functexcept.cc bitset.cc \
globals.cc \
! c++io.cc ios.cc complex_io.cc strstream.cc \
c++locale.cc locale.cc localename.cc codecvt.cc \
locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
Index: src/complex_io.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/complex_io.cc,v
retrieving revision 1.3
diff -c -p -r1.3 complex_io.cc
*** complex_io.cc 2000/10/31 01:26:06 1.3
--- complex_io.cc 2001/02/12 23:26:32
*************** namespace std
*** 90,152 ****
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream< char, char_traits<char> >&,
! complex<float>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream< char, char_traits<char> >&,
! const complex<float>&);
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream< char, char_traits<char> >&,
! complex<double>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream< char, char_traits<char> >&,
! const complex<double>&);
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream< char, char_traits<char> >&,
! complex<long double>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream< char, char_traits<char> >&,
const complex<long double>&);
#ifdef _GLIBCPP_USE_WCHAR_T
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
complex<float>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
const complex<float>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
complex<double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
const complex<double>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
complex<long double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
const complex<long double>&);
#endif //_GLIBCPP_USE_WCHAR_T
}
--- 90,150 ----
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream<char, char_traits<char> >&, complex<float>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream<char, char_traits<char> >&,
! const complex<float>&);
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream<char, char_traits<char> >&, complex<double>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream<char, char_traits<char> >&,
! const complex<double>&);
template
basic_istream<char, char_traits<char> >&
! operator>>(basic_istream<char, char_traits<char> >&,
! complex<long double>&);
template
basic_ostream<char, char_traits<char> >&
! operator<<(basic_ostream<char, char_traits<char> >&,
const complex<long double>&);
#ifdef _GLIBCPP_USE_WCHAR_T
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<float>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<float>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<double>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
! operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<long double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
! operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<long double>&);
#endif //_GLIBCPP_USE_WCHAR_T
}
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/locale.cc,v
retrieving revision 1.28
diff -c -p -r1.28 locale.cc
*** locale.cc 2001/02/12 09:06:39 1.28
--- locale.cc 2001/02/12 23:26:35
*************** namespace std
*** 349,355 ****
catch (...)
{
_M_impl->_M_remove_reference();
! throw;
}
}
--- 349,355 ----
catch (...)
{
_M_impl->_M_remove_reference();
! __throw_exception_again;
}
}
*************** namespace std
*** 376,382 ****
_M_impl = new _Impl(__s, 1);
}
else
! throw runtime_error("attempt to create locale from NULL name");
}
locale::locale(const locale& __base, const char* __s, category __cat)
--- 376,382 ----
_M_impl = new _Impl(__s, 1);
}
else
! __throw_runtime_error("attempt to create locale from NULL name");
}
locale::locale(const locale& __base, const char* __s, category __cat)
*************** namespace std
*** 468,474 ****
}
_S_classic = _S_global = 0;
// XXX MT
! throw;
}
}
return *__classic_locale;
--- 468,474 ----
}
_S_classic = _S_global = 0;
// XXX MT
! __throw_exception_again;
}
}
return *__classic_locale;
*************** namespace std
*** 509,515 ****
__ret = all;
break;
default:
! throw runtime_error("bad locale category");
}
}
return __ret;
--- 509,515 ----
__ret = all;
break;
default:
! __throw_runtime_error("bad locale category");
}
}
return __ret;
Index: src/localename.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/localename.cc,v
retrieving revision 1.12
diff -c -p -r1.12 localename.cc
*** localename.cc 2001/01/30 09:18:51 1.12
--- localename.cc 2001/02/12 23:26:35
*************** namespace std {
*** 53,59 ****
catch(...)
{
delete _M_facets;
! throw;
}
for (size_t i = 0; i < _S_num_categories; ++i)
--- 53,59 ----
catch(...)
{
delete _M_facets;
! __throw_exception_again;
}
for (size_t i = 0; i < _S_num_categories; ++i)
*************** namespace std {
*** 83,89 ****
catch(...)
{
delete _M_facets;
! throw;
}
// Name all the categories.
--- 83,89 ----
catch(...)
{
delete _M_facets;
! __throw_exception_again;
}
// Name all the categories.
*************** namespace std {
*** 159,165 ****
if (__index == 0
|| __imp->_M_facets->size() <= __index
|| (*(__imp->_M_facets))[__index] == 0)
! throw runtime_error("no locale facet");
_M_install_facet(__idp, (*(__imp->_M_facets))[__index]);
}
--- 159,165 ----
if (__index == 0
|| __imp->_M_facets->size() <= __index
|| (*(__imp->_M_facets))[__index] == 0)
! __throw_runtime_error("no locale facet");
_M_install_facet(__idp, (*(__imp->_M_facets))[__index]);
}
Index: src/stdexcept.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/stdexcept.cc,v
retrieving revision 1.2
diff -c -p -r1.2 stdexcept.cc
*** stdexcept.cc 2001/02/07 20:26:24 1.2
--- stdexcept.cc 2001/02/12 23:26:35
***************
*** 33,41 ****
#include <bits/std_string.h>
#include <bits/std_stdexcept.h>
- #if 1
- #include <bits/stl_range_errors.h>
- #endif
namespace std
{
--- 33,38 ----
*************** namespace std
*** 77,103 ****
underflow_error::underflow_error(const string& __arg)
: runtime_error(__arg) { }
-
- #if 1
- // XXX need to deal with this.
- void
- __out_of_range(const char *str)
- { throw out_of_range(str); }
-
- void
- __length_error(const char *str)
- { throw length_error(str); }
-
- // XXX: From stl_range_errors.h, eventually these approaches need to
- // be merged.
- void
- __stl_throw_range_error(const char* __msg)
- { throw range_error(__msg); }
-
- void
- __stl_throw_length_error(const char* __msg)
- { throw length_error(__msg); }
- #endif
} // namespace std
--- 74,79 ----
Index: include/bits/functexcept.h
===================================================================
RCS file: functexcept.h
diff -N functexcept.h
*** /dev/null Tue May 5 13:32:27 1998
--- functexcept.h Mon Feb 12 15:32:04 2001
***************
*** 0 ****
--- 1,99 ----
+ // Function-Based Exception Support -*- C++ -*-
+
+ // Copyright (C) 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+
+ // This library is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ //
+ // ISO C++ 14882: 19.1 Exception classes
+ //
+
+ #ifndef __EXCEPTIONS
+ // Iff -fno-exceptions, transform error handling code to work without it.
+ # define try if (true)
+ # define catch(X) if (false)
+ # define __throw_exception_again
+ #else
+ // Else proceed normally.
+ # define __throw_exception_again throw
+ #endif
+
+ namespace std
+ {
+ // Helper for exception objects in <except>
+ void
+ __throw_bad_exception(void);
+
+ // Helper for exception objects in <new>
+ void
+ __throw_bad_alloc(void);
+
+ // Helper for exception objects in <typeinfo>
+ void
+ __throw_bad_cast(void);
+
+ void
+ __throw_bad_typeid(void);
+
+ // Helpers for exception objects in <stdexcept>
+ void
+ __throw_logic_error(const char* __s);
+
+ void
+ __throw_domain_error(const char* __s);
+
+ void
+ __throw_invalid_argument(const char* __s);
+
+ void
+ __throw_length_error(const char* __s);
+
+ void
+ __throw_out_of_range(const char* __s);
+
+ void
+ __throw_runtime_error(const char* __s);
+
+ void
+ __throw_range_error(const char* __s);
+
+ void
+ __throw_overflow_error(const char* __s);
+
+ void
+ __throw_underflow_error(const char* __s);
+
+ // Helpers for exception objects in basic_ios
+ void
+ __throw_ios_failure(const char* __s);
+ } // namespace std
Index: src/functexcept.cc
===================================================================
RCS file: functexcept.cc
diff -N functexcept.cc
*** /dev/null Tue May 5 13:32:27 1998
--- functexcept.cc Mon Feb 12 15:32:04 2001
***************
*** 0 ****
--- 1,153 ----
+ // Copyright (C) 2001 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+
+ // This library is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ // GNU General Public License for more details.
+
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING. If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction. Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License. This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
+ #include <bits/functexcept.h>
+ #include <cstdlib>
+ #include <exception>
+ #include <new>
+ #include <typeinfo>
+ #include <stdexcept>
+ #include <ios>
+ #include <string>
+
+
+ namespace std
+ {
+ #if __EXCEPTIONS
+ void
+ __throw_bad_exception(void)
+ { throw bad_exception(); }
+
+ void
+ __throw_bad_alloc(void)
+ { throw bad_alloc(); }
+
+ void
+ __throw_bad_cast(void)
+ { throw bad_cast(); }
+
+ void
+ __throw_bad_typeid(void)
+ { throw bad_typeid(); }
+
+ void
+ __throw_logic_error(const char* __s)
+ { throw logic_error(__s); }
+
+ void
+ __throw_domain_error(const char* __s)
+ { throw domain_error(__s); }
+
+ void
+ __throw_invalid_argument(const char* __s)
+ { throw invalid_argument(__s); }
+
+ void
+ __throw_length_error(const char* __s)
+ { throw length_error(__s); }
+
+ void
+ __throw_out_of_range(const char* __s)
+ { throw out_of_range(__s); }
+
+ void
+ __throw_runtime_error(const char* __s)
+ { throw runtime_error(__s); }
+
+ void
+ __throw_range_error(const char* __s)
+ { throw range_error(__s); }
+
+ void
+ __throw_overflow_error(const char* __s)
+ { throw overflow_error(__s); }
+
+ void
+ __throw_underflow_error(const char* __s)
+ { throw underflow_error(__s); }
+
+ void
+ __throw_ios_failure(const char* __s)
+ { throw ios_failure(__s); }
+ #else
+ void
+ __throw_bad_exception(void)
+ { abort(); }
+
+ void
+ __throw_bad_alloc(void)
+ { abort(); }
+
+ void
+ __throw_bad_cast(void)
+ { abort(); }
+
+ void
+ __throw_bad_typeid(void)
+ { abort(); }
+
+ void
+ __throw_logic_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_domain_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_invalid_argument(const char* __s)
+ { abort(); }
+
+ void
+ __throw_length_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_out_of_range(const char* __s)
+ { abort(); }
+
+ void
+ __throw_runtime_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_range_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_overflow_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_underflow_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_ios_failure(const char* __s)
+ { abort(); }
+ #endif //__EXCEPTIONS
+ }