Add support for -fno-exceptions.

2001-02-15  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/ext/stl_bvector.h (class __BVECTOR): Use __throw_range_error.
	* include/ext/bvector: Remove stl_range_errors.h

	* include/bits/c++config (_GLIBCPP_USE_EXCEPTIONS): Remove.

	* 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++/exception_defines.h: New file.
	* libsupc++/new_opnt.cc: Include exception_defines.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 exception_defines.h. Only
	compile exception-handling bits if __EXCEPTIONS is defined.
	Remove old ABI support.
	* libsupc++/new_op.cc (new): Include exception_defines.h. Use
	std::__throw_bad_alloc() instead of throw bad_alloc.
	* libsupc++/Makefile.am: Add exception_defines.h.
	* libsupc++/Makefile.in: Reformat.
	* libsupc++/*: Format.

From-SVN: r39730
This commit is contained in:
Benjamin Kosnik 2001-02-16 00:44:44 +00:00 committed by Benjamin Kosnik
parent 777c951742
commit e2c094827c
51 changed files with 1651 additions and 1455 deletions

View File

@ -1,3 +1,90 @@
2001-02-15 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/ext/stl_bvector.h (class __BVECTOR): Use __throw_range_error.
* include/ext/bvector: Remove stl_range_errors.h
* include/bits/c++config (_GLIBCPP_USE_EXCEPTIONS): Remove.
* 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++/exception_defines.h: New file.
* libsupc++/new_opnt.cc: Include exception_defines.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 exception_defines.h. Only
compile exception-handling bits if __EXCEPTIONS is defined.
Remove old ABI support.
* libsupc++/new_op.cc (new): Include exception_defines.h. Use
std::__throw_bad_alloc() instead of throw bad_alloc.
* libsupc++/Makefile.am: Add exception_defines.h.
* libsupc++/Makefile.in: Reformat.
* libsupc++/*: Format.
2001-02-15 Phil Edwards <pme@sources.redhat.com>
* docs/html/configopts.html: Minor updates and typo fixes.

1619
libstdc++-v3/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Iostreams base classes -*- C++ -*-
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
// 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
@ -105,7 +105,7 @@ namespace std {
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
throw failure("basic_ios::clear(iostate) caused exception");
__throw_ios_failure("basic_ios::clear(iostate) caused exception");
}
inline void

View File

@ -34,7 +34,6 @@
#ifndef _CPP_BITS_STRING_H
#define _CPP_BITS_STRING_H 1
#include <bits/exception_support.h>
#include <bits/atomicity.h>
namespace std {
@ -261,7 +260,8 @@ namespace std {
iterator
_M_check(size_type __pos) const
{
__OUTOFRANGE(__pos > this->size());
if (__pos > this->size())
__throw_out_of_range("basic_string::_M_check");
return _M_ibegin() + __pos;
}
@ -432,14 +432,16 @@ namespace std {
const_reference
at(size_type __n) const
{
__OUTOFRANGE(__n >= this->size());
if (__n >= this->size())
__throw_out_of_range("basic_string::at");
return _M_data()[__n];
}
reference
at(size_type __n)
{
__OUTOFRANGE(__n >= size());
if (__n >= size())
__throw_out_of_range("basic_string::at");
_M_leak();
return _M_data()[__n];
}
@ -809,7 +811,8 @@ namespace std {
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
__OUTOFRANGE(__pos > this->size());
if (__pos > this->size())
__throw_out_of_range("basic_string::substr");
return basic_string(*this, __pos, __n);
}

View File

@ -87,44 +87,46 @@ namespace std
_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 (...) {
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;
}
__throw_exception_again;
}
return 0;
}
template<typename _CharT, typename _Traits, typename _Alloc>
template <class _InIter>
_CharT*
@ -139,13 +141,13 @@ namespace std
// 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;
}
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.
@ -162,14 +164,16 @@ namespace std
// 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;
}
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();
@ -276,17 +280,19 @@ namespace std
// 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;
}
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());
}
@ -307,7 +313,8 @@ namespace std
{
if (__res > this->capacity() || _M_rep()->_M_is_shared())
{
__LENGTHERROR(__res > this->max_size());
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);
@ -351,13 +358,14 @@ namespace std
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()
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
__LENGTHERROR(__capacity > _S_max_size);
if (__capacity > _S_max_size)
#else
__LENGTHERROR(__capacity == npos);
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
@ -381,13 +389,13 @@ namespace std
_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;
}
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();
@ -410,7 +418,8 @@ namespace std
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
{
__LENGTHERROR(__n > max_size());
if (__n > max_size())
__throw_length_error("basic_string::resize");
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
@ -441,7 +450,8 @@ namespace std
size_type __dmax = this->max_size();
size_type __dnew = static_cast<size_type>(distance(__k1, __k2));
__LENGTHERROR(__dmax <= __dnew);
if (__dmax <= __dnew)
__throw_length_error("basic_string::_M_replace");
size_type __off = __i1 - _M_ibegin();
_M_mutate(__off, __dold, __dnew);
// Invalidated __i1, __i2
@ -551,7 +561,8 @@ namespace std
{
size_type __n1 = __i2 - __i1;
size_type __off1 = __i1 - _M_ibegin();
__LENGTHERROR(max_size() - (this->size() - __n1) <= __n2);
if (max_size() - (this->size() - __n1) <= __n2)
__throw_length_error("basic_string::replace");
_M_mutate (__off1, __n1, __n2);
// Invalidated __i1, __i2
if (__n2)
@ -564,7 +575,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
__OUTOFRANGE(__pos > this->size());
if (__pos > this->size())
__throw_out_of_range("basic_string::copy");
if (__n > this->size() - __pos)
__n = this->size() - __pos;
@ -751,7 +763,8 @@ namespace std
{
size_type __size = this->size();
size_type __osize = __str.size();
__OUTOFRANGE(__pos > __size);
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
size_type __rsize= min(__size - __pos, __n);
size_type __len = min(__rsize, __osize);
@ -769,8 +782,8 @@ namespace std
{
size_type __size = this->size();
size_type __osize = __str.size();
__OUTOFRANGE(__pos1 > __size);
__OUTOFRANGE(__pos2 > __osize);
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);
@ -803,7 +816,8 @@ namespace std
size_type __n2) const
{
size_type __size = this->size();
__OUTOFRANGE(__pos > __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);

View File

@ -36,12 +36,6 @@
// The current version of the C++ library in compressed ISO date format.
#define __GLIBCPP__ 20010102
// This flag controls the error handling in string, and perhaps other
// bits as time goes on: check out bits/basic_string.h for more
// info. It also helps alleviate the circular dependency between
// string and exception.
# define _GLIBCPP_USE_EXCEPTIONS 1
// This is necessary until GCC supports separate template
// compilation.
#define _GLIBCPP_NO_TEMPLATE_EXPORT 1

View File

@ -49,7 +49,7 @@ namespace std
catch(...)
{
delete _M_file;
throw;
__throw_exception_again;
}
}
}
@ -67,7 +67,7 @@ namespace std
catch(...)
{
delete [] _M_buf;
throw;
__throw_exception_again;
}
// Allocate pback buffer.
@ -76,7 +76,7 @@ namespace std
catch(...)
{
delete [] _M_pback;
throw;
__throw_exception_again;
}
}
}

View File

@ -1,6 +1,6 @@
// Methods and support infrastructure for exceptions -*- C++ -*-
// Function-Based Exception Support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// 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
@ -28,52 +28,57 @@
// the GNU General Public License.
//
// ISO C++ 14882: 15 Exception handling
// ISO C++ 14882: 19.1 Exception classes
//
// This file declares functions whose only purpose is to throw an
// exception. They help break a circularity between <string> and
// <stdexcept>. See src/stdexcept.cc, where these functions are
// defined.
#include <exception_defines.h>
// XXX: These functions serve a similar purpose to those in
// stl/bits/stl_range_errors.h . Eventually the two approaches should
// be merged.
namespace std
{
// Helper for exception objects in <except>
void
__throw_bad_exception(void);
#ifndef _CPP_EXCEPTION_SUPPORT_H
#define _CPP_EXCEPTION_SUPPORT_H 1
// Helper for exception objects in <new>
void
__throw_bad_alloc(void);
namespace std {
// Helper for exception objects in <typeinfo>
void
__throw_bad_cast(void);
#if _GLIBCPP_USE_EXCEPTIONS
// Internal functions for string implementation.
extern void __out_of_range(const char *__str);
extern void __length_error(const char *__str);
# define __OUTOFRANGE(__cond) \
do { if (__cond) __out_of_range(#__cond); } while (0)
# define __LENGTHERROR(__cond) \
do { if (__cond) __length_error(#__cond); } while (0)
#else
# include <bits/std_cassert.h>
# define __OUTOFRANGE(__cond) assert(!(__cond))
# define __LENGTHERROR(__cond) assert(!(__cond))
#endif
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
#endif /* _CPP_EXCEPTION_SUPPORT_H */

View File

@ -92,7 +92,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -114,7 +114,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -136,7 +136,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -160,7 +160,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -184,7 +184,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -208,7 +208,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -232,7 +232,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -256,7 +256,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -280,7 +280,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -304,7 +304,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -329,7 +329,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -353,7 +353,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -378,7 +378,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -402,7 +402,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -426,7 +426,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -450,7 +450,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -495,7 +495,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __c;
@ -527,7 +527,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -568,7 +568,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
*__s = char_type(NULL);
@ -664,7 +664,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
*__s = char_type(NULL);
@ -708,7 +708,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -732,7 +732,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __c;
@ -776,7 +776,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
}
@ -813,7 +813,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
}
@ -841,7 +841,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
else
@ -869,7 +869,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
else
@ -899,7 +899,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __ret;
@ -923,7 +923,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __ret;
@ -950,7 +950,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -976,7 +976,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -999,7 +999,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
else
@ -1059,7 +1059,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
if (!__extracted)

View File

@ -75,7 +75,7 @@ namespace std
__vec_facet* __facet = __loc._M_impl->_M_facets;
const locale::facet* __fp = (*__facet)[__i];
if (__fp == 0 || __i >= __facet->size())
throw bad_cast();
__throw_bad_cast();
return static_cast<const _Facet&>(*__fp);
}
@ -1098,7 +1098,7 @@ namespace std
}
catch (...) {
__io.flags(__fmt);
throw;
__throw_exception_again;
}
}

