From dee74d2ba3c045ae57d2be35f6e3a0be61e5434a Mon Sep 17 00:00:00 2001 From: bkoz Date: Sat, 15 Jan 2011 00:27:10 +0000 Subject: 2011-01-14 Benjamin Kosnik PR libstdc++/36104 * include/Makefile.am (bits_sup_headers, stamp-bits-sup): New. * include/Makefile.in: Regenerate. * libsupc++/Makefile.am (std_HEADERS, bits_HEADERS): New. (install-stdHEADERS, install-bitsHEADERS): New. * libsupc++/Makefile.in: Regenerate. * include/bits/c++config: Update for inline namespaces. * libsupc++/cxxabi-forced.h: To... * libsupc++/cxxabi_forced.h: ...this. * libsupc++/hash_bytes.h: Separate file. * libsupc++/typeinfo: Use it. * libsupc++/exception: Adjust for bits subdirectory. * libsupc++/eh_aux_runtime.cc: Same. * libsupc++/eh_ptr.cc: Same. * libsupc++/new_op.cc: Same. * libsupc++/exception_defines.h: Same. * libsupc++/nested_exception.h: Same. * libsupc++/eh_terminate.cc: Same. * libsupc++/vec.cc: Same. * libsupc++/vterminate.cc: Same. * libsupc++/exception_ptr.h: Same. * libsupc++/eh_personality.cc: Same. * libsupc++/eh_call.cc: Same. * libsupc++/new_opnt.cc: Same. * libsupc++/hash_bytes.cc: Same. * config/cpu/arm/cxxabi_tweaks.h: Same. * config/cpu/generic/cxxabi_tweaks.h: Same. * libsupc++/cxxabi.h: Same. Consolidate _GLIBCXX_NOTHROW defines. * include/std/bitset: Same. * include/ext/vstring.tcc: Same. * include/bits/hashtable.h: Same. * include/bits/functional_hash.h: Same. * include/bits/hashtable_policy.h: Same. * include/bits/basic_string.h: Same. * include/bits/istream.tcc: Same. * include/bits/ostream.tcc: Same. * include/bits/algorithmfwd.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/ostream_insert.h: Same. * include/bits/fstream.tcc: Same. * include/bits/functexcept.h: Same. * doc/doxygen/user.cfg.in: Adjust names. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168831 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/include/Makefile.am | 21 ++- libstdc++-v3/include/Makefile.in | 18 ++- libstdc++-v3/include/bits/algorithmfwd.h | 2 +- libstdc++-v3/include/bits/basic_string.h | 2 +- libstdc++-v3/include/bits/basic_string.tcc | 4 +- libstdc++-v3/include/bits/c++config | 125 ++++++++-------- libstdc++-v3/include/bits/fstream.tcc | 4 +- libstdc++-v3/include/bits/functexcept.h | 4 +- libstdc++-v3/include/bits/functional_hash.h | 27 +--- libstdc++-v3/include/bits/hashtable.h | 207 ++++++++++++++------------- libstdc++-v3/include/bits/hashtable_policy.h | 115 +++++++-------- libstdc++-v3/include/bits/istream.tcc | 4 +- libstdc++-v3/include/bits/ostream.tcc | 4 +- libstdc++-v3/include/bits/ostream_insert.h | 4 +- libstdc++-v3/include/ext/vstring.tcc | 4 +- libstdc++-v3/include/std/bitset | 5 +- 16 files changed, 281 insertions(+), 269 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 6587179a4ef..5b6352e33b8 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -1,6 +1,7 @@ ## Makefile for the include subdirectory of the GNU C++ Standard library. ## -## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +## 2011 ## Free Software Foundation, Inc. ## ## This file is part of the libstdc++ version 3 distribution. @@ -172,6 +173,14 @@ bits_headers = \ ${bits_srcdir}/valarray_after.h \ ${bits_srcdir}/vector.tcc +bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ +bits_sup_headers = \ + ${bits_sup_srcdir}/cxxabi_forced.h \ + ${bits_sup_srcdir}/exception_defines.h \ + ${bits_sup_srcdir}/exception_ptr.h \ + ${bits_sup_srcdir}/hash_bytes.h \ + ${bits_sup_srcdir}/nested_exception.h + backward_srcdir = ${glibcxx_srcdir}/include/backward backward_builddir = ./backward backward_headers = \ @@ -888,7 +897,7 @@ endif # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-std stamp-bits stamp-bits-sup stamp-c_base stamp-c_compatibility \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \ stamp-debug stamp-parallel stamp-profile stamp-profile-impl \ stamp-host @@ -917,6 +926,10 @@ stamp-bits: ${bits_headers} @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null @$(STAMP) stamp-bits +stamp-bits-sup: stamp-bits ${bits_sup_headers} + @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null + @$(STAMP) stamp-bits-sup + stamp-c_base: ${c_base_headers} @-mkdir -p ${c_base_builddir} @-cd ${c_base_builddir} && $(LN_S) $? . 2>/dev/null @@ -1071,14 +1084,14 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ stamp-namespace-version \ stamp-visibility @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\ - nsa_version=`cat stamp-namespace-version` ;\ + ns_version=`cat stamp-namespace-version` ;\ visibility=`cat stamp-visibility` ;\ ldbl_compat='s,g,g,' ;\ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \ ${CONFIG_HEADER} > /dev/null 2>&1 \ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ - -e "s,define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION, define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION $$nsa_version," \ + -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 3260ef9bc20..d78315885cc 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -423,6 +423,14 @@ bits_headers = \ ${bits_srcdir}/valarray_after.h \ ${bits_srcdir}/vector.tcc +bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ +bits_sup_headers = \ + ${bits_sup_srcdir}/cxxabi_forced.h \ + ${bits_sup_srcdir}/exception_defines.h \ + ${bits_sup_srcdir}/exception_ptr.h \ + ${bits_sup_srcdir}/hash_bytes.h \ + ${bits_sup_srcdir}/nested_exception.h + backward_srcdir = ${glibcxx_srcdir}/include/backward backward_builddir = ./backward backward_headers = \ @@ -1125,7 +1133,7 @@ PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS) # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-std stamp-bits stamp-bits-sup stamp-c_base stamp-c_compatibility \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \ stamp-debug stamp-parallel stamp-profile stamp-profile-impl \ stamp-host @@ -1316,6 +1324,10 @@ stamp-bits: ${bits_headers} @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null @$(STAMP) stamp-bits +stamp-bits-sup: stamp-bits ${bits_sup_headers} + @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null + @$(STAMP) stamp-bits-sup + stamp-c_base: ${c_base_headers} @-mkdir -p ${c_base_builddir} @-cd ${c_base_builddir} && $(LN_S) $? . 2>/dev/null @@ -1464,14 +1476,14 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ stamp-namespace-version \ stamp-visibility @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\ - nsa_version=`cat stamp-namespace-version` ;\ + ns_version=`cat stamp-namespace-version` ;\ visibility=`cat stamp-visibility` ;\ ldbl_compat='s,g,g,' ;\ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \ ${CONFIG_HEADER} > /dev/null 2>&1 \ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ - -e "s,define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION, define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION $$nsa_version," \ + -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index fd5dbb211e1..f6f4eacd1f6 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -804,7 +804,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P) _GLIBCXX_END_NESTED_NAMESPACE -#ifdef _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL +#ifdef _GLIBCXX_PARALLEL # include #endif diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index bffa8afd4c6..03c89620ddf 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1,7 +1,7 @@ // Components for manipulating sequences of characters -*- 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 diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index a64c7815485..2b22c6b0acf 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -1,7 +1,7 @@ // Components for manipulating sequences of characters -*- 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 @@ -41,7 +41,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 400c244eb98..7465f364d49 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -1,7 +1,7 @@ // Predefined symbols and macros -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// 2006, 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 @@ -32,7 +32,7 @@ #define _GLIBCXX_CXX_CONFIG_H 1 // The current version of the C++ library in compressed ISO date format. -#define __GLIBCXX__ +#define __GLIBCXX__ // Macros for various attributes. #ifndef _GLIBCXX_PURE @@ -49,7 +49,7 @@ #ifndef _GLIBCXX_NOTHROW # ifdef __cplusplus -# define _GLIBCXX_NOTHROW throw() +# define _GLIBCXX_NOTHROW throw() # else # define _GLIBCXX_NOTHROW __attribute__((__nothrow__)) # endif @@ -87,7 +87,7 @@ namespace std { typedef __SIZE_TYPE__ size_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; - + #ifdef __GXX_EXPERIMENTAL_CXX0X__ typedef decltype(nullptr) nullptr_t; #endif @@ -103,23 +103,19 @@ namespace std #ifndef _GLIBCXX_CONSTEXPR # ifdef __GXX_EXPERIMENTAL_CXX0X__ # define _GLIBCXX_CONSTEXPR constexpr -# else -# define _GLIBCXX_CONSTEXPR -# endif -#endif - -#ifndef _GLIBCXX_USE_CONSTEXPR -# ifdef __GXX_EXPERIMENTAL_CXX0X__ # define _GLIBCXX_USE_CONSTEXPR constexpr # else +# define _GLIBCXX_CONSTEXPR # define _GLIBCXX_USE_CONSTEXPR const # endif #endif -// Macros for activating various namespace association modes. -// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG -// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL -// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +// Macros for activating various inline namespaces. +// +// _GLIBCXX_NAMESPACE_DEBUG +// _GLIBCXX_NAMESPACE_PARALLEL +// _GLIBCXX_NAMESPACE_PROFILE +// _GLIBCXX_NAMESPACE_VERSION // Guide to libstdc++ namespaces. /* @@ -127,6 +123,7 @@ namespace std { namespace __debug { } namespace __parallel { } + namespace __profile { } namespace __norm { } // __normative, __shadow, __replaced namespace __cxx1998 { } @@ -135,26 +132,26 @@ namespace std */ #ifdef _GLIBCXX_DEBUG -# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1 +# define _GLIBCXX_INLINE_DEBUG 1 #endif #ifdef _GLIBCXX_PARALLEL -# define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1 +# define _GLIBCXX_INLINE_PARALLEL 1 #endif -// Namespace association for profile +// Namespace association for profile. #ifdef _GLIBCXX_PROFILE -# define _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE 1 +# define _GLIBCXX_INLINE_PROFILE 1 #endif -#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +#define _GLIBCXX_INLINE_VERSION -// Defined if any namespace association modes are active. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION -# define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1 +// Defined if inline namespaces modes are active. +#if _GLIBCXX_INLINE_DEBUG \ + || _GLIBCXX_INLINE_PARALLEL \ + || _GLIBCXX_INLINE_PROFILE \ + || _GLIBCXX_INLINE_VERSION +# define _GLIBCXX_USE_INLINE_NAMESPACES 1 #endif // Macros for namespace scope. Either namespace std:: or the name @@ -169,7 +166,7 @@ namespace std // _GLIBCXX_END_NAMESPACE // _GLIBCXX_BEGIN_NESTED_NAMESPACE // _GLIBCXX_END_NESTED_NAMESPACE -#ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION +#ifndef _GLIBCXX_USE_INLINE_NAMESPACES # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD_PR _GLIBCXX_STD @@ -180,7 +177,7 @@ namespace std # define _GLIBCXX_END_NAMESPACE } #else -# if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else +# if _GLIBCXX_INLINE_VERSION // && not anything else # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD _6 @@ -189,37 +186,37 @@ namespace std # endif // debug -# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D __norm # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # define _GLIBCXX_EXTERN_TEMPLATE -1 # endif // parallel -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # endif // debug + parallel -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_PARALLEL && _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D __norm # define _GLIBCXX_STD_P __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # define _GLIBCXX_EXTERN_TEMPLATE -1 # endif // profile -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL || _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG +# if _GLIBCXX_INLINE_PROFILE +# if _GLIBCXX_INLINE_PARALLEL || _GLIBCXX_INLINE_DEBUG # error Cannot use -D_GLIBCXX_PROFILE with -D_GLIBCXX_DEBUG or \ -D_GLIBCXX_PARALLEL # endif @@ -227,12 +224,12 @@ namespace std # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD_PR __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # endif # if __NO_INLINE__ && !__GXX_WEAK__ -# warning currently using namespace associated mode which may fail \ +# warning currently using inlined namespace mode which may fail \ without inlining due to lack of weak symbols # endif @@ -240,52 +237,52 @@ namespace std # define _GLIBCXX_END_NESTED_NAMESPACE } } #endif -// Namespace associations for debug mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +// Inline namespaces for debug mode. +#if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __debug { } inline namespace __cxx1998 { } } #endif -// Namespace associations for parallel mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL +// Inline namespaces for parallel mode. +#if _GLIBCXX_INLINE_PARALLEL namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __parallel { } inline namespace __cxx1998 { } } #endif -// Namespace associations for profile mode -#if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +// Inline namespaces for profile mode +#if _GLIBCXX_INLINE_PROFILE namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __profile { } inline namespace __cxx1998 { } } #endif -// Namespace associations for versioning mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +// Inline namespaces for versioning mode. +#if _GLIBCXX_INLINE_VERSION namespace std { inline namespace _6 { } } -namespace __gnu_cxx -{ +namespace __gnu_cxx +{ inline namespace _6 { } } namespace std { - namespace tr1 - { + namespace tr1 + { inline namespace _6 { } } } @@ -295,8 +292,8 @@ namespace std // Define if compatibility should be provided for -mlong-double-64 #undef _GLIBCXX_LONG_DOUBLE_COMPAT -// Namespace associations for long double 128 mode. -#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ +// Inline namespaces for long double 128 mode. +#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ namespace std { inline namespace __gnu_cxx_ldbl128 { } @@ -341,11 +338,11 @@ namespace std #else // !__cplusplus # define _GLIBCXX_BEGIN_EXTERN_C -# define _GLIBCXX_END_EXTERN_C +# define _GLIBCXX_END_EXTERN_C # undef _GLIBCXX_BEGIN_NAMESPACE # undef _GLIBCXX_END_NAMESPACE -# define _GLIBCXX_BEGIN_NAMESPACE(X) -# define _GLIBCXX_END_NAMESPACE +# define _GLIBCXX_BEGIN_NAMESPACE(X) +# define _GLIBCXX_END_NAMESPACE #endif // First includes. @@ -397,7 +394,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // Avoid the use of assert, because we're trying to keep the // include out of the mix. inline void - __replacement_assert(const char* __file, int __line, + __replacement_assert(const char* __file, int __line, const char* __function, const char* __condition) { __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line, @@ -406,8 +403,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } _GLIBCXX_END_NAMESPACE -#define __glibcxx_assert(_Condition) \ - do \ +#define __glibcxx_assert(_Condition) \ + do \ { \ if (! (_Condition)) \ std::__replacement_assert(__FILE__, __LINE__, \ diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 6e00388a63a..bd0fa4be010 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -1,7 +1,7 @@ // File based streams -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -// 2007, 2008, 2009, 2010 +// 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/functexcept.h b/libstdc++-v3/include/bits/functexcept.h index 832ed7b55de..714d1cfd6b8 100644 --- a/libstdc++-v3/include/bits/functexcept.h +++ b/libstdc++-v3/include/bits/functexcept.h @@ -1,6 +1,6 @@ // Function-Based Exception Support -*- C++ -*- -// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010 +// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #define _FUNCTEXCEPT_H 1 #include -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/functional_hash.h b/libstdc++-v3/include/bits/functional_hash.h index 6cf70b7da80..30754510fca 100644 --- a/libstdc++-v3/include/bits/functional_hash.h +++ b/libstdc++-v3/include/bits/functional_hash.h @@ -1,6 +1,6 @@ // functional_hash.h header -*- 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 @@ -32,10 +32,10 @@ #pragma GCC system_header -#include +#include + +_GLIBCXX_BEGIN_NAMESPACE(std) -namespace std -{ /** @defgroup hashes Hashes * @ingroup functors * @@ -122,20 +122,6 @@ namespace std #undef _Cxx_hashtable_define_trivial_hash - // Hash function implementation for the nontrivial specialization. - // All of them are based on a primitive that hashes a pointer to - // a byte array. The actual hash algorithm is not guaranteed to - // stay the same from release to release -- it may be updated or - // tuned to improve hash quality or speed. - size_t - _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); - - // A similar hash primitive, using the FNV hash algorithm. This - // algorithm is guaranteed to stay the same from release to release. - // (although it might not produce the same values on different machines.) - size_t - _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); - struct _Hash_impl { static size_t @@ -158,7 +144,7 @@ namespace std { static size_t hash(const void* __ptr, size_t __clength, - size_t __seed = static_cast(2166136261UL)) + size_t __seed = static_cast(2166136261UL)) { return _Fnv_hash_bytes(__ptr, __clength, __seed); } template @@ -196,6 +182,7 @@ namespace std hash::operator()(long double __val) const; // @} group hashes -} + +_GLIBCXX_END_NAMESPACE #endif // _FUNCTIONAL_HASH_H diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index fd29c5950c9..721d1228a7f 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -1,6 +1,6 @@ // hashtable.h header -*- 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 @@ -35,39 +35,39 @@ #include -namespace std -{ +_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) + // Class template _Hashtable, class definition. - + // Meaning of class template _Hashtable's template parameters - + // _Key and _Value: arbitrary CopyConstructible types. - + // _Allocator: an allocator type ([lib.allocator.requirements]) whose // value type is Value. As a conforming extension, we allow for // value type != Value. // _ExtractKey: function object that takes a object of type Value // and returns a value of type _Key. - + // _Equal: function object that takes two objects of type k and returns // a bool-like value that is true if the two objects are considered equal. - + // _H1: the hash function. A unary function object with argument type // Key and result type size_t. Return values should be distributed // over the entire range [0, numeric_limits:::max()]. - + // _H2: the range-hashing function (in the terminology of Tavori and // Dreizin). A binary function object whose argument types and result // type are all size_t. Given arguments r and N, the return value is // in the range [0, N). - + // _Hash: the ranged hash function (Tavori and Dreizin). A binary function // whose argument types are _Key and size_t and whose result type is // size_t. Given arguments k and N, the return value is in the range // [0, N). Default: hash(k, N) = h2(h1(k), N). If _Hash is anything other // than the default, _H1 and _H2 are ignored. - + // _RehashPolicy: Policy class with three members, all of which govern // the bucket count. _M_next_bkt(n) returns a bucket count no smaller // than n. _M_bkt_for_elements(n) returns a bucket count appropriate @@ -76,27 +76,27 @@ namespace std // current element count is n_elt, we need to increase the bucket // count. If so, returns make_pair(true, n), where n is the new // bucket count. If not, returns make_pair(false, ). - + // ??? Right now it is hard-wired that the number of buckets never // shrinks. Should we allow _RehashPolicy to change that? - + // __cache_hash_code: bool. true if we store the value of the hash // function along with the value. This is a time-space tradeoff. // Storing it may improve lookup speed by reducing the number of times // we need to call the Equal function. - + // __constant_iterators: bool. true if iterator and const_iterator are // both constant iterator types. This is true for unordered_set and // unordered_multiset, false for unordered_map and unordered_multimap. - + // __unique_keys: bool. true if the return value of _Hashtable::count(k) // is always at most one, false if it may be an arbitrary number. This // true for unordered_set and unordered_map, false for unordered_multiset // and unordered_multimap. - + template - local_iterator; + local_iterator; typedef __detail::_Node_const_iterator - const_local_iterator; + const_local_iterator; typedef __detail::_Hashtable_iterator - iterator; + iterator; typedef __detail::_Hashtable_const_iterator - const_iterator; + const_iterator; template - friend struct __detail::_Map_base; + friend struct __detail::_Map_base; private: typedef __detail::_Hash_node<_Value, __cache_hash_code> _Node; typedef typename _Allocator::template rebind<_Node>::other - _Node_allocator_type; + _Node_allocator_type; typedef typename _Allocator::template rebind<_Node*>::other - _Bucket_allocator_type; + _Bucket_allocator_type; typedef typename _Allocator::template rebind<_Value>::other - _Value_allocator_type; + _Value_allocator_type; _Node_allocator_type _M_node_allocator; _Node** _M_buckets; @@ -181,39 +181,39 @@ namespace std _RehashPolicy _M_rehash_policy; template - _Node* - _M_allocate_node(_Args&&... __args); - + _Node* + _M_allocate_node(_Args&&... __args); + void _M_deallocate_node(_Node* __n); - + void _M_deallocate_nodes(_Node**, size_type); _Node** _M_allocate_buckets(size_type __n); - + void _M_deallocate_buckets(_Node**, size_type __n); - public: + public: // Constructor, destructor, assignment, swap _Hashtable(size_type __bucket_hint, const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&); - + template - _Hashtable(_InputIterator __first, _InputIterator __last, + _Hashtable(_InputIterator __first, _InputIterator __last, size_type __bucket_hint, - const _H1&, const _H2&, const _Hash&, + const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&); - + _Hashtable(const _Hashtable&); _Hashtable(_Hashtable&&); - + _Hashtable& operator=(const _Hashtable& __ht) { @@ -264,7 +264,7 @@ namespace std size_type size() const { return _M_element_count; } - + bool empty() const { return size() == 0; } @@ -288,18 +288,18 @@ namespace std size_type bucket_count() const { return _M_bucket_count; } - + size_type max_bucket_count() const { return max_size(); } - + size_type bucket_size(size_type __n) const { return std::distance(begin(__n), end(__n)); } - + size_type bucket(const key_type& __k) const - { + { return this->_M_bucket_index(__k, this->_M_hash_code(__k), bucket_count()); } @@ -331,7 +331,7 @@ namespace std float load_factor() const - { + { return static_cast(size()) / static_cast(bucket_count()); } @@ -342,8 +342,8 @@ namespace std const _RehashPolicy& __rehash_policy() const { return _M_rehash_policy; } - - void + + void __rehash_policy(const _RehashPolicy&); // Lookup. @@ -369,28 +369,28 @@ namespace std typename _Hashtable::_Hash_code_type) const; template - iterator - _M_insert_bucket(_Arg&&, size_type, + iterator + _M_insert_bucket(_Arg&&, size_type, typename _Hashtable::_Hash_code_type); template - std::pair - _M_insert(_Arg&&, std::true_type); + std::pair + _M_insert(_Arg&&, std::true_type); template - iterator - _M_insert(_Arg&&, std::false_type); + iterator + _M_insert(_Arg&&, std::false_type); typedef typename std::conditional<__unique_keys, std::pair, iterator>::type - _Insert_Return_Type; + _Insert_Return_Type; typedef typename std::conditional<__unique_keys, std::_Select1st<_Insert_Return_Type>, std::_Identity<_Insert_Return_Type> - >::type - _Insert_Conv_Type; + >::type + _Insert_Conv_Type; public: // Insert and erase @@ -415,22 +415,22 @@ namespace std std::enable_if::value>::type> - _Insert_Return_Type - insert(_Pair&& __v) - { return _M_insert(std::forward<_Pair>(__v), + _Insert_Return_Type + insert(_Pair&& __v) + { return _M_insert(std::forward<_Pair>(__v), std::integral_constant()); } template::value>::type> - iterator - insert(const_iterator, _Pair&& __v) - { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); } + iterator + insert(const_iterator, _Pair&& __v) + { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); } template - void - insert(_InputIterator __first, _InputIterator __last); + void + insert(_InputIterator __first, _InputIterator __last); void insert(initializer_list __l) @@ -461,7 +461,7 @@ namespace std // Definitions of class template _Hashtable's out-of-line member functions. - template @@ -487,7 +487,7 @@ namespace std } } - template @@ -500,7 +500,7 @@ namespace std _M_node_allocator.deallocate(__n, 1); } - template @@ -522,7 +522,7 @@ namespace std } } - template @@ -543,7 +543,7 @@ namespace std return __p; } - template @@ -556,7 +556,7 @@ namespace std __alloc.deallocate(__p, __n + 1); } - template @@ -581,7 +581,7 @@ namespace std _M_begin_bucket_index = _M_bucket_count; } - template @@ -622,8 +622,8 @@ namespace std __throw_exception_again; } } - - template @@ -664,7 +664,7 @@ namespace std } } - template @@ -690,7 +690,7 @@ namespace std __ht._M_rehash_policy = _RehashPolicy(); } - template @@ -702,7 +702,7 @@ namespace std _M_deallocate_buckets(_M_buckets, _M_bucket_count); } - template @@ -729,7 +729,7 @@ namespace std std::swap(_M_element_count, __x._M_element_count); } - template @@ -744,7 +744,7 @@ namespace std _M_rehash(__n_bkt); } - template @@ -761,7 +761,7 @@ namespace std return __p ? iterator(__p, _M_buckets + __n) : this->end(); } - template @@ -778,7 +778,7 @@ namespace std return __p ? const_iterator(__p, _M_buckets + __n) : this->end(); } - template @@ -798,7 +798,7 @@ namespace std return __result; } - template @@ -818,7 +818,7 @@ namespace std std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); _Node** __head = _M_buckets + __n; _Node* __p = _M_find_node(*__head, __k, __code); - + if (__p) { _Node* __p1 = __p->_M_next; @@ -836,7 +836,7 @@ namespace std return std::make_pair(this->end(), this->end()); } - template @@ -876,13 +876,13 @@ namespace std // Find the node whose key compares equal to k, beginning the search // at p (usually the head of a bucket). Return nil if no node is found. - template typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, - __chc, __cit, __uk>::_Node* + __chc, __cit, __uk>::_Node* _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: _M_find_node(_Node* __p, const key_type& __k, @@ -895,7 +895,7 @@ namespace std } // Insert v in bucket n (assumes no element with its key already present). - template @@ -943,7 +943,7 @@ namespace std } // Insert v if no element with its key is already present. - template @@ -967,7 +967,7 @@ namespace std } // Insert v unconditionally. - template @@ -984,7 +984,7 @@ namespace std _M_element_count, 1); if (__do_rehash.first) _M_rehash(__do_rehash.second); - + const key_type& __k = this->_M_extract(__v); typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count); @@ -993,7 +993,7 @@ namespace std _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code); _Node* __new_node = _M_allocate_node(std::forward<_Arg>(__v)); - if (__prev) + if (__prev) { __new_node->_M_next = __prev->_M_next; __prev->_M_next = __new_node; @@ -1005,18 +1005,18 @@ namespace std if (__n < _M_begin_bucket_index) _M_begin_bucket_index = __n; } - this->_M_store_code(__new_node, __code); + this->_M_store_code(__new_node, __code); - ++_M_element_count; - return iterator(__new_node, _M_buckets + __n); + ++_M_element_count; + return iterator(__new_node, _M_buckets + __n); } - template template - void + void _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: insert(_InputIterator __first, _InputIterator __last) @@ -1032,7 +1032,7 @@ namespace std this->insert(*__first); } - template @@ -1073,7 +1073,7 @@ namespace std return __result; } - template @@ -1087,7 +1087,7 @@ namespace std typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); size_type __result = 0; - + _Node** __slot = _M_buckets + __n; while (*__slot && !this->_M_compare(__k, __code, *__slot)) __slot = &((*__slot)->_M_next); @@ -1101,8 +1101,8 @@ namespace std if (std::__addressof(this->_M_extract((*__slot)->_M_v)) != std::__addressof(__k)) { - _Node* __p = *__slot; - *__slot = __p->_M_next; + _Node* __p = *__slot; + *__slot = __p->_M_next; _M_deallocate_node(__p); --_M_element_count; ++__result; @@ -1143,7 +1143,7 @@ namespace std // ??? This could be optimized by taking advantage of the bucket // structure, but it's not clear that it's worth doing. It probably // wouldn't even be an optimization unless the load factor is large. - template @@ -1159,7 +1159,7 @@ namespace std return iterator(__last._M_cur_node, __last._M_cur_bucket); } - template @@ -1172,8 +1172,8 @@ namespace std _M_element_count = 0; _M_begin_bucket_index = _M_bucket_count; } - - template @@ -1187,7 +1187,7 @@ namespace std + 1))); } - template @@ -1228,6 +1228,7 @@ namespace std __throw_exception_again; } } -} + +_GLIBCXX_END_NESTED_NAMESPACE // namespace std #endif // _HASHTABLE_H diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 622784ab097..e439dfaac8f 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -1,6 +1,6 @@ // Internal policy header for unordered_set and unordered_map -*- 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,15 +24,15 @@ /** @file bits/hashtable_policy.h * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. + * Do not attempt to use it directly. * @headername{unordered_map,unordered_set} */ #ifndef _HASHTABLE_POLICY_H #define _HASHTABLE_POLICY_H 1 -namespace std -{ +_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) + namespace __detail { // Helper function: return distance(first, last) for forward @@ -59,7 +59,7 @@ namespace __detail // Auxiliary types used for all instantiations of _Hashtable: nodes // and iterators. - + // Nodes, used to wrap elements stored in the hash table. A policy // template parameter of class template _Hashtable controls whether // nodes also store a hash code. In some cases (e.g. strings) this @@ -75,7 +75,7 @@ namespace __detail _Hash_node* _M_next; template - _Hash_node(_Args&&... __args) + _Hash_node(_Args&&... __args) : _M_v(std::forward<_Args>(__args)...), _M_hash_code(), _M_next() { } }; @@ -87,7 +87,7 @@ namespace __detail _Hash_node* _M_next; template - _Hash_node(_Args&&... __args) + _Hash_node(_Args&&... __args) : _M_v(std::forward<_Args>(__args)...), _M_next() { } }; @@ -99,7 +99,7 @@ namespace __detail { _Node_iterator_base(_Hash_node<_Value, __cache>* __p) : _M_cur(__p) { } - + void _M_incr() { _M_cur = _M_cur->_M_next; } @@ -126,10 +126,10 @@ namespace __detail typedef _Value value_type; typedef typename std::conditional<__constant_iterators, const _Value*, _Value*>::type - pointer; + pointer; typedef typename std::conditional<__constant_iterators, const _Value&, _Value&>::type - reference; + reference; typedef std::ptrdiff_t difference_type; typedef std::forward_iterator_tag iterator_category; @@ -143,21 +143,21 @@ namespace __detail reference operator*() const { return this->_M_cur->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur->_M_v); } _Node_iterator& operator++() - { + { this->_M_incr(); - return *this; + return *this; } - + _Node_iterator operator++(int) - { + { _Node_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -188,21 +188,21 @@ namespace __detail reference operator*() const { return this->_M_cur->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur->_M_v); } _Node_const_iterator& operator++() - { + { this->_M_incr(); - return *this; + return *this; } - + _Node_const_iterator operator++(int) - { + { _Node_const_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -265,10 +265,10 @@ namespace __detail typedef _Value value_type; typedef typename std::conditional<__constant_iterators, const _Value*, _Value*>::type - pointer; + pointer; typedef typename std::conditional<__constant_iterators, const _Value&, _Value&>::type - reference; + reference; typedef std::ptrdiff_t difference_type; typedef std::forward_iterator_tag iterator_category; @@ -286,21 +286,21 @@ namespace __detail reference operator*() const { return this->_M_cur_node->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur_node->_M_v); } _Hashtable_iterator& operator++() - { + { this->_M_incr(); return *this; } - + _Hashtable_iterator operator++(int) - { + { _Hashtable_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -336,21 +336,21 @@ namespace __detail reference operator*() const { return this->_M_cur_node->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur_node->_M_v); } _Hashtable_const_iterator& operator++() - { + { this->_M_incr(); return *this; } - + _Hashtable_const_iterator operator++(int) - { + { _Hashtable_const_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -390,16 +390,16 @@ namespace __detail float max_load_factor() const - { return _M_max_load_factor; } + { return _M_max_load_factor; } // Return a bucket size no smaller than n. std::size_t _M_next_bkt(std::size_t __n) const; - + // Return a bucket count appropriate for n elements std::size_t _M_bkt_for_elements(std::size_t __n) const; - + // __n_bkt is current bucket count, __n_elt is current element count, // and __n_ins is number of elements to be inserted. Do we need to // increase bucket count? If so, return make_pair(true, n), where n @@ -418,7 +418,7 @@ namespace __detail extern const unsigned long __prime_list[]; // XXX This is a hack. There's no good reason for any of - // _Prime_rehash_policy's member functions to be inline. + // _Prime_rehash_policy's member functions to be inline. // Return a prime no smaller than n. inline std::size_t @@ -427,7 +427,7 @@ namespace __detail { const unsigned long* __p = std::lower_bound(__prime_list, __prime_list + _S_n_primes, __n); - _M_next_resize = + _M_next_resize = static_cast(__builtin_ceil(*__p * _M_max_load_factor)); return *__p; } @@ -448,7 +448,7 @@ namespace __detail // Finds the smallest prime p such that alpha p > __n_elt + __n_ins. // If p > __n_bkt, return make_pair(true, p); otherwise return - // make_pair(false, 0). In principle this isn't very different from + // make_pair(false, 0). In principle this isn't very different from // _M_bkt_for_elements. // The only tricky part is that we're caching the element count at @@ -474,7 +474,7 @@ namespace __detail (__builtin_ceil(*__p * _M_max_load_factor)); return std::make_pair(true, *__p); } - else + else { _M_next_resize = static_cast (__builtin_ceil(__n_bkt * _M_max_load_factor)); @@ -642,10 +642,10 @@ namespace __detail // we have a dummy type as placeholder. // (2) Whether or not we cache hash codes. Caching hash codes is // meaningless if we have a ranged hash function. - // We also put the key extraction and equality comparison function + // We also put the key extraction and equality comparison function // objects here, for convenience. - - // Primary template: unused except as a hook for specializations. + + // Primary template: unused except as a hook for specializations. template* __p, std::size_t __n) const { return _M_ranged_hash(_M_extract(__p->_M_v), __n); } - + bool _M_compare(const _Key& __k, _Hash_code_type, _Hash_node<_Value, false>* __n) const @@ -694,7 +694,7 @@ namespace __detail _M_copy_code(_Hash_node<_Value, false>*, const _Hash_node<_Value, false>*) const { } - + void _M_swap(_Hash_code_base& __x) { @@ -712,11 +712,11 @@ namespace __detail // No specialization for ranged hash function while caching hash codes. // That combination is meaningless, and trying to do it is an error. - - + + // Specialization: ranged hash function, cache hash codes. This // combination is meaningless, so we provide only a declaration - // and no definition. + // and no definition. template @@ -725,7 +725,7 @@ namespace __detail // Specialization: hash function and range-hashing function, no // caching of hash codes. H is provided but ignored. Provides - // typedef and accessor required by TR1. + // typedef and accessor required by TR1. template @@ -749,7 +749,7 @@ namespace __detail _Hash_code_type _M_hash_code(const _Key& __k) const { return _M_h1(__k); } - + std::size_t _M_bucket_index(const _Key&, _Hash_code_type __c, std::size_t __n) const @@ -790,7 +790,7 @@ namespace __detail _H2 _M_h2; }; - // Specialization: hash function and range-hashing function, + // Specialization: hash function and range-hashing function, // caching hash codes. H is provided but ignored. Provides // typedef and accessor required by TR1. template { typedef _H1 hasher; - + hasher hash_function() const { return _M_h1; } @@ -812,11 +812,11 @@ namespace __detail : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { } typedef std::size_t _Hash_code_type; - + _Hash_code_type _M_hash_code(const _Key& __k) const { return _M_h1(__k); } - + std::size_t _M_bucket_index(const _Key&, _Hash_code_type __c, std::size_t __n) const @@ -849,7 +849,7 @@ namespace __detail std::swap(_M_h1, __x._M_h1); std::swap(_M_h2, __x._M_h2); } - + protected: _ExtractKey _M_extract; _Equal _M_eq; @@ -898,8 +898,8 @@ namespace __detail private: template - static bool - _S_is_permutation(_Uiterator, _Uiterator, _Uiterator); + static bool + _S_is_permutation(_Uiterator, _Uiterator, _Uiterator); }; // See std::is_permutation in N3068. @@ -978,6 +978,7 @@ namespace __detail return true; } } // namespace __detail -} + +_GLIBCXX_END_NESTED_NAMESPACE // namespace std #endif // _HASHTABLE_POLICY_H diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index 394553e1be9..6fc6b31ad26 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -1,7 +1,7 @@ // istream 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 @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 7a6330b45f3..ec41595a7c9 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -1,7 +1,7 @@ // ostream 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 @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/ostream_insert.h b/libstdc++-v3/include/bits/ostream_insert.h index 9e07abee89f..3d7cf2d5042 100644 --- a/libstdc++-v3/include/bits/ostream_insert.h +++ b/libstdc++-v3/include/bits/ostream_insert.h @@ -1,6 +1,6 @@ // Helpers for ostream inserters -*- 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 @@ -33,7 +33,7 @@ #pragma GCC system_header #include -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc index 60effafae7d..95d4cc36cc4 100644 --- a/libstdc++-v3/include/ext/vstring.tcc +++ b/libstdc++-v3/include/ext/vstring.tcc @@ -1,6 +1,6 @@ // Versatile string -*- 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 @@ -33,7 +33,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 86f361c9867..29b06d52e72 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2001, 2002, 2003, 2004, 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 @@ -49,7 +50,7 @@ #include // For invalid_argument, out_of_range, // overflow_error #include -#include +#include #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long)) #define _GLIBCXX_BITSET_WORDS(__n) \ -- cgit v1.2.1