+2004-04-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ Fixups for EDG front end.
+ * include/ext/rope: Instead of non-existent function
+ _Data_allocate, use allocator's allocate. Use this.
+ (namespace _Rope_constants): Move _S_max_rope_depth, and _Tag
+ enumerations from _Rope_RopeRep here.
+ * include/ext/ropeimpl.h: Same.
+ * src/ext-inst.cc (_S_min_len): Fix up definition.
+
+ * config/locale/gnu/ctype_members.cc: Qualify base class members
+ with this.
+ * config/locale/generic/ctype_members.cc: Same.
+ * config/locale/gnu/messages_members.h: Same.
+ * config/locale/generic/messages_members.h: Same.
+ * src/ctype.cc: Same.
+ * include/bits/codecvt.h: Same.
+
+ * include/bits/boost_concept_check.h: Declare.
+ (__error_type_must_be_an_unsigned_integer_type): Remove this.
+ (__error_type_must_be_an_integer_type): Remove this.
+ (__error_type_must_be_a_signed_integer_type): Remove this.
+
+ * config/io/basic_file_stdio.cc (__basic_file::sys_open): Remove cast.
+
+ * libsupc++/eh_alloc.cc (__cxa_free_exception): Add exception
+ specification to definition.
+ (__cxa_allocate_exception): Same.
+ * libsupc++/eh_catch.cc (__cxa_begin_catch): Same.
+ * libsupc++/eh_globals.cc (__cxa_get_globals_fast): Same.
+ (__cxa_get_globals): Same.
+
+ * libsupc++/del_op.cc: Add comment about freestanding.
+
2004-04-05 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
{
__basic_file* __ret = NULL;
const char* __c_mode = __gnu_internal::fopen_mode(__mode);
- if (__c_mode && !this->is_open()
- && (_M_cfile = fdopen(__fd, __c_mode)))
+ if (__c_mode && !this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
{
+ char* __buf = NULL;
_M_cfile_created = true;
if (__fd == 0)
- setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
+ setvbuf(_M_cfile, __buf, _IONBF, 0);
__ret = this;
}
return __ret;
// std::ctype implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004 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
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(_M_c_locale_ctype);
- _S_create_c_locale(_M_c_locale_ctype, __s);
+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
}
}
// std::messages implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003, 2004 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
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(this->_M_c_locale_messages);
- _S_create_c_locale(this->_M_c_locale_messages, __s);
+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
}
}
// std::ctype implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004 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
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(_M_c_locale_ctype);
- _S_create_c_locale(_M_c_locale_ctype, __s);
- _M_toupper = _M_c_locale_ctype->__ctype_toupper;
- _M_tolower = _M_c_locale_ctype->__ctype_tolower;
- _M_table = _M_c_locale_ctype->__ctype_b;
+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
}
}
// std::messages implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004 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
#endif
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(this->_M_c_locale_messages);
- _S_create_c_locale(this->_M_c_locale_messages, __s);
+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
}
}
void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
}
+// No definition: if this is referenced, there's a problem with
+// the instantiating type not being one of the required integer types.
+// Unfortunately, this results in a link-time error, not a compile-time error.
+void __error_type_must_be_an_integer_type();
+void __error_type_must_be_an_unsigned_integer_type();
+void __error_type_must_be_a_signed_integer_type();
// ??? Should the "concept_checking*" structs begin with more than _ ?
#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
template <class _Tp>
struct _IntegerConcept {
void __constraints() {
- this->__error_type_must_be_an_integer_type();
+ __error_type_must_be_an_integer_type();
}
};
template <> struct _IntegerConcept<short> { void __constraints() {} };
template <class _Tp>
struct _SignedIntegerConcept {
void __constraints() {
- this->__error_type_must_be_a_signed_integer_type();
+ __error_type_must_be_a_signed_integer_type();
}
};
template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
template <class _Tp>
struct _UnsignedIntegerConcept {
void __constraints() {
- this->__error_type_must_be_an_unsigned_integer_type();
+ __error_type_must_be_an_unsigned_integer_type();
}
};
template <> struct _UnsignedIntegerConcept<unsigned short>
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(this->_M_c_locale_codecvt);
- _S_create_c_locale(this->_M_c_locale_codecvt, __s);
+ this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
+ this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
}
}
// First a lot of forward declarations. The standard seems to require
// much stricter "declaration before use" than many of the implementations
// that preceded it.
-template<class _CharT, class _Alloc=allocator<_CharT> > class rope;
+template<class _CharT, class _Alloc = allocator<_CharT> > class rope;
template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation;
template<class _CharT, class _Alloc> struct _Rope_RopeLeaf;
template<class _CharT, class _Alloc> struct _Rope_RopeFunction;
# undef __ROPE_DEFINE_ALLOC
};
+namespace _Rope_constants
+{
+ enum { _S_max_rope_depth = 45 };
+ enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
+}
template<class _CharT, class _Alloc>
struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
# endif
{
public:
- enum { _S_max_rope_depth = 45 };
- enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
- _Tag _M_tag:8;
+ _Rope_constants::_Tag _M_tag:8;
bool _M_is_balanced:8;
unsigned char _M_depth;
__GC_CONST _CharT* _M_c_string;
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
using _Rope_rep_base<_CharT,_Alloc>::get_allocator;
- _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
+ _Rope_RopeRep(_Rope_constants::_Tag __t, int __d, bool __b, size_t __size,
allocator_type __a)
: _Rope_rep_base<_CharT,_Alloc>(__size, __a),
# ifndef __GC
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a)
- : _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_leaf,
- 0, true, __size, __a),
- _M_data(__d)
+ : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_leaf, 0, true, __size, __a), _M_data(__d)
{
if (_S_is_basic_char_type((_CharT *)0)) {
// already eos terminated.
_Rope_RopeRep<_CharT,_Alloc>* __r,
allocator_type __a)
- : _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_concat,
+ : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_concat,
std::max(__l->_M_depth, __r->_M_depth) + 1,
false,
__l->_M_size + __r->_M_size, __a),
allocator_type;
_Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
bool __d, allocator_type __a)
- : _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_function,
+ : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_function,
0, true, __size, __a)
, _M_fn(__f)
# ifndef __GC
virtual void operator()(size_t __start_pos, size_t __req_len,
_CharT* __buffer) {
switch(_M_base->_M_tag) {
- case _Rope_RopeFunction<_CharT,_Alloc>::_S_function:
- case _Rope_RopeFunction<_CharT,_Alloc>::_S_substringfn:
+ case _Rope_constants::_S_function:
+ case _Rope_constants::_S_substringfn:
{
char_producer<_CharT>* __fn =
((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
(*__fn)(__start_pos + _M_start, __req_len, __buffer);
}
break;
- case _Rope_RopeFunction<_CharT,_Alloc>::_S_leaf:
+ case _Rope_constants::_S_leaf:
{
__GC_CONST _CharT* __s =
((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
# ifndef __GC
_M_base->_M_ref_nonnil();
# endif
- this->_M_tag = _Rope_RopeFunction<_CharT,_Alloc>::_S_substringfn;
+ this->_M_tag = _Rope_constants::_S_substringfn;
}
virtual ~_Rope_RopeSubstring()
{
_CharT* __buffer);
static const unsigned long
- _S_min_len[_RopeRep::_S_max_rope_depth + 1];
+ _S_min_len[_Rope_constants::_S_max_rope_depth + 1];
static bool _S_is_balanced(_RopeRep* __r)
{ return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
rope(_CharT __c, const allocator_type& __a = allocator_type())
: _Base(__a)
{
- _CharT* __buf = _Data_allocate(_S_rounded_up_size(1));
+ _CharT* __buf = __a.allocate(_S_rounded_up_size(1));
std::_Construct(__buf, __c);
try {
// is safe for multiple threads.
void delete_c_str () {
if (0 == this->_M_tree_ptr) return;
- if (_RopeRep::_S_leaf == this->_M_tree_ptr->_M_tag &&
+ if (_Rope_constants::_S_leaf == this->_M_tree_ptr->_M_tag &&
((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
this->_M_tree_ptr->_M_c_string) {
// Representation shared
}
size_type max_size() const {
- return _S_min_len[_RopeRep::_S_max_rope_depth-1] - 1;
+ return _S_min_len[_Rope_constants::_S_max_rope_depth - 1] - 1;
// Guarantees that the result can be sufficirntly
// balanced. Longer ropes will probably still work,
// but it's harder to make guarantees.
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
(_Rope_iterator_base<_CharT,_Alloc>& __x)
{
- const _RopeRep* __path[_RopeRep::_S_max_rope_depth+1];
+ const _RopeRep* __path[_Rope_constants::_S_max_rope_depth + 1];
const _RopeRep* __curr_rope;
int __curr_depth = -1; /* index into path */
size_t __curr_start_pos = 0;
void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
{
switch(_M_tag) {
- case _S_leaf:
+ case _Rope_constants::_S_leaf:
{
_Rope_RopeLeaf<_CharT,_Alloc>* __l
= (_Rope_RopeLeaf<_CharT,_Alloc>*)this;
_L_deallocate(__l, 1);
break;
}
- case _S_concat:
+ case _Rope_constants::_S_concat:
{
_Rope_RopeConcatenation<_CharT,_Alloc>* __c
= (_Rope_RopeConcatenation<_CharT,_Alloc>*)this;
_C_deallocate(__c, 1);
break;
}
- case _S_function:
+ case _Rope_constants::_S_function:
{
_Rope_RopeFunction<_CharT,_Alloc>* __f
= (_Rope_RopeFunction<_CharT,_Alloc>*)this;
_F_deallocate(__f, 1);
break;
}
- case _S_substringfn:
+ case _Rope_constants::_S_substringfn:
{
_Rope_RopeSubstring<_CharT,_Alloc>* __ss =
(_Rope_RopeSubstring<_CharT,_Alloc>*)this;
{
size_t __old_len = __r->_M_size;
_CharT* __new_data = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__old_len + __len));
+ __r->get_allocator().allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
size_t __depth = __result->_M_depth;
if (__depth > 20 && (__result->_M_size < 1000 ||
- __depth > _RopeRep::_S_max_rope_depth))
+ __depth > _Rope_constants::_S_max_rope_depth))
{
_RopeRep* __balanced;
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
- if (_RopeRep::_S_leaf == __r->_M_tag &&
+ if (_Rope_constants::_S_leaf == __r->_M_tag &&
__r->_M_size + __slen <= _S_copy_max) {
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
- if (_RopeRep::_S_concat == __r->_M_tag
- && _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
+ if (_Rope_constants::_S_concat == __r->_M_tag
+ && _Rope_constants::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
_RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
if (__right->_M_size + __slen <= _S_copy_max) {
return __r;
}
if (__orig_size + __slen <= _S_copy_max &&
- _RopeRep::_S_leaf == __r->_M_tag) {
+ _Rope_constants::_S_leaf == __r->_M_tag) {
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
- if (_RopeRep::_S_concat == __r->_M_tag) {
+ if (_Rope_constants::_S_concat == __r->_M_tag) {
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
- if (_RopeRep::_S_leaf == __right->_M_tag
+ if (_Rope_constants::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __new_right =
_S_destr_leaf_concat_char_iter(__right, __s, __slen);
__left->_M_ref_nonnil();
return __left;
}
- if (_RopeRep::_S_leaf == __right->_M_tag) {
- if (_RopeRep::_S_leaf == __left->_M_tag) {
+ if (_Rope_constants::_S_leaf == __right->_M_tag) {
+ if (_Rope_constants::_S_leaf == __left->_M_tag) {
if (__right->_M_size + __left->_M_size <= _S_copy_max) {
return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
((_RopeLeaf*)__right)->_M_data,
__right->_M_size);
}
- } else if (_RopeRep::_S_concat == __left->_M_tag
- && _RopeRep::_S_leaf ==
+ } else if (_Rope_constants::_S_concat == __left->_M_tag
+ && _Rope_constants::_S_leaf ==
((_RopeConcatenation*)__left)->_M_right->_M_tag) {
_RopeLeaf* __leftright =
(_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
if (__result_len > __lazy_threshold) goto lazy;
__section = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__result_len));
+ __base->get_allocator().allocate(_S_rounded_up_size(__result_len));
try {
(*(__f->_M_fn))(__start, __result_len, __section);
}
{
if (0 == __r) return true;
switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
+ case _Rope_constants::_S_concat:
{
_RopeConcatenation* __conc = (_RopeConcatenation*)__r;
_RopeRep* __left = __conc->_M_left;
}
}
return true;
- case _RopeRep::_S_leaf:
+ case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __c(__l->_M_data + __begin, __end - __begin);
}
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
+ case _Rope_constants::_S_function:
+ case _Rope_constants::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
size_t __len = __end - __begin;
{
if (0 == __r) return __buffer;
switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
+ case _Rope_constants::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
_CharT* __rest = _S_flatten(__left, __buffer);
return _S_flatten(__right, __rest);
}
- case _RopeRep::_S_leaf:
+ case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
}
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
+ case _Rope_constants::_S_function:
+ case _Rope_constants::_S_substringfn:
// We don't yet do anything with substring nodes.
// This needs to be fixed before ropefiles will work well.
{
template <class _CharT, class _Alloc>
const unsigned long
-rope<_CharT,_Alloc>::_S_min_len[
- _Rope_RopeRep<_CharT,_Alloc>::_S_max_rope_depth + 1] = {
+rope<_CharT,_Alloc>::_S_min_len[_Rope_constants::_S_max_rope_depth + 1] = {
/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
{
- _RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1];
+ _RopeRep* __forest[_Rope_constants::_S_max_rope_depth + 1];
_RopeRep* __result = 0;
int __i;
// Invariant:
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i)
__forest[__i] = 0;
try {
_S_add_to_forest(__r, __forest);
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i)
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__result);
}
catch(...)
{
- for(__i = 0; __i <= _RopeRep::_S_max_rope_depth; __i++)
+ for(__i = 0; __i <= _Rope_constants::_S_max_rope_depth; __i++)
_S_unref(__forest[__i]);
__throw_exception_again;
}
- if (__result->_M_depth > _RopeRep::_S_max_rope_depth)
+ if (__result->_M_depth > _Rope_constants::_S_max_rope_depth)
__throw_length_error(__N("rope::_S_balance"));
return(__result);
}
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
- if (__i == _RopeRep::_S_max_rope_depth ||
+ if (__i == _Rope_constants::_S_max_rope_depth ||
__insertee->_M_size < _S_min_len[__i+1]) {
__forest[__i] = __insertee;
// refcount is OK since __insertee is now dead.
if (0 != __cstr) return __cstr[__i];
for(;;) {
switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
+ case _Rope_constants::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
}
}
break;
- case _RopeRep::_S_leaf:
+ case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __l->_M_data[__i];
}
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
+ case _Rope_constants::_S_function:
+ case _Rope_constants::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
_CharT __result;
_CharT*
rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
{
- _RopeRep* __clrstack[_RopeRep::_S_max_rope_depth];
+ _RopeRep* __clrstack[_Rope_constants::_S_max_rope_depth];
size_t __csptr = 0;
for(;;) {
if (0 == __rest) {
__remainder = 0;
} else {
- __rest_buffer = _Data_allocate(_S_rounded_up_size(__rest));
+ __rest_buffer = __a.allocate(_S_rounded_up_size(__rest));
uninitialized_fill_n(__rest_buffer, __rest, __c);
_S_cond_store_eos(__rest_buffer[__rest]);
try {
__remainder_rope._M_tree_ptr = __remainder;
if (__exponent != 0) {
_CharT* __base_buffer =
- _Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
+ __a.allocate(_S_rounded_up_size(__exponentiate_threshold));
_RopeLeaf* __base_leaf;
rope __base_rope;
uninitialized_fill_n(__base_buffer, __exponentiate_threshold, __c);
if (0 == __result)
{
size_t __s = size();
- __result = this->_Data_allocate(__s + 1);
+ __result = this->get_allocator().allocate(__s + 1);
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_c_string = __result;
return(__old_c_string);
}
size_t __s = size();
- _CharT* __result = _Data_allocate(_S_rounded_up_size(__s));
+ _CharT* __result = get_allocator().allocate(_S_rounded_up_size(__s));
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_unref_nonnil();
#include "new"
+// We can't rely on having stdlib.h if we're freestanding.
extern "C" void free (void *);
void
// -*- C++ -*- Allocate exception objects.
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
extern "C" void *
-__cxa_allocate_exception(std::size_t thrown_size)
+__cxa_allocate_exception(std::size_t thrown_size) throw()
{
void *ret;
extern "C" void
-__cxa_free_exception(void *vptr)
+__cxa_free_exception(void *vptr) throw()
{
char *ptr = (char *) vptr;
if (ptr >= &emergency_buffer[0][0]
#include "unwind-cxx.h"
#include "exception_defines.h"
-
extern "C" void
__cxa_bad_cast ()
{
extern "C" void *
-__cxa_begin_catch (void *exc_obj_in)
+__cxa_begin_catch (void *exc_obj_in) throw()
{
_Unwind_Exception *exceptionObject
= reinterpret_cast <_Unwind_Exception *>(exc_obj_in);
// -*- C++ -*- Manage the thread-local exception globals.
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
#endif
extern "C" __cxa_eh_globals *
-__cxa_get_globals_fast ()
+__cxa_get_globals_fast () throw()
{
#if __GTHREADS
if (use_thread_key)
}
extern "C" __cxa_eh_globals *
-__cxa_get_globals ()
+__cxa_get_globals () throw()
{
#if __GTHREADS
__cxa_eh_globals *g;
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2004 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
codecvt<char, char, mbstate_t>::
do_in(state_type&, const extern_type* __from,
const extern_type*, const extern_type*& __from_next,
- intern_type* __to, intern_type*,
- intern_type*& __to_next) const
+ intern_type* __to, intern_type*, intern_type*& __to_next) const
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// According to the resolution of DR19, "If returns noconv [...]
codecvt<char, char, mbstate_t>::
do_length (state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
- { return std::min(__max, static_cast<size_t>(__end - __from)); }
+ {
+ size_t __d = static_cast<size_t>(__end - __from);
+ return std::min(__max, __d);
+ }
int
codecvt<char, char, mbstate_t>::
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
- _S_destroy_c_locale(_M_c_locale_ctype);
- _S_create_c_locale(_M_c_locale_ctype, __s);
- _M_initialize_ctype();
+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
+ this->_M_initialize_ctype();
}
}
#endif
// Explicit instantiation file.
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2004 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
#include <ext/rope>
#include <ext/stdio_filebuf.h>
+namespace __gnu_internal
+{
+ const int min_len = __gnu_cxx::_Rope_constants::_S_max_rope_depth + 1;
+}
+
namespace __gnu_cxx
{
+ using namespace __gnu_internal;
+
template
const unsigned long
- rope<char, std::allocator<char> >::_S_min_len;
+ rope<char, std::allocator<char> >::_S_min_len[min_len];
template
char
#ifdef _GLIBCXX_USE_WCHAR_T
template
- const unsigned long
- rope<wchar_t, std::allocator<wchar_t> >::_S_min_len;
+ const unsigned long
+ rope<wchar_t, std::allocator<wchar_t> >::_S_min_len[min_len];
template
wchar_t