View File

@ -35,10 +35,11 @@
#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/c++locale.h> // Defines __c_locale.
#include <bits/functexcept.h>
namespace std
{

View File

@ -59,7 +59,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -81,7 +81,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -103,7 +103,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -125,7 +125,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -155,7 +155,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -177,7 +177,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -206,7 +206,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -228,7 +228,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -251,7 +251,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -273,7 +273,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -295,7 +295,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return *this;
@ -512,7 +512,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __out;
@ -545,7 +545,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __out;
@ -577,7 +577,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __out;
@ -620,7 +620,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __out;
@ -653,7 +653,7 @@ namespace std {
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
throw;
__throw_exception_again;
}
}
return __out;

View File

@ -27,7 +27,7 @@
#ifndef _CPP_DEQUE
#define _CPP_DEQUE 1
#include <bits/stl_range_errors.h>
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>

View File

@ -1,6 +1,6 @@
// Forwarding declarations -*- C++ -*-
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
// 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,6 +37,7 @@
#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
{

View File

@ -27,7 +27,7 @@
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
#include <bits/stl_range_errors.h>
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>

View File

@ -265,7 +265,9 @@
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
# define __STL_USE_EXCEPTIONS
# ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS
# endif
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
# define __STL_USE_STD_ALLOCATORS

View File

@ -499,7 +499,7 @@ public: // Basic accessors
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__stl_throw_range_error("deque");
__throw_range_error("deque");
}
reference at(size_type __n)

View File

@ -1,74 +0,0 @@
/*
* Copyright (c) 1999
* Silicon Graphics
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
#ifndef __STL_RANGE_ERRORS_H
#define __STL_RANGE_ERRORS_H
// A few places in the STL throw range errors, using standard exception
// classes defined in <stdexcept>. This header file provides functions
// to throw those exception objects.
// __STL_DONT_THROW_RANGE_ERRORS is a hook so that users can disable
// this exception throwing.
#include <bits/stl_config.h>
#if defined(__STL_CAN_THROW_RANGE_ERRORS) && \
defined(__STL_USE_EXCEPTIONS) && \
!defined(__STL_DONT_THROW_RANGE_ERRORS)
# define __STL_THROW_RANGE_ERRORS
#endif
// For the SGI 7.3 compiler, declare these functions here and define them
// elsewhere.
#if defined(__STL_THROW_RANGE_ERRORS) && \
defined(__sgi) && !defined(__GNUC__) && \
_COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) \
|| defined(__GNUC__) && defined(__STL_THROW_RANGE_ERRORS)
__STL_BEGIN_NAMESPACE
void __stl_throw_range_error(const char* __msg);
void __stl_throw_length_error(const char* __msg);
__STL_END_NAMESPACE
// For other compilers where we're throwing range errors, include the
// stdexcept header and throw the appropriate exceptions directly.
#elif defined(__STL_THROW_RANGE_ERRORS)
#include <bits/std_stdexcept.h>
__STL_BEGIN_NAMESPACE
inline void __stl_throw_range_error(const char* __msg)
{ throw range_error(__msg); }
inline void __stl_throw_length_error(const char* __msg)
{ throw length_error(__msg); }
__STL_END_NAMESPACE
// Otherwise, define inline functions that do nothing.
#else
__STL_BEGIN_NAMESPACE
inline void __stl_throw_range_error(const char*) {}
inline void __stl_throw_length_error(const char*) {}
__STL_END_NAMESPACE
#endif
#endif /* __STL_RANGE_ERRORS_H */
// Local Variables:
// mode:C++
// End:

