diff options
Diffstat (limited to 'libstdc++-v3/src')
61 files changed, 583 insertions, 254 deletions
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 21a1bfd3f8a..d6618f0f8c0 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -147,8 +147,9 @@ basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC) $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true if ENABLE_PARALLEL -parallel_sources = parallel_list.cc parallel_settings.cc \ - compatibility-parallel_list.cc +parallel_sources = parallel_settings.cc \ + compatibility-parallel_list.cc \ + compatibility-parallel_list-2.cc else parallel_sources = endif @@ -169,7 +170,9 @@ sources = \ compatibility.cc \ compatibility-c++0x.cc \ compatibility-debug_list.cc \ + compatibility-debug_list-2.cc \ compatibility-list.cc \ + compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ debug.cc \ @@ -185,7 +188,6 @@ sources = \ ios_locale.cc \ limits.cc \ list.cc \ - debug_list.cc \ locale.cc \ locale_init.cc \ locale_facets.cc \ @@ -259,20 +261,20 @@ concept-inst.o: concept-inst.cc # Use special rules for parallel mode compilation. PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp -parallel_list.lo: parallel_list.cc - $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< -parallel_list.o: parallel_list.cc - $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< - parallel_settings.lo: parallel_settings.cc $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< parallel_settings.o: parallel_settings.cc $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< compatibility-parallel_list.lo: compatibility-parallel_list.cc - $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< + $(LTCXXCOMPILE) -c $< compatibility-parallel_list.o: compatibility-parallel_list.cc - $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< + $(CXXCOMPILE) -c $< + +compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc + $(CXXCOMPILE) -c $< # Use special rules for the C++0x sources so that the proper flags are passed. functexcept.lo: functexcept.cc diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 6776eb7e4bb..4d8eb33736e 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -92,19 +92,20 @@ am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \ ctype_members.lo messages_members.lo monetary_members.lo \ numeric_members.lo time_members.lo @GLIBCXX_LDBL_COMPAT_TRUE@am__objects_2 = compatibility-ldbl.lo -@ENABLE_PARALLEL_TRUE@am__objects_3 = parallel_list.lo \ -@ENABLE_PARALLEL_TRUE@ parallel_settings.lo \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.lo +@ENABLE_PARALLEL_TRUE@am__objects_3 = parallel_settings.lo \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.lo \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.lo am__objects_4 = basic_file.lo c++locale.lo $(am__objects_2) \ $(am__objects_3) am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \ mt_allocator.lo codecvt.lo compatibility.lo \ compatibility-c++0x.lo compatibility-debug_list.lo \ - compatibility-list.lo complex_io.lo ctype.lo debug.lo \ + compatibility-debug_list-2.lo compatibility-list.lo \ + compatibility-list-2.lo complex_io.lo ctype.lo debug.lo \ functexcept.lo globals_io.lo hash_c++0x.lo hash_tr1.lo \ hashtable_c++0x.lo hashtable_tr1.lo ios.lo ios_failure.lo \ - ios_init.lo ios_locale.lo limits.lo list.lo debug_list.lo \ - locale.lo locale_init.lo locale_facets.lo localename.lo \ + ios_init.lo ios_locale.lo limits.lo list.lo locale.lo \ + locale_init.lo locale_facets.lo localename.lo \ math_stubs_float.lo math_stubs_long_double.lo stdexcept.lo \ strstream.lo system_error.lo tree.lo allocator-inst.lo \ concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \ @@ -369,8 +370,9 @@ host_sources_extra = \ basic_file.cc c++locale.cc ${ldbl_compat_sources} ${parallel_sources} @ENABLE_PARALLEL_FALSE@parallel_sources = -@ENABLE_PARALLEL_TRUE@parallel_sources = parallel_list.cc parallel_settings.cc \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc +@ENABLE_PARALLEL_TRUE@parallel_sources = parallel_settings.cc \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.cc @GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources = @GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc @@ -385,7 +387,9 @@ sources = \ compatibility.cc \ compatibility-c++0x.cc \ compatibility-debug_list.cc \ + compatibility-debug_list-2.cc \ compatibility-list.cc \ + compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ debug.cc \ @@ -401,7 +405,6 @@ sources = \ ios_locale.cc \ limits.cc \ list.cc \ - debug_list.cc \ locale.cc \ locale_init.cc \ locale_facets.cc \ @@ -847,20 +850,20 @@ concept-inst.lo: concept-inst.cc $(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $< concept-inst.o: concept-inst.cc $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $< -parallel_list.lo: parallel_list.cc - $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< -parallel_list.o: parallel_list.cc - $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< - parallel_settings.lo: parallel_settings.cc $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< parallel_settings.o: parallel_settings.cc $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< compatibility-parallel_list.lo: compatibility-parallel_list.cc - $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< + $(LTCXXCOMPILE) -c $< compatibility-parallel_list.o: compatibility-parallel_list.cc - $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< + $(CXXCOMPILE) -c $< + +compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc + $(CXXCOMPILE) -c $< # Use special rules for the C++0x sources so that the proper flags are passed. functexcept.lo: functexcept.cc diff --git a/libstdc++-v3/src/allocator-inst.cc b/libstdc++-v3/src/allocator-inst.cc index 9c6a2490da3..801468016d2 100644 --- a/libstdc++-v3/src/allocator-inst.cc +++ b/libstdc++-v3/src/allocator-inst.cc @@ -29,9 +29,12 @@ #include <memory> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class allocator<char>; template class allocator<wchar_t>; -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/atomic.cc b/libstdc++-v3/src/atomic.cc index 822e022b7e5..e655dd3e8e6 100644 --- a/libstdc++-v3/src/atomic.cc +++ b/libstdc++-v3/src/atomic.cc @@ -49,7 +49,9 @@ namespace }; } // anonymous namespace -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __atomic0 { @@ -116,7 +118,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } // namespace __atomic0 -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated diff --git a/libstdc++-v3/src/bitmap_allocator.cc b/libstdc++-v3/src/bitmap_allocator.cc index 8394ef67137..a9f3a77ba2d 100644 --- a/libstdc++-v3/src/bitmap_allocator.cc +++ b/libstdc++-v3/src/bitmap_allocator.cc @@ -1,6 +1,6 @@ // Bitmap Allocator. Out of line function definitions. -*- C++ -*- -// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -25,10 +25,11 @@ #include <ext/bitmap_allocator.h> -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ namespace __detail { + _GLIBCXX_BEGIN_NAMESPACE_VERSION template class __mini_vector< std::pair<bitmap_allocator<char>::_Alloc_block*, bitmap_allocator<char>::_Alloc_block*> >; @@ -41,8 +42,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template size_t** __lower_bound(size_t**, size_t**, size_t const&, free_list::_LT_pointer_compare); + _GLIBCXX_END_NAMESPACE_VERSION } +_GLIBCXX_BEGIN_NAMESPACE_VERSION + size_t* free_list:: _M_get(size_t __sz) throw(std::bad_alloc) @@ -120,4 +124,5 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template class bitmap_allocator<char>; template class bitmap_allocator<wchar_t>; -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/chrono.cc b/libstdc++-v3/src/chrono.cc index 4dcd74bcee3..6b5e669a7dc 100644 --- a/libstdc++-v3/src/chrono.cc +++ b/libstdc++-v3/src/chrono.cc @@ -1,6 +1,6 @@ // chrono -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011 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 @@ -33,11 +33,13 @@ #include <sys/time.h> #endif -_GLIBCXX_BEGIN_NAMESPACE(std) - +namespace std _GLIBCXX_VISIBILITY(default) +{ namespace chrono { - constexpr bool system_clock::is_monotonic; + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + constexpr bool system_clock::is_monotonic; system_clock::time_point system_clock::now() throw () @@ -73,8 +75,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + chrono::nanoseconds(tp.tv_nsec))); } #endif - } -_GLIBCXX_END_NAMESPACE + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace chrono +} // namespace std #endif // _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc index f88eda59c4e..fdb0896caa2 100644 --- a/libstdc++-v3/src/codecvt.cc +++ b/libstdc++-v3/src/codecvt.cc @@ -24,7 +24,9 @@ #include <locale> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for locale::id of standard facets that are specialized. locale::id codecvt<char, char, mbstate_t>::id; @@ -145,4 +147,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return false; } #endif // _GLIBCXX_USE_WCHAR_T -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/compatibility-c++0x.cc b/libstdc++-v3/src/compatibility-c++0x.cc index 4941b17a3fd..08a572761f9 100644 --- a/libstdc++-v3/src/compatibility-c++0x.cc +++ b/libstdc++-v3/src/compatibility-c++0x.cc @@ -30,7 +30,7 @@ # error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" #endif -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { // gcc-4.4.0 // <mutex> exported std::lock_error diff --git a/libstdc++-v3/src/debug_list.cc b/libstdc++-v3/src/compatibility-debug_list-2.cc index 64bfe87f103..c032ff8598b 100644 --- a/libstdc++-v3/src/debug_list.cc +++ b/libstdc++-v3/src/compatibility-debug_list-2.cc @@ -1,6 +1,6 @@ -// Debugging mode support code for list -*- C++ -*- +// Compatibility symbols for previous versions, debug list -*- C++ -*- -// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// Copyright (C) 2011 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 @@ -22,7 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -#define _GLIBCXX_DEBUG - -#include "list.cc" +#define _GLIBCXX_BEGIN_NAMESPACE_COMPAT namespace __norm { +#define _GLIBCXX_END_NAMESPACE_COMPAT } +#include "compatibility-list-2.cc" diff --git a/libstdc++-v3/src/compatibility-debug_list.cc b/libstdc++-v3/src/compatibility-debug_list.cc index 3f14a534250..76cceec7205 100644 --- a/libstdc++-v3/src/compatibility-debug_list.cc +++ b/libstdc++-v3/src/compatibility-debug_list.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, debug list -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 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 @@ -22,6 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -#define _GLIBCXX_DEBUG +#define _GLIBCXX_BEGIN_NAMESPACE_COMPAT namespace __norm { +#define _GLIBCXX_END_NAMESPACE_COMPAT } #include "compatibility-list.cc" diff --git a/libstdc++-v3/src/compatibility-ldbl.cc b/libstdc++-v3/src/compatibility-ldbl.cc index 25cbf70a3a7..a9bdb8b0986 100644 --- a/libstdc++-v3/src/compatibility-ldbl.cc +++ b/libstdc++-v3/src/compatibility-ldbl.cc @@ -33,7 +33,7 @@ #error "compatibility-ldbl.cc must be compiled with -mlong-double-64" #endif -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { #define C char template class num_get<C, istreambuf_iterator<C> >; @@ -70,7 +70,7 @@ namespace std // For std::tr1::hash<long double>::operator() #define _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { namespace tr1 { diff --git a/libstdc++-v3/src/compatibility-list-2.cc b/libstdc++-v3/src/compatibility-list-2.cc new file mode 100644 index 00000000000..58f8cea55f2 --- /dev/null +++ b/libstdc++-v3/src/compatibility-list-2.cc @@ -0,0 +1,111 @@ +// Compatibility symbols for previous versions, list bits -*- C++ -*- + +// Copyright (C) 2011 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// <http://www.gnu.org/licenses/>. + +#include <bits/move.h> + +#ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT +# define _GLIBCXX_BEGIN_NAMESPACE_COMPAT +#endif + +#ifndef _GLIBCXX_END_NAMESPACE_COMPAT +# define _GLIBCXX_END_NAMESPACE_COMPAT +#endif + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_COMPAT + + struct _List_node_base + { + _List_node_base* _M_next; + _List_node_base* _M_prev; + + void + _M_transfer(_List_node_base * const __first, + _List_node_base * const __last) throw (); + + void + _M_reverse() throw (); + + void + _M_hook(_List_node_base * const __position) throw (); + + void + _M_unhook() throw (); + }; + + void + _List_node_base::_M_transfer(_List_node_base * const __first, + _List_node_base * const __last) throw () + { + if (this != __last) + { + // Remove [first, last) from its old position. + __last->_M_prev->_M_next = this; + __first->_M_prev->_M_next = __last; + this->_M_prev->_M_next = __first; + + // Splice [first, last) into its new position. + _List_node_base* const __tmp = this->_M_prev; + this->_M_prev = __last->_M_prev; + __last->_M_prev = __first->_M_prev; + __first->_M_prev = __tmp; + } + } + + void + _List_node_base::_M_reverse() throw () + { + _List_node_base* __tmp = this; + do + { + std::swap(__tmp->_M_next, __tmp->_M_prev); + + // Old next node is now prev. + __tmp = __tmp->_M_prev; + } + while (__tmp != this); + } + + void + _List_node_base::_M_hook(_List_node_base* const __position) throw () + { + this->_M_next = __position; + this->_M_prev = __position->_M_prev; + __position->_M_prev->_M_next = this; + __position->_M_prev = this; + } + + void + _List_node_base::_M_unhook() throw () + { + _List_node_base* const __next_node = this->_M_next; + _List_node_base* const __prev_node = this->_M_prev; + __prev_node->_M_next = __next_node; + __next_node->_M_prev = __prev_node; + } + +_GLIBCXX_END_NAMESPACE_COMPAT + +} // namespace std diff --git a/libstdc++-v3/src/compatibility-list.cc b/libstdc++-v3/src/compatibility-list.cc index 57a2df97b7e..a0d706b27a9 100644 --- a/libstdc++-v3/src/compatibility-list.cc +++ b/libstdc++-v3/src/compatibility-list.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, list bits -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 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 @@ -24,13 +24,26 @@ #include <bits/move.h> -_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) +#ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT +# define _GLIBCXX_BEGIN_NAMESPACE_COMPAT +#endif + +#ifndef _GLIBCXX_END_NAMESPACE_COMPAT +# define _GLIBCXX_END_NAMESPACE_COMPAT +#endif + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_COMPAT struct _List_node_base { _List_node_base* _M_next; _List_node_base* _M_prev; + static void + swap(_List_node_base& __x, _List_node_base& __y) throw (); + void transfer(_List_node_base * const __first, _List_node_base * const __last) throw (); @@ -46,8 +59,40 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) }; void + _List_node_base::swap(_List_node_base& __x, _List_node_base& __y) throw() + { + if ( __x._M_next != &__x ) + { + if ( __y._M_next != &__y ) + { + // Both __x and __y are not empty. + std::swap(__x._M_next,__y._M_next); + std::swap(__x._M_prev,__y._M_prev); + __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; + __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; + } + else + { + // __x is not empty, __y is empty. + __y._M_next = __x._M_next; + __y._M_prev = __x._M_prev; + __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; + __x._M_next = __x._M_prev = &__x; + } + } + else if ( __y._M_next != &__y ) + { + // __x is empty, __y is not empty. + __x._M_next = __y._M_next; + __x._M_prev = __y._M_prev; + __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; + __y._M_next = __y._M_prev = &__y; + } + } + + void _List_node_base::transfer(_List_node_base * const __first, - _List_node_base * const __last) throw () + _List_node_base * const __last) throw () { if (this != __last) { @@ -55,7 +100,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __last->_M_prev->_M_next = this; __first->_M_prev->_M_next = __last; this->_M_prev->_M_next = __first; - + // Splice [first, last) into its new position. _List_node_base* const __tmp = this->_M_prev; this->_M_prev = __last->_M_prev; @@ -73,8 +118,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) std::swap(__tmp->_M_next, __tmp->_M_prev); // Old next node is now prev. - __tmp = __tmp->_M_prev; - } + __tmp = __tmp->_M_prev; + } while (__tmp != this); } @@ -96,4 +141,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __next_node->_M_prev = __prev_node; } -_GLIBCXX_END_NESTED_NAMESPACE +_GLIBCXX_END_NAMESPACE_COMPAT + +} // namespace std diff --git a/libstdc++-v3/src/parallel_list.cc b/libstdc++-v3/src/compatibility-parallel_list-2.cc index 7120c13edd8..8dc837a361a 100644 --- a/libstdc++-v3/src/parallel_list.cc +++ b/libstdc++-v3/src/compatibility-parallel_list-2.cc @@ -1,6 +1,6 @@ -// Parallel mode support code for list -*- C++ -*- +// Compatibility symbols for previous versions, parallel list -*- C++ -*- -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2011 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 @@ -22,4 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -#include "list.cc" +#define _GLIBCXX_BEGIN_NAMESPACE_COMPAT namespace __cxx1998 { +#define _GLIBCXX_END_NAMESPACE_COMPAT } + +#include "compatibility-list-2.cc" diff --git a/libstdc++-v3/src/compatibility-parallel_list.cc b/libstdc++-v3/src/compatibility-parallel_list.cc index d9d7b60fd34..05e50fa569d 100644 --- a/libstdc++-v3/src/compatibility-parallel_list.cc +++ b/libstdc++-v3/src/compatibility-parallel_list.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, parallel list -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 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 @@ -22,4 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. +#define _GLIBCXX_BEGIN_NAMESPACE_COMPAT namespace __cxx1998 { +#define _GLIBCXX_END_NAMESPACE_COMPAT } + #include "compatibility-list.cc" diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc index 7dcd95cb171..d5d39b3317a 100644 --- a/libstdc++-v3/src/compatibility.cc +++ b/libstdc++-v3/src/compatibility.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -50,7 +50,9 @@ #include <cmath> #include <ext/numeric_traits.h> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // std::istream ignore explicit specializations. template<> @@ -196,7 +198,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // NB: These symbols renames should go into the shared library only, @@ -210,7 +213,9 @@ _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv */ -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template istreambuf_iterator<char>& @@ -222,7 +227,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) istreambuf_iterator<wchar_t>::operator++(); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace /* gcc-4.0.0 @@ -254,7 +260,9 @@ _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv _ZNSt11char_traitsIcE2eqERKcS2_ _ZNSt11char_traitsIwE2eqERKwS2_ */ -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // std::char_traits is explicitly specialized bool (* __p1)(const char&, const char&) = &char_traits<char>::eq; @@ -348,7 +356,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) basic_ofstream<wchar_t>::is_open() const; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // The rename syntax for default exported names is // asm (".symver name1,exportedname@GLIBCXX_3.4") @@ -387,24 +396,24 @@ _ZN10__gnu_norm15_List_node_base6unhookEv; _ZN10__gnu_norm15_List_node_base7reverseEv; _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_; */ -#include "list.cc" -_GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX7_M_hookEPS_, \ +#include "list.cc" +_GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX7_M_hookEPS0_, \ _ZN10__gnu_norm15_List_node_base4hookEPS0_, \ GLIBCXX_3.4) -_GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX4swapERS_S0_, \ +_GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX4swapERS0_S1_, \ _ZN10__gnu_norm15_List_node_base4swapERS0_S1_, \ GLIBCXX_3.4) -_GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX9_M_unhookEv, \ +_GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX9_M_unhookEv, \ _ZN10__gnu_norm15_List_node_base6unhookEv, \ GLIBCXX_3.4) -_GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX10_M_reverseEv, \ +_GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX10_M_reverseEv, \ _ZN10__gnu_norm15_List_node_base7reverseEv, \ GLIBCXX_3.4) -_GLIBCXX_ASM_SYMVER(_ZNSt17_List_node_baseXX11_M_transferEPS_S0_, \ +_GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX11_M_transferEPS0_S1_, \ _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_, \ GLIBCXX_3.4) #undef _List_node_base diff --git a/libstdc++-v3/src/complex_io.cc b/libstdc++-v3/src/complex_io.cc index 636bc67b469..4e4aeef46f7 100644 --- a/libstdc++-v3/src/complex_io.cc +++ b/libstdc++-v3/src/complex_io.cc @@ -24,7 +24,9 @@ #include <complex> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_istream<char, char_traits<char> >& @@ -86,7 +88,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const complex<long double>&); #endif //_GLIBCXX_USE_WCHAR_T -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT diff --git a/libstdc++-v3/src/concept-inst.cc b/libstdc++-v3/src/concept-inst.cc index e89d16c1f43..829d0db0b68 100644 --- a/libstdc++-v3/src/concept-inst.cc +++ b/libstdc++-v3/src/concept-inst.cc @@ -39,7 +39,9 @@ #define _Instantiate(...) template void __function_requires< __VA_ARGS__ > () -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template void __aux_require_boolean_expr<bool>(bool const&); @@ -101,7 +103,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _Instantiate(_RandomAccessIteratorConcept<wchar_t const*> ); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace #undef _Instantiate diff --git a/libstdc++-v3/src/condition_variable.cc b/libstdc++-v3/src/condition_variable.cc index e7adb5251be..7f1e1946a55 100644 --- a/libstdc++-v3/src/condition_variable.cc +++ b/libstdc++-v3/src/condition_variable.cc @@ -26,7 +26,9 @@ #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION condition_variable::condition_variable() throw () { @@ -85,6 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) condition_variable_any::~condition_variable_any() throw () { } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/src/ctype.cc b/libstdc++-v3/src/ctype.cc index b44a22e54d0..04d31cc5744 100644 --- a/libstdc++-v3/src/ctype.cc +++ b/libstdc++-v3/src/ctype.cc @@ -26,7 +26,9 @@ #include <cstdlib> #include <cstring> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for static const data members of ctype_base. const ctype_base::mask ctype_base::space; @@ -133,4 +135,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/ext-inst.cc b/libstdc++-v3/src/ext-inst.cc index ae942c78d43..831f37cf14e 100644 --- a/libstdc++-v3/src/ext-inst.cc +++ b/libstdc++-v3/src/ext-inst.cc @@ -29,7 +29,9 @@ #include <ext/rope> #include <ext/stdio_filebuf.h> -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION namespace { @@ -60,4 +62,5 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template class stdio_filebuf<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/fstream-inst.cc b/libstdc++-v3/src/fstream-inst.cc index 761cbff3bc5..cd7a6cd4546 100644 --- a/libstdc++-v3/src/fstream-inst.cc +++ b/libstdc++-v3/src/fstream-inst.cc @@ -29,7 +29,9 @@ #include <fstream> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class basic_filebuf<char, char_traits<char> >; template class basic_ifstream<char>; @@ -43,4 +45,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template class basic_fstream<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/functexcept.cc b/libstdc++-v3/src/functexcept.cc index 1990c3061f5..5cd5ea3b194 100644 --- a/libstdc++-v3/src/functexcept.cc +++ b/libstdc++-v3/src/functexcept.cc @@ -39,7 +39,9 @@ # define _(msgid) (msgid) #endif -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION #if __EXCEPTIONS void @@ -180,4 +182,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) #endif //__EXCEPTIONS -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/future.cc b/libstdc++-v3/src/future.cc index 6f40c0da32e..cbce2b1a757 100644 --- a/libstdc++-v3/src/future.cc +++ b/libstdc++-v3/src/future.cc @@ -64,7 +64,9 @@ namespace } } -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION const error_category& future_category() { return __future_category_instance(); } @@ -74,7 +76,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const char* future_error::what() const throw() { return _M_code.message().c_str(); } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated // gcc-4.6.0 @@ -83,7 +86,7 @@ _GLIBCXX_END_NAMESPACE && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) -namespace __gnu_cxx +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { const std::error_category* future_category = &__future_category_instance(); } diff --git a/libstdc++-v3/src/globals_io.cc b/libstdc++-v3/src/globals_io.cc index 3b36e086203..722abacbe84 100644 --- a/libstdc++-v3/src/globals_io.cc +++ b/libstdc++-v3/src/globals_io.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -44,7 +44,9 @@ // In macro form: // _GLIBCXX_ASM_SYMVER(currentname, oldname, GLIBCXX_3.2) -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Standard stream objects. // NB: Iff <iostream> is included, these definitions become wonky. @@ -68,9 +70,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) fake_wostream wclog; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -namespace __gnu_internal _GLIBCXX_VISIBILITY_ATTR(hidden) +namespace __gnu_internal _GLIBCXX_VISIBILITY(hidden) { using namespace std; using namespace __gnu_cxx; diff --git a/libstdc++-v3/src/hash_c++0x.cc b/libstdc++-v3/src/hash_c++0x.cc index ba007f84b54..852498df602 100644 --- a/libstdc++-v3/src/hash_c++0x.cc +++ b/libstdc++-v3/src/hash_c++0x.cc @@ -28,7 +28,7 @@ #include <bits/functional_hash.h> -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { #include "hash-long-double-aux.cc" } diff --git a/libstdc++-v3/src/hash_tr1.cc b/libstdc++-v3/src/hash_tr1.cc index 03f3ad3c094..e707e827a11 100644 --- a/libstdc++-v3/src/hash_tr1.cc +++ b/libstdc++-v3/src/hash_tr1.cc @@ -25,7 +25,7 @@ #include <string> #include <tr1/functional> -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { namespace tr1 { diff --git a/libstdc++-v3/src/hashtable-aux.cc b/libstdc++-v3/src/hashtable-aux.cc index 8bd3afb0903..23bb00ec584 100644 --- a/libstdc++-v3/src/hashtable-aux.cc +++ b/libstdc++-v3/src/hashtable-aux.cc @@ -1,6 +1,6 @@ // std::__detail and std::tr1::__detail definitions -*- C++ -*- -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2007, 2009, 2011 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 @@ -22,8 +22,11 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. +#include <bits/c++config.h> + namespace __detail { +_GLIBCXX_BEGIN_NAMESPACE_VERSION extern const unsigned long __prime_list[] = // 256 + 1 or 256 + 48 + 1 { 2ul, 3ul, 5ul, 7ul, 11ul, 13ul, 17ul, 19ul, 23ul, 29ul, 31ul, @@ -88,4 +91,5 @@ namespace __detail 18446744073709551557ul, 18446744073709551557ul #endif }; +_GLIBCXX_END_NAMESPACE_VERSION } // namespace __detail diff --git a/libstdc++-v3/src/hashtable_c++0x.cc b/libstdc++-v3/src/hashtable_c++0x.cc index 0b5f79cc6f1..c9026acdfff 100644 --- a/libstdc++-v3/src/hashtable_c++0x.cc +++ b/libstdc++-v3/src/hashtable_c++0x.cc @@ -28,8 +28,7 @@ # error "hashtable_c++0x.cc must be compiled with -std=gnu++0x" #endif -_GLIBCXX_BEGIN_NAMESPACE(std) - +namespace std _GLIBCXX_VISIBILITY(default) +{ #include "hashtable-aux.cc" - -_GLIBCXX_END_NAMESPACE // namespace std +} // namespace // namespace std diff --git a/libstdc++-v3/src/hashtable_tr1.cc b/libstdc++-v3/src/hashtable_tr1.cc index 70de1bdf310..32d5b63dca8 100644 --- a/libstdc++-v3/src/hashtable_tr1.cc +++ b/libstdc++-v3/src/hashtable_tr1.cc @@ -1,6 +1,6 @@ // std::__detail definitions -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 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 @@ -22,7 +22,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -namespace std +#include <bits/c++config.h> + +namespace std _GLIBCXX_VISIBILITY(default) { namespace tr1 { diff --git a/libstdc++-v3/src/ios-inst.cc b/libstdc++-v3/src/ios-inst.cc index 83aa206c325..10fdaf7cd92 100644 --- a/libstdc++-v3/src/ios-inst.cc +++ b/libstdc++-v3/src/ios-inst.cc @@ -29,7 +29,9 @@ #include <ios> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class basic_ios<char>; @@ -37,4 +39,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template class basic_ios<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 66052872ac7..292f1f8d02f 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -31,7 +31,9 @@ #include <ios> #include <limits> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for static const members of ios_base. const ios_base::fmtflags ios_base::boolalpha; @@ -187,4 +189,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _M_callbacks = 0; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/ios_failure.cc b/libstdc++-v3/src/ios_failure.cc index d2ac3a64dbc..1c42f01eddd 100644 --- a/libstdc++-v3/src/ios_failure.cc +++ b/libstdc++-v3/src/ios_failure.cc @@ -29,7 +29,9 @@ #include <ios> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION ios_base::failure::failure(const string& __str) throw() : _M_msg(__str) { } @@ -41,4 +43,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ios_base::failure::what() const throw() { return _M_msg.c_str(); } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/ios_init.cc b/libstdc++-v3/src/ios_init.cc index caf25ed8036..a811daf00cc 100644 --- a/libstdc++-v3/src/ios_init.cc +++ b/libstdc++-v3/src/ios_init.cc @@ -1,7 +1,7 @@ // Iostreams base classes -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -35,7 +35,7 @@ #include <ext/stdio_filebuf.h> #include <ext/stdio_sync_filebuf.h> -namespace __gnu_internal _GLIBCXX_VISIBILITY_ATTR(hidden) +namespace __gnu_internal _GLIBCXX_VISIBILITY(hidden) { using namespace __gnu_cxx; @@ -59,7 +59,9 @@ namespace __gnu_internal _GLIBCXX_VISIBILITY_ATTR(hidden) #endif } // namespace __gnu_internal -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION using namespace __gnu_internal; @@ -199,4 +201,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __ret; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/ios_locale.cc b/libstdc++-v3/src/ios_locale.cc index 8b1873e7d49..b98b96c6222 100644 --- a/libstdc++-v3/src/ios_locale.cc +++ b/libstdc++-v3/src/ios_locale.cc @@ -31,7 +31,9 @@ #include <ios> #include <locale> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Called only by basic_ios<>::init. void @@ -54,4 +56,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __old; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/iostream-inst.cc b/libstdc++-v3/src/iostream-inst.cc index 02c681a4d26..60f52061e06 100644 --- a/libstdc++-v3/src/iostream-inst.cc +++ b/libstdc++-v3/src/iostream-inst.cc @@ -31,7 +31,9 @@ #include <iomanip> #include <istream> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class _Setfill<char>; template _Setfill<char> setfill(char); @@ -43,4 +45,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template class basic_iostream<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/istream-inst.cc b/libstdc++-v3/src/istream-inst.cc index 671374f9d5b..4d3bc1a74dc 100644 --- a/libstdc++-v3/src/istream-inst.cc +++ b/libstdc++-v3/src/istream-inst.cc @@ -30,7 +30,9 @@ #include <istream> #include <iomanip> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class basic_istream<char>; template istream& ws(istream&); @@ -90,7 +92,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template wistream& wistream::_M_extract(void*&); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT diff --git a/libstdc++-v3/src/istream.cc b/libstdc++-v3/src/istream.cc index e4102779aa8..e550306a0e6 100644 --- a/libstdc++-v3/src/istream.cc +++ b/libstdc++-v3/src/istream.cc @@ -29,7 +29,9 @@ #include <istream> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template<> basic_istream<char>& @@ -684,4 +686,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/limits.cc b/libstdc++-v3/src/limits.cc index ac46cf03a60..5a21239d1bc 100644 --- a/libstdc++-v3/src/limits.cc +++ b/libstdc++-v3/src/limits.cc @@ -32,7 +32,9 @@ #include <limits> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION #define const _GLIBCXX_USE_CONSTEXPR @@ -514,7 +516,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) #undef const -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT diff --git a/libstdc++-v3/src/list.cc b/libstdc++-v3/src/list.cc index a7a705ca680..92b007f58ae 100644 --- a/libstdc++-v3/src/list.cc +++ b/libstdc++-v3/src/list.cc @@ -1,6 +1,6 @@ // std::list utilities implementation -*- C++ -*- -// Copyright (C) 2003, 2005, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2003, 2005, 2009, 2010, 2011 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 @@ -50,89 +50,95 @@ #include <list> -_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) - - void - _List_node_base::swap(_List_node_base& __x, _List_node_base& __y) throw() +namespace std _GLIBCXX_VISIBILITY(default) +{ + namespace __detail { - if ( __x._M_next != &__x ) - { - if ( __y._M_next != &__y ) - { - // Both __x and __y are not empty. - std::swap(__x._M_next,__y._M_next); - std::swap(__x._M_prev,__y._M_prev); - __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; - __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; - } - else - { - // __x is not empty, __y is empty. - __y._M_next = __x._M_next; - __y._M_prev = __x._M_prev; - __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; - __x._M_next = __x._M_prev = &__x; - } - } - else if ( __y._M_next != &__y ) + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + void + _List_node_base::swap(_List_node_base& __x, _List_node_base& __y) throw() { - // __x is empty, __y is not empty. - __x._M_next = __y._M_next; - __x._M_prev = __y._M_prev; - __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; - __y._M_next = __y._M_prev = &__y; + if ( __x._M_next != &__x ) + { + if ( __y._M_next != &__y ) + { + // Both __x and __y are not empty. + std::swap(__x._M_next,__y._M_next); + std::swap(__x._M_prev,__y._M_prev); + __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; + __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; + } + else + { + // __x is not empty, __y is empty. + __y._M_next = __x._M_next; + __y._M_prev = __x._M_prev; + __y._M_next->_M_prev = __y._M_prev->_M_next = &__y; + __x._M_next = __x._M_prev = &__x; + } + } + else if ( __y._M_next != &__y ) + { + // __x is empty, __y is not empty. + __x._M_next = __y._M_next; + __x._M_prev = __y._M_prev; + __x._M_next->_M_prev = __x._M_prev->_M_next = &__x; + __y._M_next = __y._M_prev = &__y; + } } - } - void - _List_node_base::_M_transfer(_List_node_base * const __first, - _List_node_base * const __last) throw() - { - if (this != __last) + void + _List_node_base::_M_transfer(_List_node_base * const __first, + _List_node_base * const __last) throw() { - // Remove [first, last) from its old position. - __last->_M_prev->_M_next = this; - __first->_M_prev->_M_next = __last; - this->_M_prev->_M_next = __first; - - // Splice [first, last) into its new position. - _List_node_base* const __tmp = this->_M_prev; - this->_M_prev = __last->_M_prev; - __last->_M_prev = __first->_M_prev; - __first->_M_prev = __tmp; + if (this != __last) + { + // Remove [first, last) from its old position. + __last->_M_prev->_M_next = this; + __first->_M_prev->_M_next = __last; + this->_M_prev->_M_next = __first; + + // Splice [first, last) into its new position. + _List_node_base* const __tmp = this->_M_prev; + this->_M_prev = __last->_M_prev; + __last->_M_prev = __first->_M_prev; + __first->_M_prev = __tmp; + } } - } - void - _List_node_base::_M_reverse() throw() - { - _List_node_base* __tmp = this; - do + void + _List_node_base::_M_reverse() throw() { - std::swap(__tmp->_M_next, __tmp->_M_prev); + _List_node_base* __tmp = this; + do + { + std::swap(__tmp->_M_next, __tmp->_M_prev); - // Old next node is now prev. - __tmp = __tmp->_M_prev; - } - while (__tmp != this); - } + // Old next node is now prev. + __tmp = __tmp->_M_prev; + } + while (__tmp != this); + } - void - _List_node_base::_M_hook(_List_node_base* const __position) throw() - { - this->_M_next = __position; - this->_M_prev = __position->_M_prev; - __position->_M_prev->_M_next = this; - __position->_M_prev = this; - } + void + _List_node_base::_M_hook(_List_node_base* const __position) throw() + { + this->_M_next = __position; + this->_M_prev = __position->_M_prev; + __position->_M_prev->_M_next = this; + __position->_M_prev = this; + } - void - _List_node_base::_M_unhook() throw() - { - _List_node_base* const __next_node = this->_M_next; - _List_node_base* const __prev_node = this->_M_prev; - __prev_node->_M_next = __next_node; - __next_node->_M_prev = __prev_node; - } + void + _List_node_base::_M_unhook() throw() + { + _List_node_base* const __next_node = this->_M_next; + _List_node_base* const __prev_node = this->_M_prev; + __prev_node->_M_next = __next_node; + __next_node->_M_prev = __prev_node; + } -_GLIBCXX_END_NESTED_NAMESPACE + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace __detail +} // namespace std diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 0418c6fa0f1..e77c5c95d69 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -1,7 +1,7 @@ // Locale support -*- C++ -*- // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -// 2009 Free Software Foundation, Inc. +// 2009, 2011 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 @@ -35,7 +35,9 @@ # define C_is_char #endif -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // moneypunct, money_get, and money_put template class moneypunct<C, false>; @@ -44,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template struct __moneypunct_cache<C, true>; template class moneypunct_byname<C, false>; template class moneypunct_byname<C, true>; -_GLIBCXX_BEGIN_LDBL_NAMESPACE +_GLIBCXX_BEGIN_NAMESPACE_LDBL template class money_get<C, istreambuf_iterator<C> >; template class money_put<C, ostreambuf_iterator<C> >; template @@ -70,13 +72,13 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE money_put<C, ostreambuf_iterator<C> >:: _M_insert<false>(ostreambuf_iterator<C>, ios_base&, C, const string_type&) const; -_GLIBCXX_END_LDBL_NAMESPACE +_GLIBCXX_END_NAMESPACE_LDBL // numpunct, numpunct_byname, num_get, and num_put template class numpunct<C>; template struct __numpunct_cache<C>; template class numpunct_byname<C>; -_GLIBCXX_BEGIN_LDBL_NAMESPACE +_GLIBCXX_BEGIN_NAMESPACE_LDBL template class num_get<C, istreambuf_iterator<C> >; template class num_put<C, ostreambuf_iterator<C> >; template @@ -160,7 +162,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE num_put<C, ostreambuf_iterator<C> >:: _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char, long double) const; -_GLIBCXX_END_LDBL_NAMESPACE +_GLIBCXX_END_NAMESPACE_LDBL // time_get and time_put template class __timepunct<C>; @@ -317,7 +319,8 @@ _GLIBCXX_END_LDBL_NAMESPACE ios_base::fmtflags, bool); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined C_is_char diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 937e99c8b14..09dccf0d7d3 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -55,7 +55,9 @@ _GLIBCXX_LOC_ID (_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2 # endif #endif -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for static const data members of locale. const locale::category locale::none; @@ -438,4 +440,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return _M_index - 1; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/locale_facets.cc b/libstdc++-v3/src/locale_facets.cc index 77686c6c3ea..92552227f80 100644 --- a/libstdc++-v3/src/locale_facets.cc +++ b/libstdc++-v3/src/locale_facets.cc @@ -24,7 +24,9 @@ #include <locale> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for static const data members of time_base. template<> @@ -112,4 +114,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __test; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/locale_init.cc b/libstdc++-v3/src/locale_init.cc index 45f67f67e31..98c228cf15f 100644 --- a/libstdc++-v3/src/locale_init.cc +++ b/libstdc++-v3/src/locale_init.cc @@ -203,7 +203,9 @@ namespace #endif } // anonymous namespace -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION locale::locale() throw() : _M_impl(0) { @@ -468,4 +470,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) #endif } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc index 6d4306adb68..52e22828191 100644 --- a/libstdc++-v3/src/localename.cc +++ b/libstdc++-v3/src/localename.cc @@ -27,7 +27,9 @@ #include <cstdlib> #include <locale> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION using namespace __gnu_cxx; @@ -348,4 +350,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc index f4101784a4e..ad09c9b84dd 100644 --- a/libstdc++-v3/src/misc-inst.cc +++ b/libstdc++-v3/src/misc-inst.cc @@ -32,7 +32,9 @@ #include <ostream> #include <ext/stdio_sync_filebuf.h> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // string related to iostreams template @@ -62,15 +64,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std) getline(basic_istream<wchar_t>&, wstring&); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class stdio_sync_filebuf<char>; #ifdef _GLIBCXX_USE_WCHAR_T template class stdio_sync_filebuf<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/mt_allocator.cc b/libstdc++-v3/src/mt_allocator.cc index b04fe5b05e4..16c2fb8063e 100644 --- a/libstdc++-v3/src/mt_allocator.cc +++ b/libstdc++-v3/src/mt_allocator.cc @@ -84,7 +84,9 @@ namespace #endif } // anonymous namespace -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION void __pool<false>::_M_destroy() throw() @@ -812,4 +814,5 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template class __mt_alloc<char>; template class __mt_alloc<wchar_t>; -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/mutex.cc b/libstdc++-v3/src/mutex.cc index e6eb6d28a72..d6f2f03700f 100644 --- a/libstdc++-v3/src/mutex.cc +++ b/libstdc++-v3/src/mutex.cc @@ -37,7 +37,9 @@ namespace } #endif -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION #ifdef _GLIBCXX_HAVE_TLS __thread void* __once_callable; @@ -89,7 +91,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated // gcc-4.6.0 @@ -98,7 +101,7 @@ _GLIBCXX_END_NAMESPACE && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) -namespace __gnu_cxx +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { std::defer_lock_t defer_lock; std::try_to_lock_t try_to_lock; diff --git a/libstdc++-v3/src/ostream-inst.cc b/libstdc++-v3/src/ostream-inst.cc index 9c0163393df..9c25228771b 100644 --- a/libstdc++-v3/src/ostream-inst.cc +++ b/libstdc++-v3/src/ostream-inst.cc @@ -30,7 +30,9 @@ #include <ostream> #include <iomanip> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // ostream template class basic_ostream<char>; @@ -93,7 +95,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template wostream& wostream::_M_insert(const void*); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace // XXX GLIBCXX_ABI Deprecated #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT diff --git a/libstdc++-v3/src/placeholders.cc b/libstdc++-v3/src/placeholders.cc index 1d68bb7cf9e..967ce178a32 100644 --- a/libstdc++-v3/src/placeholders.cc +++ b/libstdc++-v3/src/placeholders.cc @@ -28,10 +28,11 @@ #include <functional> -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { namespace placeholders { + _GLIBCXX_BEGIN_NAMESPACE_VERSION extern const _Placeholder<1> _1{}; extern const _Placeholder<2> _2{}; extern const _Placeholder<3> _3{}; @@ -61,5 +62,6 @@ namespace std extern const _Placeholder<27> _27{}; extern const _Placeholder<28> _28{}; extern const _Placeholder<29> _29{}; + _GLIBCXX_END_NAMESPACE_VERSION } } diff --git a/libstdc++-v3/src/pool_allocator.cc b/libstdc++-v3/src/pool_allocator.cc index 80f07ba863b..f94656b03ba 100644 --- a/libstdc++-v3/src/pool_allocator.cc +++ b/libstdc++-v3/src/pool_allocator.cc @@ -40,7 +40,9 @@ namespace } } // anonymous namespace -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for __pool_alloc_base. __pool_alloc_base::_Obj* volatile* @@ -171,4 +173,5 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template class __pool_alloc<char>; template class __pool_alloc<wchar_t>; -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/sstream-inst.cc b/libstdc++-v3/src/sstream-inst.cc index 97d32b2a434..5c6877904dd 100644 --- a/libstdc++-v3/src/sstream-inst.cc +++ b/libstdc++-v3/src/sstream-inst.cc @@ -29,7 +29,9 @@ #include <sstream> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template class basic_stringbuf<char>; template class basic_istringstream<char>; @@ -43,4 +45,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template class basic_stringstream<wchar_t>; #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/stdexcept.cc b/libstdc++-v3/src/stdexcept.cc index 4d7ea37f697..0b78f9a9b2e 100644 --- a/libstdc++-v3/src/stdexcept.cc +++ b/libstdc++-v3/src/stdexcept.cc @@ -30,7 +30,9 @@ #include <string> #include <stdexcept> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION logic_error::logic_error(const string& __arg) : exception(), _M_msg(__arg) { } @@ -71,5 +73,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) underflow_error::underflow_error(const string& __arg) : runtime_error(__arg) { } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/streambuf-inst.cc b/libstdc++-v3/src/streambuf-inst.cc index 1b30040a734..5b563c8e173 100644 --- a/libstdc++-v3/src/streambuf-inst.cc +++ b/libstdc++-v3/src/streambuf-inst.cc @@ -30,7 +30,9 @@ #include <ios> #include <streambuf> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // streambuf template class basic_streambuf<char>; @@ -58,4 +60,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) basic_streambuf<wchar_t>*, bool&); #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/streambuf.cc b/libstdc++-v3/src/streambuf.cc index c040ae14b02..2e72559d827 100644 --- a/libstdc++-v3/src/streambuf.cc +++ b/libstdc++-v3/src/streambuf.cc @@ -28,7 +28,9 @@ #include <streambuf> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION template<> streamsize @@ -110,4 +112,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } #endif -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc index 4ba178a5ad4..879ccec7e8d 100644 --- a/libstdc++-v3/src/string-inst.cc +++ b/libstdc++-v3/src/string-inst.cc @@ -37,7 +37,9 @@ # define C char #endif -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION typedef basic_string<C> S; @@ -72,12 +74,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) S::_S_construct(const C*, const C*, const allocator<C>&, forward_iterator_tag); -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION using std::S; template bool operator==(const S::iterator&, const S::iterator&); template bool operator==(const S::const_iterator&, const S::const_iterator&); -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/strstream.cc b/libstdc++-v3/src/strstream.cc index fbc5f518297..d6c936e5f9d 100644 --- a/libstdc++-v3/src/strstream.cc +++ b/libstdc++-v3/src/strstream.cc @@ -48,7 +48,9 @@ #include <string.h> #include <limits.h> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION strstreambuf::strstreambuf(streamsize initial_capacity) : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true), @@ -411,4 +413,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) strstream::str() throw () { return _M_buf.str(); } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/system_error.cc b/libstdc++-v3/src/system_error.cc index be6af3bced8..156f8fcf7a0 100644 --- a/libstdc++-v3/src/system_error.cc +++ b/libstdc++-v3/src/system_error.cc @@ -70,7 +70,9 @@ namespace const system_error_category system_category_instance; } -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION const error_category& system_category() throw() { return system_category_instance; } @@ -96,4 +98,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) error_code::default_error_condition() const { return category().default_error_condition(value()); } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc index acc6c038531..c164e8a0161 100644 --- a/libstdc++-v3/src/thread.cc +++ b/libstdc++-v3/src/thread.cc @@ -1,6 +1,6 @@ // thread -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011 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,8 +28,8 @@ #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) -_GLIBCXX_BEGIN_NAMESPACE(std) - +namespace std _GLIBCXX_VISIBILITY(default) +{ namespace { extern "C" void* @@ -52,6 +52,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } } +_GLIBCXX_BEGIN_NAMESPACE_VERSION + void thread::join() { @@ -96,6 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/src/tree.cc b/libstdc++-v3/src/tree.cc index b5f229f4da5..0a7f6f9e485 100644 --- a/libstdc++-v3/src/tree.cc +++ b/libstdc++-v3/src/tree.cc @@ -52,7 +52,9 @@ #include <bits/stl_tree.h> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION _Rb_tree_node_base* _Rb_tree_increment(_Rb_tree_node_base* __x) throw () @@ -448,4 +450,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __sum; } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace diff --git a/libstdc++-v3/src/valarray-inst.cc b/libstdc++-v3/src/valarray-inst.cc index 821dafcf9ce..4d21ab171ba 100644 --- a/libstdc++-v3/src/valarray-inst.cc +++ b/libstdc++-v3/src/valarray-inst.cc @@ -29,7 +29,9 @@ #include <valarray> -_GLIBCXX_BEGIN_NAMESPACE(std) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION // Some explicit instantiations. template void @@ -103,4 +105,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _M_index(__l.size() == 0 ? 0 : __valarray_product(__l)) { __gslice_to_index(__o, __l, __s, _M_index); } -_GLIBCXX_END_NAMESPACE +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace |