diff options
author | kan <kan@FreeBSD.org> | 2004-07-28 03:12:05 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-07-28 03:12:05 +0000 |
commit | 96bad46eee8bf907dceb152bbb9d128bed5a4956 (patch) | |
tree | 75ef0e6da73746d6849e25a0996ae34e1aeff51d /contrib/libstdc++/libsupc++/vec.cc | |
parent | 5e00ec74d8ce58f99801200d4d3d0412c7cc1b28 (diff) | |
download | FreeBSD-src-96bad46eee8bf907dceb152bbb9d128bed5a4956.zip FreeBSD-src-96bad46eee8bf907dceb152bbb9d128bed5a4956.tar.gz |
Gcc 3.4.2 20040728 C++ support bits.
Diffstat (limited to 'contrib/libstdc++/libsupc++/vec.cc')
-rw-r--r-- | contrib/libstdc++/libsupc++/vec.cc | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/contrib/libstdc++/libsupc++/vec.cc b/contrib/libstdc++/libsupc++/vec.cc index 557fd03..86d41d9 100644 --- a/contrib/libstdc++/libsupc++/vec.cc +++ b/contrib/libstdc++/libsupc++/vec.cc @@ -1,21 +1,21 @@ // New abi Support -*- C++ -*- -// Copyright (C) 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. // -// This file is part of GNU CC. +// This file is part of GCC. // -// GNU CC is free software; you can redistribute it and/or modify +// GCC 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. -// GNU CC is distributed in the hope that it will be useful, +// GCC 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 GNU CC; see the file COPYING. If not, write to +// along with GCC; see the file COPYING. If not, write to // the Free Software Foundation, 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. @@ -42,13 +42,19 @@ namespace __cxxabiv1 { struct uncatch_exception { - uncatch_exception (); + uncatch_exception(); ~uncatch_exception () { __cxa_begin_catch (&p->unwindHeader); } - __cxa_exception *p; + __cxa_exception* p; + + private: + uncatch_exception& + operator=(const uncatch_exception&); + + uncatch_exception(const uncatch_exception&); }; - uncatch_exception::uncatch_exception () + uncatch_exception::uncatch_exception() : p(0) { __cxa_eh_globals *globals = __cxa_get_globals_fast (); @@ -83,7 +89,9 @@ namespace __cxxabiv1 { std::size_t size = element_count * element_size + padding_size; char *base = static_cast <char *> (alloc (size)); - + if (!base) + return base; + if (padding_size) { base += padding_size; @@ -116,6 +124,8 @@ namespace __cxxabiv1 { std::size_t size = element_count * element_size + padding_size; char *base = static_cast<char *>(alloc (size)); + if (!base) + return base; if (padding_size) { @@ -278,7 +288,10 @@ namespace __cxxabiv1 void (*destructor) (void *), void (*dealloc) (void *)) { - char *base = static_cast<char *>(array_address); + if (!array_address) + return; + + char* base = static_cast<char *>(array_address); if (padding_size) { @@ -308,9 +321,12 @@ namespace __cxxabiv1 void (*destructor) (void *), void (*dealloc) (void *, std::size_t)) { - char *base = static_cast <char *> (array_address); + if (!array_address) + return; + + 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]; |