View File

@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
#include <bits/exception_support.h>
#include <bits/functexcept.h>
#include <bits/concept_checks.h>
@ -231,7 +231,7 @@ public:
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__out_of_range("vector");
__throw_out_of_range("vector");
}
reference at(size_type __n)

View File

@ -215,7 +215,7 @@ namespace std {
}
catch(exception& __fail) {
if ((__ios.exceptions() & ios_base::failbit) != 0)
throw;
__throw_exception_again;
}
return __ret;
}

View File

@ -27,14 +27,8 @@
#ifndef __SGI_STL_BVECTOR_H
#define __SGI_STL_BVECTOR_H
#include <bits/stl_range_errors.h>
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
#include <bits/std_vector.h>
#else
#include <bits/std_algobase.h>
#include <bits/atl_alloc.h>
#endif
#include <bits/std_vector.h>
#include <ext/stl_bvector.h>
#ifdef __STL_USE_NAMESPACES

View File

@ -522,7 +522,7 @@ public:
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__stl_throw_range_error("vector<bool>");
__throw_range_error("vector<bool>");
}
reference at(size_type __n)

View File

@ -68,7 +68,7 @@ INCLUDES = \
$(LIBSUPCXX_INCLUDES)
headers = \
cxxabi.h exception new typeinfo
exception new typeinfo cxxabi.h exception_defines.h
sources = \
del_op.cc \

View File

@ -150,7 +150,7 @@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES)
headers = cxxabi.h exception new typeinfo
headers = exception new typeinfo cxxabi.h exception_defines.h
sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc exception_support.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc vec.cc

View File

@ -1,8 +1,7 @@
/* new abi support -*- C++ -*-
Copyright (C) 2000
Free Software Foundation, Inc.
Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com> */
// new abi support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
@ -29,6 +28,8 @@
// 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>
/* This file declares the new abi entry points into the runtime. It is not
normally necessary for user programs to include this header, or use the
entry points directly. However, this header is available should that be

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,7 +1,7 @@
// Exception Handling support header for -*- C++ -*-
// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify

View File

@ -0,0 +1,42 @@
// -fno-exceptions 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

View File

@ -1,10 +1,10 @@
// Functions for Exception Support for -*- C++ -*-
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000,
// 2001 Free Software Foundation
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
// Free Software Foundation
//
// 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)
@ -35,6 +35,7 @@
#include "exception"
#include <cstddef>
#include "exception_support.h"
#include "exception_defines.h"
/* Define terminate, unexpected, set_terminate, set_unexpected as
well as the default terminate func and default unexpected func. */
@ -83,18 +84,18 @@ std::unexpected ()
}
/* 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.
@ -106,8 +107,6 @@ __cp_exception_info (void)
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 (). */
@ -348,44 +347,40 @@ __check_null_eh_spec (void)
{
__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.
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
#define THROW_BAD_CAST __throw_bad_cast
#define THROW_BAD_TYPEID __throw_bad_typeid
#else
#define THROW_BAD_CAST __cxa_bad_cast
#define THROW_BAD_TYPEID __cxa_bad_typeid
#endif
extern "C" void *
THROW_BAD_CAST ()
__cxa_bad_cast()
{
throw std::bad_cast ();
#ifdef __EXCEPTIONS
throw std::bad_cast();
#else
std::abort();
#endif
return 0;
}
extern "C" std::type_info const &
THROW_BAD_TYPEID ()
__cxa_bad_typeid()
{
throw std::bad_typeid ();
#ifdef __EXCEPTIONS
throw std::bad_typeid();
#else
std::abort();
#endif
return typeid (void);
}
/* Has the current exception been caught? */
bool
std::uncaught_exception () throw()
std::uncaught_exception() throw()
{
cp_eh_info *p = CP_EH_INFO;
return p && ! p->caught;
}
const char *
std::exception::
what () const throw()
{
return typeid (*this).name ();
}
const char*
std::exception::what() const throw()
{ return typeid (*this).name (); }

View File

@ -1,5 +1,4 @@
// Copyright (C) 2000
// Free Software Foundation, Inc.
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// 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

View File

@ -1,4 +1,5 @@
// Implementation file for the -*- C++ -*- dynamic memory management header.
// Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,5 +1,5 @@
// Support routines for the -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
@ -28,6 +28,8 @@
// the GNU General Public License.
#include "new"
#include <exception_defines.h>
using std::new_handler;
using std::bad_alloc;
@ -47,7 +49,11 @@ operator new (std::size_t sz) throw (std::bad_alloc)
{
new_handler handler = __new_handler;
if (! handler)
throw bad_alloc ();
#ifdef __EXCEPTIONS
throw bad_alloc();
#else
std::abort();
#endif
handler ();
p = (void *) malloc (sz);
}

View File

@ -1,5 +1,5 @@
// Support routines for the -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
@ -28,6 +28,8 @@
// the GNU General Public License.
#include "new"
#include <exception_defines.h>
using std::new_handler;
using std::bad_alloc;

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,4 +1,5 @@
// -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation
//
// This file is part of GNU CC.

View File

@ -1,8 +1,9 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
// Copyright (C) 1994, 1996, 1998, 1999, 2000 Free Software Foundation
//
// 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)

View File

@ -1,4 +1,5 @@
// RTTI support internals for -*- C++ -*-
// Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation
#include "typeinfo"

View File

@ -1,8 +1,10 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation
// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001
// Free Software Foundation
//
// 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)

View File

@ -1,6 +1,7 @@
// RTTI support for -*- C++ -*-
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify

View File

@ -1,8 +1,9 @@
// new abi support -*- C++ -*-
// Copyright (C) 2000
// Free Software Foundation, Inc.
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
//
// 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,276 +28,273 @@
// 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
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
#include <cxxabi.h>
#include <new>
#include <exception>
#include <exception_defines.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 */
extern "C" void *
__cxa_vec_new (std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *))
{
return __cxa_vec_new2 (element_count, element_size, padding_size,
constructor, destructor,
&operator new[], &operator delete []);
}
extern "C" void *
__cxa_vec_new2 (std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *),
void *(*alloc) (size_t),
void (*dealloc) (void *))
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size));
if (padding_size)
{
base += padding_size;
reinterpret_cast <std::size_t *> (base)[-1] = element_count;
}
try
{
__cxa_vec_ctor (base, element_count, element_size,
constructor, destructor);
}
catch (...)
namespace
{
struct uncatch_exception
{
uncatch_exception () { p = __uncatch_exception (); }
~uncatch_exception () { __recatch_exception (p); }
cp_eh_info *p;
};
}
// Allocate and construct array.
extern "C" void *
__cxa_vec_new(std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *))
{
return __cxa_vec_new2(element_count, element_size, padding_size,
constructor, destructor,
&operator new[], &operator delete []);
}
extern "C" void *
__cxa_vec_new2(std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *),
void *(*alloc) (size_t),
void (*dealloc) (void *))
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size));
if (padding_size)
{
uncatch_exception ue;
dealloc (base - padding_size);
base += padding_size;
reinterpret_cast <std::size_t *> (base)[-1] = element_count;
}
throw;
}
return base;
}
extern "C" void *
__cxa_vec_new3 (std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *),
void *(*alloc) (std::size_t),
void (*dealloc) (void *, std::size_t))
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size));
if (padding_size)
{
base += padding_size;
reinterpret_cast <std::size_t *> (base)[-1] = element_count;
}
try
{
__cxa_vec_ctor (base, element_count, element_size,
constructor, destructor);
}
catch (...)
{
try
{
uncatch_exception ue;
dealloc (base - padding_size, size);
__cxa_vec_ctor(base, element_count, element_size,
constructor, destructor);
}
throw;
}
return base;
}
/* construct array */
extern "C" void
__cxa_vec_ctor (void *array_address,
std::size_t element_count,
std::size_t element_size,
void (*constructor) (void *),
void (*destructor) (void *))
{
std::size_t ix = 0;
char *ptr = static_cast <char *> (array_address);
try
{
if (constructor)
for (; ix != element_count; ix++, ptr += element_size)
constructor (ptr);
}
catch (...)
{
catch (...)
{
uncatch_exception ue;
__cxa_vec_dtor (array_address, ix, element_size, destructor);
{
uncatch_exception ue;
dealloc(base - padding_size);
}
__throw_exception_again;
}
throw;
}
}
/* construct an array by copying */
extern "C" void
__cxa_vec_cctor (void *dest_array,
void *src_array,
return base;
}
extern "C" void *
__cxa_vec_new3(std::size_t element_count,
std::size_t element_size,
std::size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *),
void *(*alloc) (std::size_t),
void (*dealloc) (void *, std::size_t))
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast<char *>(alloc (size));
if (padding_size)
{
base += padding_size;
reinterpret_cast<std::size_t *>(base)[-1] = element_count;
}
try
{
__cxa_vec_ctor(base, element_count, element_size,
constructor, destructor);
}
catch (...)
{
{
uncatch_exception ue;
dealloc(base - padding_size, size);
}
__throw_exception_again;
}
return base;
}
// Construct array.
extern "C" void
__cxa_vec_ctor(void *array_address,
std::size_t element_count,
std::size_t element_size,
void (*constructor) (void *, void *),
void (*constructor) (void *),
void (*destructor) (void *))
{
std::size_t ix = 0;
char *dest_ptr = static_cast <char *> (dest_array);
char *src_ptr = static_cast <char *> (src_array);
try
{
if (constructor)
for (; ix != element_count;
ix++, src_ptr += element_size, dest_ptr += element_size)
constructor (dest_ptr, src_ptr);
}
catch (...)
{
{
std::size_t ix = 0;
char *ptr = static_cast<char *>(array_address);
try
{
uncatch_exception ue;
__cxa_vec_dtor (dest_array, ix, element_size, destructor);
if (constructor)
for (; ix != element_count; ix++, ptr += element_size)
constructor(ptr);
}
throw;
}
}
/* destruct array */
extern "C" void
__cxa_vec_dtor (void *array_address,
std::size_t element_count,
std::size_t element_size,
void (*destructor) (void *))
{
if (destructor)
{
char *ptr = static_cast <char *> (array_address);
std::size_t ix = element_count;
bool unwinding = std::uncaught_exception ();
ptr += element_count * element_size;
try
{
while (ix--)
{
ptr -= element_size;
destructor (ptr);
}
}
catch (...)
{
if (unwinding)
// [except.ctor]/3 If a destructor called during stack unwinding
// exits with an exception, terminate is called.
std::terminate ();
{
uncatch_exception ue;
__cxa_vec_dtor (array_address, ix, element_size,
destructor);
}
throw;
}
}
}
/* destruct and release array */
extern "C" void
__cxa_vec_delete (void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *))
{
__cxa_vec_delete2 (array_address, element_size, padding_size,
destructor,
&operator delete []);
}
extern "C" void
__cxa_vec_delete2 (void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *),
void (*dealloc) (void *))
{
char *base = static_cast <char *> (array_address);
catch (...)
{
{
uncatch_exception ue;
__cxa_vec_dtor(array_address, ix, element_size, destructor);
}
__throw_exception_again;
}
}
if (padding_size)
{
std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
base -= padding_size;
try
{
__cxa_vec_dtor (array_address, element_count, element_size,
destructor);
}
catch (...)
{
{
uncatch_exception ue;
dealloc (base);
}
throw;
}
}
dealloc (base);
}
extern "C" void
__cxa_vec_delete3 (void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *),
void (*dealloc) (void *, std::size_t))
{
char *base = static_cast <char *> (array_address);
std::size_t size = 0;
// Construct an array by copying.
extern "C" void
__cxa_vec_cctor(void *dest_array,
void *src_array,
std::size_t element_count,
std::size_t element_size,
void (*constructor) (void *, void *),
void (*destructor) (void *))
{
std::size_t ix = 0;
char *dest_ptr = static_cast<char *>(dest_array);
char *src_ptr = static_cast<char *>(src_array);
try
{
if (constructor)
for (; ix != element_count;
ix++, src_ptr += element_size, dest_ptr += element_size)
constructor(dest_ptr, src_ptr);
}
catch (...)
{
{
uncatch_exception ue;
__cxa_vec_dtor (dest_array, ix, element_size, destructor);
}
__throw_exception_again;
}
}
if (padding_size)
{
std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
base -= padding_size;
size = element_count * element_size + padding_size;
try
{
__cxa_vec_dtor (array_address, element_count, element_size,
destructor);
}
catch (...)
{
// Destruct array.
extern "C" void
__cxa_vec_dtor(void *array_address,
std::size_t element_count,
std::size_t element_size,
void (*destructor) (void *))
{
if (destructor)
{
char *ptr = static_cast<char *>(array_address);
std::size_t ix = element_count;
bool unwinding = std::uncaught_exception();
ptr += element_count * element_size;
try
{
uncatch_exception ue;
dealloc (base, size);
while (ix--)
{
ptr -= element_size;
destructor(ptr);
}
}
throw;
}
}
dealloc (base, size);
}
catch (...)
{
if (unwinding)
// [except.ctor]/3 If a destructor called during stack unwinding
// exits with an exception, terminate is called.
std::terminate ();
{
uncatch_exception ue;
__cxa_vec_dtor(array_address, ix, element_size, destructor);
}
__throw_exception_again;
}
}
}
// Destruct and release array.
extern "C" void
__cxa_vec_delete(void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *))
{
__cxa_vec_delete2(array_address, element_size, padding_size,
destructor,
&operator delete []);
}
extern "C" void
__cxa_vec_delete2(void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *),
void (*dealloc) (void *))
{
char *base = static_cast<char *>(array_address);
if (padding_size)
{
std::size_t element_count = reinterpret_cast<std::size_t *>(base)[-1];
base -= padding_size;
try
{
__cxa_vec_dtor(array_address, element_count, element_size,
destructor);
}
catch (...)
{
{
uncatch_exception ue;
dealloc(base);
}
__throw_exception_again;
}
}
dealloc(base);
}
extern "C" void
__cxa_vec_delete3(void *array_address,
std::size_t element_size,
std::size_t padding_size,
void (*destructor) (void *),
void (*dealloc) (void *, std::size_t))
{
char *base = static_cast <char *> (array_address);
std::size_t size = 0;
if (padding_size)
{
std::size_t element_count = reinterpret_cast<std::size_t *> (base)[-1];
base -= padding_size;
size = element_count * element_size + padding_size;
try
{
__cxa_vec_dtor(array_address, element_count, element_size,
destructor);
}
catch (...)
{
{
uncatch_exception ue;
dealloc(base, size);
}
__throw_exception_again;
}
}
dealloc(base, size);
}
} // namespace __cxxabiv1
#endif // defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100

View File

@ -21,7 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
## $Id: Makefile.am,v 1.70 2001/02/07 01:54:21 bkoz Exp $
## $Id: Makefile.am,v 1.71 2001/02/07 20:26:24 bkoz Exp $
AUTOMAKE_OPTIONS = 1.3 gnits
MAINT_CHARSET = latin1
@ -73,7 +73,6 @@ base_headers = \
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 \
@ -88,7 +87,7 @@ base_headers = \
bits/std_iterator.h bits/std_list.h \
bits/std_map.h bits/std_memory.h bits/std_numeric.h \
bits/std_queue.h bits/std_set.h bits/std_stack.h \
bits/std_stdexcept.h bits/std_vector.h \
bits/std_stdexcept.h bits/functexcept.h bits/std_vector.h \
bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
bits/stl_deque.h bits/stl_function.h \
bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
@ -97,7 +96,7 @@ base_headers = \
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/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
@ -166,10 +165,9 @@ build_headers = \
sources = \
limitsMEMBERS.cc \
complex_io.cc \
stdexcept.cc bitset.cc \
stdexcept.cc functexcept.cc bitset.cc \
globals.cc \
c++io.cc ios.cc strstream.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

View File

@ -144,7 +144,7 @@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = -nostdinc++ -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES)
base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/stringfwd.h bits/std_string.h bits/basic_string.h bits/basic_string.tcc bits/generic_shadow.h bits/std_utility.h bits/std_complex.h 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 bits/std_istream.h bits/istream.tcc bits/std_locale.h bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h bits/streambuf.tcc bits/basic_file.h bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h bits/stl_pthread_alloc.h bits/pthread_allocimpl.h bits/stl_threads.h bits/stl_iterator_base.h bits/std_bitset.h bits/std_deque.h bits/std_functional.h bits/std_iterator.h bits/std_list.h bits/std_map.h bits/std_memory.h bits/std_numeric.h bits/std_queue.h bits/std_set.h bits/std_stack.h bits/std_stdexcept.h bits/std_vector.h bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h bits/stl_deque.h bits/stl_function.h bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h 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
base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/stringfwd.h bits/std_string.h bits/basic_string.h bits/basic_string.tcc bits/generic_shadow.h bits/std_utility.h bits/std_complex.h 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/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 bits/std_istream.h bits/istream.tcc bits/std_locale.h bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h bits/streambuf.tcc bits/basic_file.h bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h bits/stl_pthread_alloc.h bits/pthread_allocimpl.h bits/stl_threads.h bits/stl_iterator_base.h bits/std_bitset.h bits/std_deque.h bits/std_functional.h bits/std_iterator.h bits/std_list.h bits/std_map.h bits/std_memory.h bits/std_numeric.h bits/std_queue.h bits/std_set.h bits/std_stack.h bits/std_stdexcept.h bits/functexcept.h bits/std_vector.h bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h bits/stl_deque.h bits/stl_function.h bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h 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
backward_headers = backward/complex.h backward/iomanip.h backward/istream.h backward/ostream.h backward/stream.h backward/streambuf.h backward/algo.h backward/algobase.h backward/alloc.h backward/bvector.h backward/defalloc.h backward/deque.h backward/function.h backward/hash_map.h backward/hash_set.h backward/hashtable.h backward/heap.h backward/iterator.h backward/list.h backward/map.h backward/multimap.h backward/new.h backward/multiset.h backward/pair.h backward/iostream.h backward/rope.h backward/set.h backward/slist.h backward/stack.h backward/tempbuf.h backward/tree.h backward/vector.h backward/fstream.h backward/strstream.h backward/strstream
@ -166,7 +166,7 @@ std_headers = algorithm bitset complex deque fstream functional iomanip ios i
build_headers = bits/std_limits.h bits/c++config.h bits/c++io.h bits/c++locale.h bits/c++threads.h bits/atomicity.h bits/os_defines.h bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h
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
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
wstring_sources = wstring-inst.cc
@ -251,10 +251,10 @@ libinst_string_la_OBJECTS = libinst-string.la.lo
libinst_wstring_la_LDFLAGS =
libinst_wstring_la_LIBADD =
libinst_wstring_la_OBJECTS = wstring-inst.lo
libstdc___la_OBJECTS = limitsMEMBERS.lo complex_io.lo stdexcept.lo \
bitset.lo globals.lo c++io.lo ios.lo strstream.lo c++locale.lo \
locale.lo localename.lo codecvt.lo locale-inst.lo stl-inst.lo \
misc-inst.lo valarray-inst.lo string-inst.lo
libstdc___la_OBJECTS = limitsMEMBERS.lo stdexcept.lo functexcept.lo \
bitset.lo globals.lo c++io.lo ios.lo complex_io.lo strstream.lo \
c++locale.lo locale.lo localename.lo codecvt.lo locale-inst.lo \
stl-inst.lo misc-inst.lo valarray-inst.lo string-inst.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)

View File

@ -90,63 +90,61 @@ namespace std
template
basic_istream<char, char_traits<char> >&
operator>>(basic_istream< char, char_traits<char> >&,
complex<float>&);
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>&);
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>&);
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>&);
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>&);
operator>>(basic_istream<char, char_traits<char> >&,
complex<long double>&);
template
basic_ostream<char, char_traits<char> >&
operator<<(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> >&,
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> >&,
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> >&,
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> >&,
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> >&,
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> >&,
operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<long double>&);
#endif //_GLIBCPP_USE_WCHAR_T
}

View File

@ -0,0 +1,152 @@
// 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_base::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
}

View File

@ -349,7 +349,7 @@ namespace std
catch (...)
{
_M_impl->_M_remove_reference();
throw;
__throw_exception_again;
}
}
@ -376,7 +376,7 @@ namespace std
_M_impl = new _Impl(__s, 1);
}
else
throw runtime_error("attempt to create locale from NULL name");
__throw_runtime_error("attempt to create locale from NULL name");
}
locale::locale(const locale& __base, const char* __s, category __cat)
@ -468,7 +468,7 @@ namespace std
}
_S_classic = _S_global = 0;
// XXX MT
throw;
__throw_exception_again;
}
}
return *__classic_locale;
@ -509,7 +509,7 @@ namespace std
__ret = all;
break;
default:
throw runtime_error("bad locale category");
__throw_runtime_error("bad locale category");
}
}
return __ret;

View File

@ -53,7 +53,7 @@ namespace std {
catch(...)
{
delete _M_facets;
throw;
__throw_exception_again;
}
for (size_t i = 0; i < _S_num_categories; ++i)
@ -83,7 +83,7 @@ namespace std {
catch(...)
{
delete _M_facets;
throw;
__throw_exception_again;
}
// Name all the categories.
@ -159,7 +159,7 @@ namespace std {
if (__index == 0
|| __imp->_M_facets->size() <= __index
|| (*(__imp->_M_facets))[__index] == 0)
throw runtime_error("no locale facet");
__throw_runtime_error("no locale facet");
_M_install_facet(__idp, (*(__imp->_M_facets))[__index]);
}

View File

@ -33,9 +33,6 @@
#include <bits/std_string.h>
#include <bits/std_stdexcept.h>
#if 1
#include <bits/stl_range_errors.h>
#endif
namespace std
{
@ -77,27 +74,6 @@ namespace std
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