summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-12-04 16:53:59 +0000
committerobrien <obrien@FreeBSD.org>2002-12-04 16:53:59 +0000
commitee820e9f244fb13f3dd7773478f525ddcbeac501 (patch)
tree23d47b19d8ecbb91f1615f358dbb41e09e05fc12 /contrib/libstdc++
parent7a1080fa5c329ea8a9505e51ce151719955bcfa2 (diff)
downloadFreeBSD-src-ee820e9f244fb13f3dd7773478f525ddcbeac501.zip
FreeBSD-src-ee820e9f244fb13f3dd7773478f525ddcbeac501.tar.gz
Gcc 3.2.1 release virgin vendor import. (19-Nov-2002)
Diffstat (limited to 'contrib/libstdc++')
-rw-r--r--contrib/libstdc++/ChangeLog293
-rw-r--r--contrib/libstdc++/Makefile.am4
-rw-r--r--contrib/libstdc++/Makefile.in47
-rw-r--r--contrib/libstdc++/acconfig.h14
-rw-r--r--contrib/libstdc++/acinclude.m41
-rw-r--r--contrib/libstdc++/aclocal.m41
-rw-r--r--contrib/libstdc++/config.h.in14
-rw-r--r--contrib/libstdc++/config/linker-map.gnu160
-rw-r--r--contrib/libstdc++/config/locale/generic/c_locale.cc11
-rw-r--r--contrib/libstdc++/config/locale/generic/c_locale.h2
-rw-r--r--contrib/libstdc++/config/locale/generic/time_members.cc14
-rw-r--r--contrib/libstdc++/config/locale/gnu/c_locale.cc22
-rw-r--r--contrib/libstdc++/config/locale/gnu/c_locale.h2
-rw-r--r--contrib/libstdc++/config/locale/gnu/ctype_members.cc3
-rw-r--r--contrib/libstdc++/config/locale/gnu/monetary_members.cc19
-rw-r--r--contrib/libstdc++/config/locale/gnu/numeric_members.cc4
-rw-r--r--contrib/libstdc++/config/locale/gnu/time_members.cc24
-rw-r--r--contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h5
-rwxr-xr-xcontrib/libstdc++/configure93
-rw-r--r--contrib/libstdc++/configure.in4
-rw-r--r--contrib/libstdc++/include/bits/basic_ios.tcc3
-rw-r--r--contrib/libstdc++/include/bits/basic_string.tcc19
-rw-r--r--contrib/libstdc++/include/bits/c++config5
-rw-r--r--contrib/libstdc++/include/bits/fstream.tcc9
-rw-r--r--contrib/libstdc++/include/bits/ios_base.h3
-rw-r--r--contrib/libstdc++/include/bits/istream.tcc80
-rw-r--r--contrib/libstdc++/include/bits/locale_facets.h70
-rw-r--r--contrib/libstdc++/include/bits/locale_facets.tcc150
-rw-r--r--contrib/libstdc++/include/bits/localefwd.h45
-rw-r--r--contrib/libstdc++/include/bits/sstream.tcc9
-rw-r--r--contrib/libstdc++/include/bits/streambuf.tcc31
-rw-r--r--contrib/libstdc++/include/bits/stringfwd.h18
-rw-r--r--contrib/libstdc++/include/std/std_iomanip.h16
-rw-r--r--contrib/libstdc++/include/std/std_iosfwd.h2
-rw-r--r--contrib/libstdc++/include/std/std_iostream.h1
-rw-r--r--contrib/libstdc++/include/std/std_limits.h4
-rw-r--r--contrib/libstdc++/include/std/std_sstream.h3
-rw-r--r--contrib/libstdc++/libio/ChangeLog28
-rw-r--r--contrib/libstdc++/libio/Makefile.in22
-rw-r--r--contrib/libstdc++/src/codecvt.cc2
-rw-r--r--contrib/libstdc++/src/ctype.cc11
-rw-r--r--contrib/libstdc++/src/globals.cc129
-rw-r--r--contrib/libstdc++/src/ios.cc26
-rw-r--r--contrib/libstdc++/src/locale-inst.cc4
-rw-r--r--contrib/libstdc++/src/locale.cc207
-rw-r--r--contrib/libstdc++/src/localename.cc157
-rw-r--r--contrib/libstdc++/src/string-inst.cc4
-rw-r--r--contrib/libstdc++/testsuite/Makefile.in489
-rw-r--r--contrib/libstdc++/testsuite/config/default.exp20
49 files changed, 1730 insertions, 574 deletions
diff --git a/contrib/libstdc++/ChangeLog b/contrib/libstdc++/ChangeLog
index 9f9546d..4f36778 100644
--- a/contrib/libstdc++/ChangeLog
+++ b/contrib/libstdc++/ChangeLog
@@ -1,3 +1,296 @@
+2002-11-19 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-11-19 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-11-18 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ * config/linker-map.gnu: Export _S_construct even if size_t is
+ unsigned long. Collapse std::codecvt<char>::codecvt(size_t)
+ and std::codecvt<wchar_t>::codecvt(size_t) into one export pattern.
+
+2002-11-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/linker-map.gnu: Export all _S_construct.
+
+2002-11-06 David Edelsohn <edelsohn@gnu.org>
+
+ PR 8362
+ * testsuite/abi_check.cc: Add guards to prevent -mpower ICE.
+
+2002-11-05 Jonathan Wakely <cow@compsoc.man.ac.uk>
+
+ * include/std/std_sstream.h
+ (basic_stringbuf::str(const __string_type&)):
+ Prefer data() to c_str() thus avoiding assigning the
+ unnecessary NULL-terminator.
+
+2002-11-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/8258
+ * include/bits/istream.tcc (istream::readsome): Don't set eofbit
+ for null buffer.
+ (istream::operator>>(_CharT*)): Use traits_type.
+ (istream::ws): Same.
+ (istream::operator>>(string)): Same.
+ * testsuite/27_io/istream_unformatted.cc (test11): Add.
+
+2002-11-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/7219
+ * include/bits/ios_base.h (ios_base::streampos): Add.
+ (ios_base::streamoff): Add.
+ * testsuite/27_io/ios_base_type.cc: New.
+
+2002-11-05 Paolo Carlini <pcarlini@unitus.it>
+
+ PR libstdc++/8466
+ * include/std/std_sstream.h
+ (basic_stringbuf::str(const __string_type&)):
+ Cannot use simple assignment since the COW-nature of v3
+ basic_string is not taken into account in basic_stringbuf.
+ * testsuite/27_io/stringstream_members.cc: Add test04 from PR.
+
+2002-11-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/linker-map.gnu: Export string operator+.
+ Export __default_alloc_template::_S_force_new.
+ * testsuite/abi_check.cc: Output tweaks.
+
+2002-11-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/8172
+ * src/string-inst.cc: Add instantiation.
+
+2002-11-04 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR libstdc++/8197
+ * config/link-map.gnu: Export math stubbs.
+
+2002-11-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/8318
+ * include/std/std_iostream.h: Tweak.
+ * include/std/std_iosfwd.h: Add _GLIBCPP_USE_WCHAR_T.
+ * include/std/std_iomanip.h: Same.
+ * include/bits/stringfwd.h: Same.
+ * include/bits/basic_string.tcc: Same.
+ * include/bits/sstream.tcc: Same.
+ * include/bits/fstream.tcc: Same.
+ * include/bits/basic_ios.tcc: Same.
+ * include/bits/streambuf.tcc: Same.
+ * include/bits/locale_facets.tcc: Same.
+
+2002-11-01 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/8348
+ * include/bits/istream.tcc (istream::tellg): Remove sentry bits.
+ (istream::seekg): Same.
+ * testsuite/27_io/istream_seeks.cc (test06): New.
+
+2002-11-01 John Carter <john.carter@tait.co.nz>
+
+ PR libstdc++/7961
+ * include/bits/basic_string.tcc
+ (compare(const _CharT* __s)): Don't access __s past its length.
+
+2002-11-01 Hans-Peter Nilsson <hp@bitrange.com>
+
+ PR other/3337
+ PR bootstrap/6763
+ PR bootstrap/8122
+ * testsuite/testsuite_hooks.h (__set_testsuite_memlimit): Use
+ __typeof__ (r.rlim_cur), not rlim_t in declaration of limit.
+
+2002-10-29 Paolo Carlini <pcarlini@unitus.it>
+
+ PR libstdc++/8347
+ * include/bits/basic_string.tcc
+ (string::_S_construct(_InIter, _InIter, const _Alloc&,
+ forward_iterator_tag)): Do not throw logic error if
+ __beg == NULL && __end == __beg.
+ (string::string(const _CharT*, const _Alloc&)): Tweak.
+ * testsuite/21_strings/ctor_copy_dtor.cc: Add test05 from PR.
+
+2002-10-23 Jakub Jelinek <jakub@redhat.com>
+
+ * testsuite/22_locale/num_put_members_char.cc (test01): Swap size
+ and decimal_point arguments of find.
+ * testsuite/22_locale/num_put_members_wchar_t.cc (test01): Likewise.
+
+2002-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ * Makefile.am (check-abi, new-abi-baseline): Use @glibcpp_srcdir@
+ instead of ${top_srcdir}.
+ * Makefile.in: Rebuilt.
+
+2002-10-21 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: Use target, not target_alias, when matching triplet
+ patterns.
+ * configure: Regenerate.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.h (__timepunct::__timepunct): Allocate
+ _M_name_timepunct.
+ (__timepunct::~__timepunct): Deallocate, remove specialization
+ declarations.
+ (messages::messages): Allocate _M_name_messages.
+ (messages::~messages): Deallocate.
+ (messages_byname): Same.
+ * config/locale/gnu/time_members.cc (__timepunct::~__timepunct):
+ Remove.
+ * config/locale/generic/time_members.cc (__timepunct::~__timepunct):
+ Remove.
+
+ * docs/html/install.html: Add eqs_MX, en_PH to required locales list.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/globals.cc (__gnu_cxx::c_locale_impl_compat): Add, alias to
+ c_locale_impl.
+ * testsuite/abi_check.cc (line_to_symbol_info): Collect size info.
+ * docs/html/abi.txt: Update.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/22_locale/static_members.cc (test02): Less provincial.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/22_locale/static_members.cc (test02): Disable for
+ systems without named locale support.
+ * testsuite/22_locale/ctor_copy_dtor.cc (test04): Don't assume
+ running the testsuites in "C" environment.
+ Add new tests.
+ * docs/html/22_locale/locale.html: Update.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/abi_check.cc (hash<string>): Specialize.
+ Simplify. Check compatible symbol versions.
+ * config/linker-map.gnu: Clarify, explicitly export
+ std::codecvt::c* symbols.
+
+ * testsuite/22_locale/static_members.cc (test02): Avoid null strings.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/22_locale/static_members.cc (test02): Fix.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acconfig.h (_GLIBCPP_SYMVER): Add.
+ (_GLIBCPP_ASM_SYMVER): Add.
+ * acinclude.m4 (GLIBCPP_ENABLE_SYMVERS): Define _GLIBCPP_SYMVER.
+ * aclocal.m4: Regenerate.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+ * include/bits/c++config (_GLIBCPP_AT_AT): Define, as an expedient
+ hack around m4 issues with quoting '@'.
+ * src/locale.cc: Use _GLIBCPP_ASM_SYMVER.
+ * src/globals.cc (__gnu_cxx): Same.
+
+ * testsuite/22_locale/ctor_copy_dtor.cc (test04): Fix for
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/linker-map.gnu (GLIBCPP_3.2.1): Add.
+ (GLIBCPP_3.2): Don't export locale::_S_*.
+ * src/ios.cc: Move globals into __gnu_cxx. Make old exported
+ symbols match.
+ * src/locale.cc: Same.
+ * src/localename.cc: Same.
+
+2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/locale.cc: Fix comments, move ctors together.
+ * testsuite/22_locale/static_members.cc (test03): Add.
+
+2002-10-16 Paolo Carlini <pcarlini@unitus.it>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/localefwd.h (class locale): Add static member
+ _S_num_extra_categories, encoding the number of additional
+ categories.
+ Change _S_num_categories to _S_categories_size.
+ (class locale::_Impl): Add _M_c_cats.
+ (class locale::_Impl::_M_names): Change to array of chars.
+ (class locale::_Impl::_M_check_same_name): Use
+ _S_extra_categories_size, tweak.
+ (locale::locale(const locale&, _Facet*)): Ditto.
+ * src/locale.cc (locale::locale(const char* )): Rewrite to deal
+ with the environment in a POSIX-compliant way while being thread
+ safe.
+ (locale::name()): Update to output POSIX environment strings.
+ * src/localename.cc
+ (locale::_Impl::_Impl(const _Impl&, size_t): Use
+ _S_categories_size_*, tweak.
+ (locale::_Impl::_Impl(facet**, size_t, bool)): Ditto.
+ (locale::_Impl::_Impl(const char*, size_t)): Name each category
+ individually.
+ (locale::_Impl::_M_replace_categories): Use strcpy.
+
+ * include/bits/locale_facets.h (numpunct::_M_initialize_numpunct):
+ Change default argument to NULL from _S_c_locale.
+ (timepunct::_M_initialize_timepunct): Same.
+ _S_c_locale cleanups.
+ * src/codecvt.c: _S_c_locale simplification.
+ * src/ctype.c: Same.
+ * src/globals.cc: Add fake_name.
+ * src/locale-inst.cc: Remove extra includes.
+ * src/locale.cc: Remove extra includes.
+ Add _S_extra_categories_size definition.
+ Correct "C" initialization.
+ (locale::facet::facet): Don't initialize _S_c_locale.
+ (locale::facet::_M_remove_reference): Adjust.
+ * src/localename: Use facet_vec, facet_name.
+ (locale::_Impl::_Impl(facet** __f, size_t __refs, bool)): Set
+ facet ref counts to one. Initialize _S_c_locale.
+ (locale::_Impl::_M_install_facet(id*, facet*)): Adjust facet ref
+ counts when installing unilaterally.
+
+ * config/locale/generic/c_locale.cc: Add _S_categories definition.
+ * config/locale/generic/c_locale.h: Add _GLIBCPP_NUM_CATEGORIES macro.
+ * config/locale/generic/time_members.cc: _S_c_locale cleanup.
+
+ * config/locale/gnu/c_locale.cc: Add _S_categories definition.
+ (_S_destroy_c_locale): Move checks against _S_c_locale here.
+ * config/locale/gnu/c_locale.h: Add _GLIBCPP_NUM_CATEGORIES macro.
+ * config/locale/gnu/ctype_members.cc: Simplify _S_destroy_c_locale
+ calls, _S_c_locale usage.
+ * config/locale/gnu/monetary_members.cc: Same, tweaks.
+ * config/locale/gnu/monetary_members.cc: Same.
+ * config/locale/gnu/time_members.cc: Same.
+ * config/os/gnu-linux/ctype_noninline.h: Use locale::classic().
+
+ * docs/html/22_locale/locale.html: Add bits about global locales
+ and "C" setlocale.
+
+ * testsuite/22_locale/facet.cc (test02): Add.
+ * testsuite/22_locale/static_members.cc (test02): Add.
+ * testsuite/22_locale/ctor_copy_dtor.cc (test04): Add.
+
+2002-10-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * include/std/std_limits.h (__glibcpp_char_digits10): Fix Typo.
+ (__glibcpp_char_digits10): Likewise.
+
+2002-10-10 Jonathan Lennox <lennox@cs.columbia.edu>
+
+ PR libstdc++/8071, libstdc++/8127, c++/6745
+ * streambuf.tcc (__copy_streambufs): Handle cases where
+ __sbin->in_avail() returns 0, or where __sbin doesn't set gptr().
+ * testsuite/27_io/ostream_inserter_other.cc (test05): Add.
+
2002-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.am (all-multi): Fix multilib parallel build.
diff --git a/contrib/libstdc++/Makefile.am b/contrib/libstdc++/Makefile.am
index d412477..b234723 100644
--- a/contrib/libstdc++/Makefile.am
+++ b/contrib/libstdc++/Makefile.am
@@ -49,7 +49,7 @@ check-script-install: $(top_builddir)/mkcheck
baseline_file = @baseline_file@
check-abi: $(top_builddir)/testsuite/abi_check
-@(cd testsuite; \
- ${top_srcdir}/config/abi/extract_symvers \
+ @glibcpp_srcdir@/config/abi/extract_symvers \
../src/.libs/libstdc++.so \
./current_symbols.txt; \
./abi_check --check ./current_symbols.txt ${baseline_file})
@@ -61,7 +61,7 @@ new-abi-baseline:
t=`echo $${output} | sed 's=.*config/abi/=='`; \
echo "Baseline file already exists, writing to $${t} instead."; \
fi; \
- ${top_srcdir}/config/abi/extract_symvers \
+ @glibcpp_srcdir@/config/abi/extract_symvers \
src/.libs/libstdc++.so $${output})
# These rules are messy, but are hella worth it.
diff --git a/contrib/libstdc++/Makefile.in b/contrib/libstdc++/Makefile.in
index 7181507..c84983d 100644
--- a/contrib/libstdc++/Makefile.in
+++ b/contrib/libstdc++/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -157,7 +157,44 @@ MULTICLEAN = true
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
+AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "includedir=$(includedir)" \
+ "prefix=$(prefix)" \
+ "tooldir=$(tooldir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "NM=$(NM)" \
+ "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
+ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+ "DESTDIR=$(DESTDIR)" \
+ "WERROR=$(WERROR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
@@ -169,7 +206,7 @@ mkcheck.in testsuite_flags.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
@@ -446,7 +483,7 @@ check-script-install: $(top_builddir)/mkcheck
@glibcpp_builddir@/mkcheck 1)
check-abi: $(top_builddir)/testsuite/abi_check
-@(cd testsuite; \
- ${top_srcdir}/config/abi/extract_symvers \
+ @glibcpp_srcdir@/config/abi/extract_symvers \
../src/.libs/libstdc++.so \
./current_symbols.txt; \
./abi_check --check ./current_symbols.txt ${baseline_file})
@@ -458,7 +495,7 @@ new-abi-baseline:
t=`echo $${output} | sed 's=.*config/abi/=='`; \
echo "Baseline file already exists, writing to $${t} instead."; \
fi; \
- ${top_srcdir}/config/abi/extract_symvers \
+ @glibcpp_srcdir@/config/abi/extract_symvers \
src/.libs/libstdc++.so $${output})
# These rules are messy, but are hella worth it.
diff --git a/contrib/libstdc++/acconfig.h b/contrib/libstdc++/acconfig.h
index aa0dd99..777e94a 100644
--- a/contrib/libstdc++/acconfig.h
+++ b/contrib/libstdc++/acconfig.h
@@ -46,6 +46,20 @@
// Define if you have the copysignf function.
#undef _GLIBCPP_HAVE_COPYSIGNF
+// Define to use symbol versioning in the shared library.
+#undef _GLIBCPP_SYMVER
+
+// Define symbol versioning in assember directives. If symbol
+// versioning is beigng used, and the assembler supports this kind of
+// thing, then use it.
+// NB: _GLIBCPP_AT_AT is a hack to work around quoting issues in m4.
+#if _GLIBCPP_SYMVER
+ #define _GLIBCPP_ASM_SYMVER(cur, old, version) \
+ asm (".symver " #cur "," #old _GLIBCPP_AT_AT #version);
+#else
+ #define _GLIBCPP_ASM_SYMVER(cur, old, version)
+#endif
+
// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
diff --git a/contrib/libstdc++/acinclude.m4 b/contrib/libstdc++/acinclude.m4
index a7ab248..a8bfebd 100644
--- a/contrib/libstdc++/acinclude.m4
+++ b/contrib/libstdc++/acinclude.m4
@@ -2201,6 +2201,7 @@ case $enable_symvers in
;;
gnu)
LINKER_MAP=config/linker-map.gnu
+ AC_DEFINE(_GLIBCPP_SYMVER)
;;
esac
diff --git a/contrib/libstdc++/aclocal.m4 b/contrib/libstdc++/aclocal.m4
index abb3ba9..2dd5fe2 100644
--- a/contrib/libstdc++/aclocal.m4
+++ b/contrib/libstdc++/aclocal.m4
@@ -2213,6 +2213,7 @@ case $enable_symvers in
;;
gnu)
LINKER_MAP=config/linker-map.gnu
+ AC_DEFINE(_GLIBCPP_SYMVER)
;;
esac
diff --git a/contrib/libstdc++/config.h.in b/contrib/libstdc++/config.h.in
index fcc2c3e..de9f397 100644
--- a/contrib/libstdc++/config.h.in
+++ b/contrib/libstdc++/config.h.in
@@ -24,6 +24,20 @@
// Define to use concept checking code from the boost libraries.
#undef _GLIBCPP_CONCEPT_CHECKS
+// Define to use symbol versioning in the shared library.
+#undef _GLIBCPP_SYMVER
+
+// Define symbol versioning in assember directives. If symbol
+// versioning is beigng used, and the assembler supports this kind of
+// thing, then use it.
+// NB: _GLIBCPP_AT_AT is a hack to work around quoting issues in m4.
+#if _GLIBCPP_SYMVER
+ #define _GLIBCPP_ASM_SYMVER(cur, old, version) \
+ asm (".symver " #cur "," #old _GLIBCPP_AT_AT #version);
+#else
+ #define _GLIBCPP_ASM_SYMVER(cur, old, version)
+#endif
+
// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
diff --git a/contrib/libstdc++/config/linker-map.gnu b/contrib/libstdc++/config/linker-map.gnu
index d4346b1..f82002a 100644
--- a/contrib/libstdc++/config/linker-map.gnu
+++ b/contrib/libstdc++/config/linker-map.gnu
@@ -20,7 +20,6 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-
GLIBCPP_3.2 {
global:
@@ -29,21 +28,120 @@ GLIBCPP_3.2 {
# All but the last are terminated with a semicolon.
extern "C++"
{
- std::[A-Za-z]*;
+ std::[A-Za]*;
+ std::ba[a-r]*;
+ std::basic_[a-r]*;
+ std::basic_streambuf*;
+ std::basic_stringbuf*;
+ std::basic_stringstream*;
+ std::basic_[t-z]*;
+ std::ba[t-z]*;
+ std::b[b-z]*;
+ std::c[a-n]*;
+ std::co[a-c]*;
+ std::codecvt_byname*;
+ std::codecvt::[A-Za-b]*;
+ std::codecvt::[A-Zd-z]*;
+ std::codecvt_c;
+ std::codecvt_w;
+ std::co[e-z]*;
+ std::c[p-z]*;
+ std::c_[a-z]*;
+ std::[A-Zd-k]*;
+ std::length_error*;
+ std::logic_error*;
+ std::locale::[A-Za-z]*;
+ std::locale::_[A-Ra-z]*;
+ std::locale::_S_classic;
+ std::locale::_S_global;
+ std::locale::_S_num_categories;
+ std::locale::_S_normalize_category*;
+ std::locale::_[T-Za-z]*;
+ std::[A-Zm-z]*;
std::__throw_*;
std::__basic_file*;
std::__num_base*;
std::__timepunct*;
std::__numeric_limits_base*;
std::_S_bit_count;
- std::_S_first_one;
- std::__default_alloc_template*;
- std::__malloc_alloc_template*
+ std::_S_first_one
};
# Names not in an 'extern' block are mangled names.
+
+ # std::string minus binary operator plus
+ _ZNKSs*;
+ _ZNKSb*;
+ _ZNSs[A-Za-z]*;
+ _ZNSs[0-9][A-Za-z]*;
+ _ZNSs[0-9][0-9][A-Za-z]*;
+ _ZNSs[0-9]_[A-Ra-z]*;
+ _ZNSs[0-9][0-9]_[A-Ra-z]*;
+ _ZNSs12_S_empty_repEv;
+ _ZNSs20_S_empty_rep_storageE;
+ _ZNSbIwSt11char_traitsIwESaIwEE20_S_empty_rep_storageE;
+ _ZNSs12_S_constructE*;
+ _ZNSs13_S_copy_charsE*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[A-Ra-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-9][A-Ra-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-9][0-9][A-Ra-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-9]_[A-Ra-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-9][0-9]_[A-Ra-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE13_S_copy_chars*;
+ _ZNSbIwSt11char_traitsIwESaIwEE12_S_constructE[jm]wRKS1_;
+ _ZNSbIwSt11char_traitsIwESaIwEE12_S_empty_repEv;
+ _ZSt24__uninitialized_copy_auxIN9*;
+ _ZSt26__uninitialized_fill_n_aux*;
+ _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_;
+ _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ES3_RKS6_;
+ _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_EPKS3_RKS6_;
+ _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ES3_RKS6_;
+
+ # std::locale destructors
+ _ZNSt6localeD*;
+
+ # std::codecvt<char> members.
+ _ZNKSt7codecvtIcc11__mbstate_tE*;
+ # std::codecvt<char>::~codecvt
+ _ZNSt7codecvtIcc11__mbstate_tED*;
+ # std::codecvt<char>::codecvt(size_t), where size_t variable.
+ _ZNSt7codecvtIcc11__mbstate_tEC[12]E[jm];
+ # std::codecvt<char>::id
+ _ZNSt7codecvtIcc11__mbstate_tE2idE;
+
+ # std::codecvt<wchar_t> members.
+ _ZNKSt7codecvtIwc11__mbstate_tE*;
+ # std::codecvt<wchar_t>::~codecvt
+ _ZNSt7codecvtIwc11__mbstate_tED*;
+ # std::codecvt<wchar_t>::codecvt(size_t), where size_t variable.
+ _ZNSt7codecvtIwc11__mbstate_tEC[12]E[jm];
+ # std::codecvt<wchar_t>::id
+ _ZNSt7codecvtIwc11__mbstate_tE2idE;
+
+ # std::use_facet<codecvt>
+ _ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale;
+ _ZSt9use_facetISt7codecvtIwc11__mbstate_tEERKT_RKSt6locale;
+
+ # std::has_facet*
_ZSt9has_facet*;
+ # std::__default_alloc_template
+ _ZNSt24__default_alloc_templateILb1ELi0EE10deallocate*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE8allocate*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE12_S_free_listE;
+ _ZNSt24__default_alloc_templateILb1ELi0EE22_S_node_allocator_lockE;
+ _ZNSt24__default_alloc_templateILb1ELi0EE9_S_refillE*;
+
+ # std::__default_alloc_template to be removed in the future
+ _ZNSt24__default_alloc_templateILb1ELi0EE10reallocateEPv*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE11_S_round_upE*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE14_S_chunk_allocE*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE17_S_freelist_indexE*;
+ _ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE;
+ _ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE;
+ _ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE;
+ _ZNSt24__default_alloc_templateILb1ELi0EE5_Lock*;
+
# operator new(unsigned)
_Znwj;
# operator new(unsigned, std::nothrow_t const&)
@@ -72,8 +170,8 @@ GLIBCPP_3.2 {
# operator delete[](void*, std::nothrow_t const&)
_ZdaPvRKSt9nothrow_t;
- # vtable
- _ZTV*;
+ # vtable
+ _ZTV*;
_ZTT*;
# typeinfo
@@ -95,6 +193,54 @@ GLIBCPP_3.2 {
*;
};
+# Symbols added after GLIBCPP_3.2
+GLIBCPP_3.2.1 {
+
+ _ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structj;
+ _ZNSt7codecvtIcc11__mbstate_tEC2EP15__locale_structj;
+ _ZNSt7codecvtIwc11__mbstate_tEC1EP15__locale_structj;
+ _ZNSt7codecvtIwc11__mbstate_tEC2EP15__locale_structj;
+
+ _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_;
+ _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_;
+
+ _ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE;
+
+ # stub functions from libmath
+ sinf;
+ sinl;
+ sinhf;
+ sinhl;
+ cosf;
+ cosl;
+ coshf;
+ coshl;
+ tanf;
+ tanl;
+ tanhf;
+ tanhl;
+ atan2f;
+ atan2l;
+ expf;
+ expl;
+ hypotf;
+ hypotl;
+ hypot;
+ logf;
+ logl;
+ log10f;
+ log10l;
+ powf;
+ powl;
+ sqrtf;
+ sqrtl;
+ copysignf;
+ nan;
+ __signbit;
+ __signbitf;
+ __signbitl;
+
+} GLIBCPP_3.2;
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.2 {
diff --git a/contrib/libstdc++/config/locale/generic/c_locale.cc b/contrib/libstdc++/config/locale/generic/c_locale.cc
index e274836..689bbf5 100644
--- a/contrib/libstdc++/config/locale/generic/c_locale.cc
+++ b/contrib/libstdc++/config/locale/generic/c_locale.cc
@@ -223,4 +223,15 @@ namespace std
__c_locale
locale::facet::_S_clone_c_locale(__c_locale&)
{ return __c_locale(); }
+
+ const char* locale::_S_categories[_S_categories_size
+ + _S_extra_categories_size] =
+ {
+ "LC_CTYPE",
+ "LC_NUMERIC",
+ "LC_COLLATE",
+ "LC_TIME",
+ "LC_MONETARY",
+ "LC_MESSAGES"
+ };
} // namespace std
diff --git a/contrib/libstdc++/config/locale/generic/c_locale.h b/contrib/libstdc++/config/locale/generic/c_locale.h
index bfd9bf0..9627d86 100644
--- a/contrib/libstdc++/config/locale/generic/c_locale.h
+++ b/contrib/libstdc++/config/locale/generic/c_locale.h
@@ -35,6 +35,8 @@
#include <clocale>
+#define _GLIBCPP_NUM_CATEGORIES 0
+
namespace std
{
typedef int* __c_locale;
diff --git a/contrib/libstdc++/config/locale/generic/time_members.cc b/contrib/libstdc++/config/locale/generic/time_members.cc
index d02f0c3..fd45645 100644
--- a/contrib/libstdc++/config/locale/generic/time_members.cc
+++ b/contrib/libstdc++/config/locale/generic/time_members.cc
@@ -39,13 +39,6 @@
namespace std
{
template<>
- __timepunct<char>::~__timepunct()
- {
- if (_M_c_locale_timepunct != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_timepunct);
- }
-
- template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
@@ -122,13 +115,6 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
- __timepunct<wchar_t>::~__timepunct()
- {
- if (_M_c_locale_timepunct != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_timepunct);
- }
-
- template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
diff --git a/contrib/libstdc++/config/locale/gnu/c_locale.cc b/contrib/libstdc++/config/locale/gnu/c_locale.cc
index 3982a65..188f3a2 100644
--- a/contrib/libstdc++/config/locale/gnu/c_locale.cc
+++ b/contrib/libstdc++/config/locale/gnu/c_locale.cc
@@ -178,9 +178,29 @@ namespace std
void
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
- { __freelocale(__cloc); }
+ {
+ if (_S_c_locale != __cloc)
+ __freelocale(__cloc);
+ }
__c_locale
locale::facet::_S_clone_c_locale(__c_locale& __cloc)
{ return __duplocale(__cloc); }
+
+ const char* locale::_S_categories[_S_categories_size
+ + _S_extra_categories_size] =
+ {
+ "LC_CTYPE",
+ "LC_NUMERIC",
+ "LC_COLLATE",
+ "LC_TIME",
+ "LC_MONETARY",
+ "LC_MESSAGES",
+ "LC_PAPER",
+ "LC_NAME",
+ "LC_ADDRESS",
+ "LC_TELEPHONE",
+ "LC_MEASUREMENT",
+ "LC_IDENTIFICATION"
+ };
} // namespace std
diff --git a/contrib/libstdc++/config/locale/gnu/c_locale.h b/contrib/libstdc++/config/locale/gnu/c_locale.h
index aabbe6a..130b843 100644
--- a/contrib/libstdc++/config/locale/gnu/c_locale.h
+++ b/contrib/libstdc++/config/locale/gnu/c_locale.h
@@ -40,6 +40,8 @@
#define _GLIBCPP_C_LOCALE_GNU 1
+#define _GLIBCPP_NUM_CATEGORIES 6
+
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
namespace __gnu_cxx
{
diff --git a/contrib/libstdc++/config/locale/gnu/ctype_members.cc b/contrib/libstdc++/config/locale/gnu/ctype_members.cc
index db1e356..3b78c60 100644
--- a/contrib/libstdc++/config/locale/gnu/ctype_members.cc
+++ b/contrib/libstdc++/config/locale/gnu/ctype_members.cc
@@ -44,8 +44,7 @@ namespace std
ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
: ctype<char>(0, false, __refs)
{
- if (_M_c_locale_ctype != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_ctype);
+ _S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
diff --git a/contrib/libstdc++/config/locale/gnu/monetary_members.cc b/contrib/libstdc++/config/locale/gnu/monetary_members.cc
index 68b154b..0386ab6 100644
--- a/contrib/libstdc++/config/locale/gnu/monetary_members.cc
+++ b/contrib/libstdc++/config/locale/gnu/monetary_members.cc
@@ -220,7 +220,7 @@ namespace std
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = '.';
@@ -265,7 +265,7 @@ namespace std
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = '.';
@@ -319,7 +319,7 @@ namespace std
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
const char* __name)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = L'.';
@@ -348,14 +348,12 @@ namespace std
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
- mbstate_t __state;
- size_t __len;
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
- // NB: Should swich to __cloc's ctype info first.
- __len = strlen(__cpossign);
+ mbstate_t __state;
+ size_t __len = strlen(__cpossign);
if (__len)
{
++__len;
@@ -418,7 +416,7 @@ namespace std
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
const char* __name)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = L'.';
@@ -446,13 +444,12 @@ namespace std
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
- mbstate_t __state;
- size_t __len;
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
- // NB: Should swich to __cloc's ctype info first.
+ mbstate_t __state;
+ size_t __len;
__len = strlen(__cpossign);
if (__len)
{
diff --git a/contrib/libstdc++/config/locale/gnu/numeric_members.cc b/contrib/libstdc++/config/locale/gnu/numeric_members.cc
index b71374c..a502bfb 100644
--- a/contrib/libstdc++/config/locale/gnu/numeric_members.cc
+++ b/contrib/libstdc++/config/locale/gnu/numeric_members.cc
@@ -42,7 +42,7 @@ namespace std
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = '.';
@@ -76,7 +76,7 @@ namespace std
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
_M_decimal_point = L'.';
diff --git a/contrib/libstdc++/config/locale/gnu/time_members.cc b/contrib/libstdc++/config/locale/gnu/time_members.cc
index ce3d9bf..7df10b8 100644
--- a/contrib/libstdc++/config/locale/gnu/time_members.cc
+++ b/contrib/libstdc++/config/locale/gnu/time_members.cc
@@ -40,13 +40,6 @@
namespace std
{
template<>
- __timepunct<char>::~__timepunct()
- {
- if (_M_c_locale_timepunct != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_timepunct);
- }
-
- template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
@@ -67,11 +60,10 @@ namespace std
void
__timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
-
- _M_c_locale_timepunct = _S_c_locale;
+ _M_c_locale_timepunct = _S_c_locale;
_M_date_format = "%m/%d/%y";
_M_date_era_format = "%m/%d/%y";
@@ -193,13 +185,6 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
- __timepunct<wchar_t>::~__timepunct()
- {
- if (_M_c_locale_timepunct != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_timepunct);
- }
-
- template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
@@ -220,11 +205,10 @@ namespace std
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
{
- if (__cloc == _S_c_locale)
+ if (!__cloc)
{
// "C" locale
-
- _M_c_locale_timepunct = _S_c_locale;
+ _M_c_locale_timepunct = _S_c_locale;
_M_date_format = L"%m/%d/%y";
_M_date_era_format = L"%m/%d/%y";
diff --git a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
index 1578828..8f06d13 100644
--- a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
+++ b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
@@ -38,8 +38,7 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
{
- if (!_S_c_locale)
- _S_create_c_locale(_S_c_locale, "C");
+ locale::classic();
return _S_c_locale->__ctype_b;
}
#else
@@ -96,7 +95,7 @@
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
- _M_c_locale_ctype = _S_c_locale;
+ _M_c_locale_ctype = _S_c_locale;
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
diff --git a/contrib/libstdc++/configure b/contrib/libstdc++/configure
index 50d041e..cf56c86 100755
--- a/contrib/libstdc++/configure
+++ b/contrib/libstdc++/configure
@@ -830,7 +830,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
- for ac_prog in gawk mawk nawk awk
+ for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -1458,7 +1458,7 @@ else
if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.$ac_ext | *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -4080,7 +4080,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
# GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
# GLIBCPP_CHECK_MATH_SUPPORT
- case "$target_alias" in
+ case "$target" in
*-linux*)
# Check for available headers.
for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
@@ -8752,7 +8752,7 @@ EOF
;;
esac
- case "$target_alias" in
+ case "$target" in
*-mingw32*)
;;
*)
@@ -21325,7 +21325,7 @@ else
fi
rm -f conftest*
- for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -21457,24 +21457,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -21582,7 +21569,7 @@ main()
}
EOF
-if { (eval echo configure:21586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -21613,17 +21600,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21617: checking for $ac_hdr" >&5
+echo "configure:21604: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 21622 "configure"
+#line 21609 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -21656,7 +21643,7 @@ done
# Can't do these in a loop, else the resulting syntax is wrong.
cat > conftest.$ac_ext <<EOF
-#line 21660 "configure"
+#line 21647 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#include <unistd.h>
@@ -21665,7 +21652,7 @@ int main() {
int f = RLIMIT_DATA ;
; return 0; }
EOF
-if { (eval echo configure:21669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -21682,7 +21669,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 21686 "configure"
+#line 21673 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#include <unistd.h>
@@ -21691,7 +21678,7 @@ int main() {
int f = RLIMIT_RSS ;
; return 0; }
EOF
-if { (eval echo configure:21695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -21708,7 +21695,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 21712 "configure"
+#line 21699 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#include <unistd.h>
@@ -21717,7 +21704,7 @@ int main() {
int f = RLIMIT_VMEM ;
; return 0; }
EOF
-if { (eval echo configure:21721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -21734,7 +21721,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 21738 "configure"
+#line 21725 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#include <unistd.h>
@@ -21743,7 +21730,7 @@ int main() {
int f = RLIMIT_AS ;
; return 0; }
EOF
-if { (eval echo configure:21747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -21765,7 +21752,7 @@ EOF
else
cat > conftest.$ac_ext <<EOF
-#line 21769 "configure"
+#line 21756 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#include <unistd.h>
@@ -21774,7 +21761,7 @@ int main() {
struct rlimit r; setrlimit(0, &r);
; return 0; }
EOF
-if { (eval echo configure:21778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_setrlimit=yes
else
@@ -21790,7 +21777,7 @@ fi
fi
echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6
-echo "configure:21794: checking for testsuite memory limit support" >&5
+echo "configure:21781: checking for testsuite memory limit support" >&5
if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
ac_mem_limits=yes
cat >> confdefs.h <<\EOF
@@ -21806,7 +21793,7 @@ EOF
# Look for setenv, so that extended locale tests can be performed.
echo $ac_n "checking for setenv declaration""... $ac_c" 1>&6
-echo "configure:21810: checking for setenv declaration" >&5
+echo "configure:21797: checking for setenv declaration" >&5
if test x${glibcpp_cv_func_setenv_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_setenv_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -21821,14 +21808,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 21825 "configure"
+#line 21812 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {
setenv(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:21832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_setenv_use=yes
else
@@ -21854,12 +21841,12 @@ fi
for ac_func in setenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21858: checking for $ac_func" >&5
+echo "configure:21845: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 21863 "configure"
+#line 21850 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -21882,7 +21869,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:21886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -21952,18 +21939,18 @@ fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
echo $ac_n "checking for shared libgcc""... $ac_c" 1>&6
-echo "configure:21956: checking for shared libgcc" >&5
+echo "configure:21943: checking for shared libgcc" >&5
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
cat > conftest.$ac_ext <<EOF
-#line 21960 "configure"
+#line 21947 "configure"
#include "confdefs.h"
int main() {
return 0
; return 0; }
EOF
-if { (eval echo configure:21967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_shared_libgcc=yes
else
@@ -21997,14 +21984,14 @@ if test $enable_symvers = yes ; then
echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
cat > conftest.$ac_ext <<EOF
-#line 22001 "configure"
+#line 21988 "configure"
#include "confdefs.h"
int foo;
int main() {
; return 0; }
EOF
-if { (eval echo configure:22008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
enable_symvers=gnu
else
@@ -22032,6 +22019,10 @@ case $enable_symvers in
;;
gnu)
LINKER_MAP=config/linker-map.gnu
+ cat >> confdefs.h <<\EOF
+#define _GLIBCPP_SYMVER 1
+EOF
+
;;
esac
@@ -22046,7 +22037,7 @@ else
GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE=
fi
echo $ac_n "checking versioning on shared library symbols""... $ac_c" 1>&6
-echo "configure:22050: checking versioning on shared library symbols" >&5
+echo "configure:22041: checking versioning on shared library symbols" >&5
echo "$ac_t""$enable_symvers" 1>&6
@@ -22134,7 +22125,7 @@ glibcpp_prefixdir=${prefix}
# Process the option --with-gxx-include-dir=<path to include-files directory>
echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6
-echo "configure:22138: checking for --with-gxx-include-dir" >&5
+echo "configure:22129: checking for --with-gxx-include-dir" >&5
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
if test "${with_gxx_include_dir+set}" = set; then
withval="$with_gxx_include_dir"
@@ -22158,7 +22149,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6
# Process the option "--enable-version-specific-runtime-libs"
echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6
-echo "configure:22162: checking for --enable-version-specific-runtime-libs" >&5
+echo "configure:22153: checking for --enable-version-specific-runtime-libs" >&5
# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
if test "${enable_version_specific_runtime_libs+set}" = set; then
enableval="$enable_version_specific_runtime_libs"
@@ -22204,7 +22195,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then
fi
echo $ac_n "checking for install location""... $ac_c" 1>&6
-echo "configure:22208: checking for install location" >&5
+echo "configure:22199: checking for install location" >&5
echo "$ac_t""$gxx_include_dir" 1>&6
diff --git a/contrib/libstdc++/configure.in b/contrib/libstdc++/configure.in
index d30e61b..d98463d 100644
--- a/contrib/libstdc++/configure.in
+++ b/contrib/libstdc++/configure.in
@@ -91,7 +91,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
# GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
# GLIBCPP_CHECK_MATH_SUPPORT
- case "$target_alias" in
+ case "$target" in
*-linux*)
# Check for available headers.
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
@@ -185,7 +185,7 @@ changequote([,])dnl
;;
esac
- case "$target_alias" in
+ case "$target" in
*-mingw32*)
;;
*)
diff --git a/contrib/libstdc++/include/bits/basic_ios.tcc b/contrib/libstdc++/include/bits/basic_ios.tcc
index a38a95b..7ee8015 100644
--- a/contrib/libstdc++/include/bits/basic_ios.tcc
+++ b/contrib/libstdc++/include/bits/basic_ios.tcc
@@ -187,7 +187,10 @@ namespace std
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
extern template class basic_ios<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_ios<wchar_t>;
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/basic_string.tcc b/contrib/libstdc++/include/bits/basic_string.tcc
index 6d646ad..4a22d89 100644
--- a/contrib/libstdc++/include/bits/basic_string.tcc
+++ b/contrib/libstdc++/include/bits/basic_string.tcc
@@ -139,13 +139,13 @@ namespace std
{
size_type __dnew = static_cast<size_type>(distance(__beg, __end));
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refcopy();
+
// NB: Not required, but considered best practice.
if (__builtin_expect(__beg == _InIter(), 0))
__throw_logic_error("attempt to create string with null pointer");
- if (__beg == __end && __a == _Alloc())
- return _S_empty_rep()._M_refcopy();
-
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, __a);
try
@@ -223,8 +223,8 @@ namespace std
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, const _Alloc& __a)
- : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) : 0,
- __a), __a)
+ : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
@@ -497,7 +497,6 @@ namespace std
this->erase(__n);
// else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
}
-
// This is the general replace helper, which currently gets instantiated both
// for input iterators and reverse iterators. It buffers internally and then
@@ -885,9 +884,11 @@ namespace std
compare(const _CharT* __s) const
{
size_type __size = this->size();
- int __r = traits_type::compare(_M_data(), __s, __size);
+ size_type __osize = traits_type::length(__s);
+ size_type __len = min(__size, __osize);
+ int __r = traits_type::compare(_M_data(), __s, __len);
if (!__r)
- __r = __size - traits_type::length(__s);
+ __r = __size - __osize;
return __r;
}
@@ -958,6 +959,7 @@ namespace std
basic_istream<char>&
getline(basic_istream<char>&, string&);
+#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_string<wchar_t>;
extern template
basic_istream<wchar_t>&
@@ -971,6 +973,7 @@ namespace std
extern template
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/c++config b/contrib/libstdc++/include/bits/c++config
index 41c3ba8..4315bae 100644
--- a/contrib/libstdc++/include/bits/c++config
+++ b/contrib/libstdc++/include/bits/c++config
@@ -34,7 +34,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCPP__ 20021009
+#define __GLIBCPP__ 20021119
// This is necessary until GCC supports separate template
// compilation.
@@ -55,6 +55,9 @@
// Use corrected code from the committee library group's issues list.
#define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
+// Hopefully temporary workaround to autoconf/m4 issue with quoting '@'.
+#define _GLIBCPP_AT_AT "@@"
+
// In those parts of the standard C++ library that use a mutex instead
// of a spin-lock, we now unconditionally use GCC's gthr.h mutex
// abstraction layer. All support to directly map to various
diff --git a/contrib/libstdc++/include/bits/fstream.tcc b/contrib/libstdc++/include/bits/fstream.tcc
index 18dbaf1..66cb9a1 100644
--- a/contrib/libstdc++/include/bits/fstream.tcc
+++ b/contrib/libstdc++/include/bits/fstream.tcc
@@ -477,13 +477,16 @@ namespace std
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
extern template class basic_filebuf<char>;
- extern template class basic_filebuf<wchar_t>;
extern template class basic_ifstream<char>;
- extern template class basic_ifstream<wchar_t>;
extern template class basic_ofstream<char>;
- extern template class basic_ofstream<wchar_t>;
extern template class basic_fstream<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern template class basic_filebuf<wchar_t>;
+ extern template class basic_ifstream<wchar_t>;
+ extern template class basic_ofstream<wchar_t>;
extern template class basic_fstream<wchar_t>;
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/ios_base.h b/contrib/libstdc++/include/bits/ios_base.h
index f5b0269..a56475c 100644
--- a/contrib/libstdc++/include/bits/ios_base.h
+++ b/contrib/libstdc++/include/bits/ios_base.h
@@ -220,6 +220,9 @@ namespace std
typedef int io_state;
typedef int open_mode;
typedef int seek_dir;
+
+ typedef std::streampos streampos;
+ typedef std::streamoff streamoff;
#endif
// Callbacks;
diff --git a/contrib/libstdc++/include/bits/istream.tcc b/contrib/libstdc++/include/bits/istream.tcc
index 58e2caf..a6e49a9 100644
--- a/contrib/libstdc++/include/bits/istream.tcc
+++ b/contrib/libstdc++/include/bits/istream.tcc
@@ -811,8 +811,9 @@ namespace std
{
try
{
+ // Cannot compare int_type with streamsize generically.
streamsize __num = this->rdbuf()->in_avail();
- if (__num > 0)
+ if (__num >= 0)
{
__num = min(__num, __n);
if (__num)
@@ -935,23 +936,8 @@ namespace std
tellg(void)
{
pos_type __ret = pos_type(-1);
- _M_gcount = 0;
- sentry __cerb(*this, true);
- if (__cerb)
- {
- try
- {
- __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
- }
- catch(exception& __fail)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
return __ret;
}
@@ -962,28 +948,16 @@ namespace std
seekg(pos_type __pos)
{
_M_gcount = 0;
- sentry __cerb(*this, true);
- if (__cerb)
+ if (!this->fail())
{
- try
- {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
+ pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
// 129. Need error indication from seekp() and seekg()
- if (__err == pos_type(off_type(-1)))
- this->setstate(ios_base::failbit);
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(ios_base::failbit);
#endif
- }
- catch(exception& __fail)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
}
return *this;
}
@@ -994,29 +968,17 @@ namespace std
seekg(off_type __off, ios_base::seekdir __dir)
{
_M_gcount = 0;
- sentry __cerb(*this, true);
- if (__cerb)
+ if (!this->fail())
{
- try
- {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
- ios_base::in);
+ pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
// 129. Need error indication from seekp() and seekg()
- if (__err == pos_type(off_type(-1)))
- this->setstate(ios_base::failbit);
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(ios_base::failbit);
#endif
- }
- catch(exception& __fail)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
}
return *this;
}
@@ -1073,13 +1035,14 @@ namespace std
int_type __c = __sb->sgetc();
while (__extracted < __num - 1
- && __c != __eof && !__ctype.is(ctype_base::space, __c))
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ctype.is(ctype_base::space, __c))
{
*__s++ = __c;
++__extracted;
__c = __sb->snextc();
}
- if (__c == __eof)
+ if (_Traits::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
@@ -1117,9 +1080,11 @@ namespace std
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
- while (__c != __eof && __ctype.is(ctype_base::space, __c))
+ while (!_Traits::eq_int_type(__c, __eof)
+ && __ctype.is(ctype_base::space, __c))
__c = __sb->snextc();
- if (__c == __eof)
+
+ if (_Traits::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
return __in;
@@ -1153,13 +1118,14 @@ namespace std
__int_type __c = __sb->sgetc();
while (__extracted < __n
- && __c != __eof && !__ctype.is(ctype_base::space, __c))
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ctype.is(ctype_base::space, __c))
{
__str += _Traits::to_char_type(__c);
++__extracted;
__c = __sb->snextc();
}
- if (__c == __eof)
+ if (_Traits::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
__in.width(0);
}
diff --git a/contrib/libstdc++/include/bits/locale_facets.h b/contrib/libstdc++/include/bits/locale_facets.h
index f99562f..660bad3 100644
--- a/contrib/libstdc++/include/bits/locale_facets.h
+++ b/contrib/libstdc++/include/bits/locale_facets.h
@@ -525,7 +525,7 @@ namespace std
// For use at construction time only.
void
- _M_initialize_numpunct(__c_locale __cloc = _S_c_locale);
+ _M_initialize_numpunct(__c_locale __cloc = NULL);
};
template<typename _CharT>
@@ -875,10 +875,7 @@ namespace std
protected:
virtual
~collate()
- {
- if (_M_c_locale_collate != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_collate);
- }
+ { _S_destroy_c_locale(_M_c_locale_collate); }
virtual int
do_compare(const _CharT* __lo1, const _CharT* __hi1,
@@ -924,8 +921,7 @@ namespace std
collate_byname(const char* __s, size_t __refs = 0)
: collate<_CharT>(__refs)
{
- if (_M_c_locale_collate != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_collate);
+ _S_destroy_c_locale(_M_c_locale_collate);
_S_create_c_locale(_M_c_locale_collate, __s);
}
@@ -956,7 +952,7 @@ namespace std
protected:
__c_locale _M_c_locale_timepunct;
- const char* _M_name_timepunct;
+ char* _M_name_timepunct;
const _CharT* _M_date_format;
const _CharT* _M_date_era_format;
const _CharT* _M_time_format;
@@ -1016,13 +1012,21 @@ namespace std
public:
explicit
__timepunct(size_t __refs = 0)
- : locale::facet(__refs), _M_name_timepunct("C")
- { _M_initialize_timepunct(); }
+ : locale::facet(__refs)
+ {
+ _M_name_timepunct = new char[2];
+ strcpy(_M_name_timepunct, "C");
+ _M_initialize_timepunct();
+ }
explicit
__timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
- : locale::facet(__refs), _M_name_timepunct(__s)
- { _M_initialize_timepunct(__cloc); }
+ : locale::facet(__refs)
+ {
+ _M_name_timepunct = new char[strlen(__s) + 1];
+ strcpy(_M_name_timepunct, __s);
+ _M_initialize_timepunct(__cloc);
+ }
void
_M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
@@ -1119,20 +1123,21 @@ namespace std
protected:
virtual
- ~__timepunct();
+ ~__timepunct()
+ {
+ delete [] _M_name_timepunct;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
// For use at construction time only.
void
- _M_initialize_timepunct(__c_locale __cloc = _S_c_locale);
+ _M_initialize_timepunct(__c_locale __cloc = NULL);
};
template<typename _CharT>
locale::id __timepunct<_CharT>::id;
// Specializations.
- template<>
- __timepunct<char>::~__timepunct();
-
template<>
const char*
__timepunct<char>::_S_timezones[14];
@@ -1146,9 +1151,6 @@ namespace std
__timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
#ifdef _GLIBCPP_USE_WCHAR_T
- template<>
- __timepunct<wchar_t>::~__timepunct();
-
template<>
const wchar_t*
__timepunct<wchar_t>::_S_timezones[14];
@@ -1459,7 +1461,7 @@ namespace std
// For use at construction time only.
void
- _M_initialize_moneypunct(__c_locale __cloc = _S_c_locale,
+ _M_initialize_moneypunct(__c_locale __cloc = NULL,
const char* __name = NULL);
};
@@ -1628,7 +1630,7 @@ namespace std
__c_locale _M_c_locale_messages;
#if 1
// Only needed if glibc < 2.3
- const char* _M_name_messages;
+ char* _M_name_messages;
#endif
public:
@@ -1636,15 +1638,20 @@ namespace std
explicit
messages(size_t __refs = 0)
- : locale::facet(__refs), _M_name_messages("C")
- { _M_c_locale_messages = _S_c_locale; }
+ : locale::facet(__refs)
+ {
+ _M_name_messages = new char[2];
+ strcpy(_M_name_messages, "C");
+ _M_c_locale_messages = _S_c_locale;
+ }
// Non-standard.
explicit
- messages(__c_locale __cloc, const char* __name, size_t __refs = 0)
+ messages(__c_locale __cloc, const char* __s, size_t __refs = 0)
: locale::facet(__refs)
{
- _M_name_messages = __name;
+ _M_name_messages = new char[strlen(__s) + 1];
+ strcpy(_M_name_messages, __s);
_M_c_locale_messages = _S_clone_c_locale(__cloc);
}
@@ -1668,8 +1675,8 @@ namespace std
virtual
~messages()
{
- if (_M_c_locale_messages != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_messages);
+ delete [] _M_name_messages;
+ _S_destroy_c_locale(_M_c_locale_messages);
}
virtual catalog
@@ -1758,9 +1765,10 @@ namespace std
messages_byname(const char* __s, size_t __refs = 0)
: messages<_CharT>(__refs)
{
- _M_name_messages = __s;
- if (_M_c_locale_messages != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_messages);
+ delete [] _M_name_messages;
+ _M_name_messages = new char[strlen(__s) + 1];
+ strcpy(_M_name_messages, __s);
+ _S_destroy_c_locale(_M_c_locale_messages);
_S_create_c_locale(_M_c_locale_messages, __s);
}
diff --git a/contrib/libstdc++/include/bits/locale_facets.tcc b/contrib/libstdc++/include/bits/locale_facets.tcc
index f21054e..ce6f3d7 100644
--- a/contrib/libstdc++/include/bits/locale_facets.tcc
+++ b/contrib/libstdc++/include/bits/locale_facets.tcc
@@ -2140,42 +2140,21 @@ namespace std
extern template class moneypunct_byname<char, true>;
extern template class money_get<char>;
extern template class money_put<char>;
- extern template class moneypunct<wchar_t, false>;
- extern template class moneypunct<wchar_t, true>;
- extern template class moneypunct_byname<wchar_t, false>;
- extern template class moneypunct_byname<wchar_t, true>;
- extern template class money_get<wchar_t>;
- extern template class money_put<wchar_t>;
extern template class numpunct<char>;
extern template class numpunct_byname<char>;
extern template class num_get<char>;
extern template class num_put<char>;
- extern template class numpunct<wchar_t>;
- extern template class numpunct_byname<wchar_t>;
- extern template class num_get<wchar_t>;
- extern template class num_put<wchar_t>;
extern template class __timepunct<char>;
extern template class time_put<char>;
extern template class time_put_byname<char>;
extern template class time_get<char>;
extern template class time_get_byname<char>;
- extern template class __timepunct<wchar_t>;
- extern template class time_put<wchar_t>;
- extern template class time_put_byname<wchar_t>;
- extern template class time_get<wchar_t>;
- extern template class time_get_byname<wchar_t>;
extern template class messages<char>;
extern template class messages_byname<char>;
- extern template class messages<wchar_t>;
- extern template class messages_byname<wchar_t>;
extern template class ctype_byname<char>;
- extern template class ctype_byname<wchar_t>;
extern template class codecvt_byname<char, char, mbstate_t>;
- extern template class codecvt_byname<wchar_t, char, mbstate_t>;
extern template class collate<char>;
extern template class collate_byname<char>;
- extern template class collate<wchar_t>;
- extern template class collate_byname<wchar_t>;
extern template
const codecvt<char, char, mbstate_t>&
@@ -2229,59 +2208,6 @@ namespace std
const messages<char>&
use_facet<messages<char> >(const locale&);
- extern template
- const codecvt<wchar_t, char, mbstate_t>&
- use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
-
- extern template
- const collate<wchar_t>&
- use_facet<collate<wchar_t> >(const locale&);
-
- extern template
- const numpunct<wchar_t>&
- use_facet<numpunct<wchar_t> >(const locale&);
-
- extern template
- const num_put<wchar_t>&
- use_facet<num_put<wchar_t> >(const locale&);
-
- extern template
- const num_get<wchar_t>&
- use_facet<num_get<wchar_t> >(const locale&);
-
- extern template
- const moneypunct<wchar_t, true>&
- use_facet<moneypunct<wchar_t, true> >(const locale&);
-
- extern template
- const moneypunct<wchar_t, false>&
- use_facet<moneypunct<wchar_t, false> >(const locale&);
-
- extern template
- const money_put<wchar_t>&
- use_facet<money_put<wchar_t> >(const locale&);
-
- extern template
- const money_get<wchar_t>&
- use_facet<money_get<wchar_t> >(const locale&);
-
- extern template
- const __timepunct<wchar_t>&
- use_facet<__timepunct<wchar_t> >(const locale&);
-
- extern template
- const time_put<wchar_t>&
- use_facet<time_put<wchar_t> >(const locale&);
-
- extern template
- const time_get<wchar_t>&
- use_facet<time_get<wchar_t> >(const locale&);
-
- extern template
- const messages<wchar_t>&
- use_facet<messages<wchar_t> >(const locale&);
-
-
extern template
bool
has_facet<ctype<char> >(const locale&);
@@ -2334,6 +2260,81 @@ namespace std
bool
has_facet<messages<char> >(const locale&);
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern template class moneypunct<wchar_t, false>;
+ extern template class moneypunct<wchar_t, true>;
+ extern template class moneypunct_byname<wchar_t, false>;
+ extern template class moneypunct_byname<wchar_t, true>;
+ extern template class money_get<wchar_t>;
+ extern template class money_put<wchar_t>;
+ extern template class numpunct<wchar_t>;
+ extern template class numpunct_byname<wchar_t>;
+ extern template class num_get<wchar_t>;
+ extern template class num_put<wchar_t>;
+ extern template class __timepunct<wchar_t>;
+ extern template class time_put<wchar_t>;
+ extern template class time_put_byname<wchar_t>;
+ extern template class time_get<wchar_t>;
+ extern template class time_get_byname<wchar_t>;
+ extern template class messages<wchar_t>;
+ extern template class messages_byname<wchar_t>;
+ extern template class ctype_byname<wchar_t>;
+ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+ extern template class collate<wchar_t>;
+ extern template class collate_byname<wchar_t>;
+
+ extern template
+ const codecvt<wchar_t, char, mbstate_t>&
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
+
+ extern template
+ const collate<wchar_t>&
+ use_facet<collate<wchar_t> >(const locale&);
+
+ extern template
+ const numpunct<wchar_t>&
+ use_facet<numpunct<wchar_t> >(const locale&);
+
+ extern template
+ const num_put<wchar_t>&
+ use_facet<num_put<wchar_t> >(const locale&);
+
+ extern template
+ const num_get<wchar_t>&
+ use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+ const moneypunct<wchar_t, true>&
+ use_facet<moneypunct<wchar_t, true> >(const locale&);
+
+ extern template
+ const moneypunct<wchar_t, false>&
+ use_facet<moneypunct<wchar_t, false> >(const locale&);
+
+ extern template
+ const money_put<wchar_t>&
+ use_facet<money_put<wchar_t> >(const locale&);
+
+ extern template
+ const money_get<wchar_t>&
+ use_facet<money_get<wchar_t> >(const locale&);
+
+ extern template
+ const __timepunct<wchar_t>&
+ use_facet<__timepunct<wchar_t> >(const locale&);
+
+ extern template
+ const time_put<wchar_t>&
+ use_facet<time_put<wchar_t> >(const locale&);
+
+ extern template
+ const time_get<wchar_t>&
+ use_facet<time_get<wchar_t> >(const locale&);
+
+ extern template
+ const messages<wchar_t>&
+ use_facet<messages<wchar_t> >(const locale&);
+
extern template
bool
has_facet<ctype<wchar_t> >(const locale&);
@@ -2385,6 +2386,7 @@ namespace std
extern template
bool
has_facet<messages<wchar_t> >(const locale&);
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/localefwd.h b/contrib/libstdc++/include/bits/localefwd.h
index 028c412..d8d742b 100644
--- a/contrib/libstdc++/include/bits/localefwd.h
+++ b/contrib/libstdc++/include/bits/localefwd.h
@@ -207,8 +207,8 @@ namespace std
static const category time = 1L << 3;
static const category monetary = 1L << 4;
static const category messages = 1L << 5;
- static const category all = (collate | ctype | monetary |
- numeric | time | messages);
+ static const category all = (ctype | numeric | collate |
+ time | monetary | messages);
// Construct/copy/destroy:
locale() throw();
@@ -267,7 +267,26 @@ namespace std
// Current global reference locale
static _Impl* _S_global;
- static const size_t _S_num_categories = 6;
+ // Number of standard categories. For C++, these categories are
+ // collate, ctype, monetary, numeric, time, and messages. These
+ // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
+ // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE
+ // 1003.1-2001) specifies LC_MESSAGES.
+ static const size_t _S_categories_size = 6;
+
+ // In addition to the standard categories, the underlying
+ // operating system is allowed to define extra LC_*
+ // macros. For GNU systems, the following are also valid:
+ // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT,
+ // and LC_IDENTIFICATION.
+ static const size_t _S_extra_categories_size = _GLIBCPP_NUM_CATEGORIES;
+
+ // Names of underlying locale categories.
+ // NB: locale::global() has to know how to modify all the
+ // underlying categories, not just the ones required by the C++
+ // standard.
+ static const char* _S_categories[_S_categories_size
+ + _S_extra_categories_size];
explicit
locale(_Impl*) throw();
@@ -308,7 +327,9 @@ namespace std
_Atomic_word _M_references;
facet** _M_facets;
size_t _M_facets_size;
- const char* _M_names[_S_num_categories];
+
+ char* _M_names[_S_categories_size
+ + _S_extra_categories_size];
static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[];
static const locale::id* const _S_id_collate[];
@@ -348,8 +369,10 @@ namespace std
_M_check_same_name()
{
bool __ret = true;
- for (size_t i = 0; __ret && i < _S_num_categories - 1; ++i)
- __ret &= (strcmp(_M_names[i], _M_names[i + 1]) == 0);
+ for (size_t __i = 0;
+ __ret && __i < _S_categories_size + _S_extra_categories_size - 1;
+ ++__i)
+ __ret &= (strcmp(_M_names[__i], _M_names[__i + 1]) == 0);
return __ret;
}
@@ -376,8 +399,14 @@ namespace std
{
_M_impl = new _Impl(*__other._M_impl, 1);
_M_impl->_M_install_facet(&_Facet::id, __f);
- for (size_t __i = 0; __i < _S_num_categories; ++__i)
- _M_impl->_M_names[__i] = "*";
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size; ++__i)
+ {
+ delete [] _M_impl->_M_names[__i];
+ char* __new = new char[2];
+ strcpy(__new, "*");
+ _M_impl->_M_names[__i] = __new;
+ }
}
// 22.1.1.1.2 Class locale::facet
diff --git a/contrib/libstdc++/include/bits/sstream.tcc b/contrib/libstdc++/include/bits/sstream.tcc
index 99eb6af..606705c 100644
--- a/contrib/libstdc++/include/bits/sstream.tcc
+++ b/contrib/libstdc++/include/bits/sstream.tcc
@@ -226,13 +226,16 @@ namespace std
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
extern template class basic_stringbuf<char>;
- extern template class basic_stringbuf<wchar_t>;
extern template class basic_istringstream<char>;
- extern template class basic_istringstream<wchar_t>;
extern template class basic_ostringstream<char>;
- extern template class basic_ostringstream<wchar_t>;
extern template class basic_stringstream<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern template class basic_stringbuf<wchar_t>;
+ extern template class basic_istringstream<wchar_t>;
+ extern template class basic_ostringstream<wchar_t>;
extern template class basic_stringstream<wchar_t>;
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/streambuf.tcc b/contrib/libstdc++/include/bits/streambuf.tcc
index 2f790e9..c8084ee 100644
--- a/contrib/libstdc++/include/bits/streambuf.tcc
+++ b/contrib/libstdc++/include/bits/streambuf.tcc
@@ -208,19 +208,28 @@ namespace std
try
{
while (__testput && __bufsize != -1)
- {
- __xtrct = __sbout->sputn(__sbin->gptr(), __bufsize);
- __ret += __xtrct;
- __sbin->_M_in_cur_move(__xtrct);
- if (__xtrct == __bufsize)
+ {
+ if (__bufsize != 0 && __sbin->gptr() != NULL)
{
- if (_Traits::eq_int_type(__sbin->sgetc(), _Traits::eof()))
+ __xtrct = __sbout->sputn(__sbin->gptr(), __bufsize);
+ __ret += __xtrct;
+ __sbin->_M_in_cur_move(__xtrct);
+ if (__xtrct != __bufsize)
break;
- __bufsize = __sbin->in_avail();
}
- else
- break;
- }
+ else
+ {
+ _CharT __buf[256];
+ streamsize __charsread = __sbin->sgetn(__buf, sizeof(__buf));
+ __xtrct = __sbout->sputn(__buf, __charsread);
+ __ret += __xtrct;
+ if (__xtrct != __charsread)
+ break;
+ }
+ if (_Traits::eq_int_type(__sbin->sgetc(), _Traits::eof()))
+ break;
+ __bufsize = __sbin->in_avail();
+ }
}
catch(exception& __fail)
{
@@ -240,11 +249,13 @@ namespace std
__copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
basic_streambuf<char>*);
+#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_streambuf<wchar_t>;
extern template
streamsize
__copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
basic_streambuf<wchar_t>*);
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/bits/stringfwd.h b/contrib/libstdc++/include/bits/stringfwd.h
index b7418a6..db40bef 100644
--- a/contrib/libstdc++/include/bits/stringfwd.h
+++ b/contrib/libstdc++/include/bits/stringfwd.h
@@ -45,23 +45,25 @@
namespace std
{
- template<class _CharT>
- struct char_traits;
-
- template<> struct char_traits<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
- template<> struct char_traits<wchar_t>;
-#endif
-
template<typename _Alloc>
class allocator;
+ template<class _CharT>
+ struct char_traits;
+
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
+
+ template<> struct char_traits<char>;
typedef basic_string<char> string;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<> struct char_traits<wchar_t>;
+
typedef basic_string<wchar_t> wstring;
+#endif
} // namespace std
#endif // _CPP_BITS_STRINGFWD_H
diff --git a/contrib/libstdc++/include/std/std_iomanip.h b/contrib/libstdc++/include/std/std_iomanip.h
index e046c82..23237ce 100644
--- a/contrib/libstdc++/include/std/std_iomanip.h
+++ b/contrib/libstdc++/include/std/std_iomanip.h
@@ -225,25 +225,27 @@ namespace std
extern template ostream& operator<<(ostream&, _Setbase);
extern template ostream& operator<<(ostream&, _Setprecision);
extern template ostream& operator<<(ostream&, _Setw);
- extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
- extern template wostream& operator<<(wostream&, _Setiosflags);
- extern template wostream& operator<<(wostream&, _Resetiosflags);
- extern template wostream& operator<<(wostream&, _Setbase);
- extern template wostream& operator<<(wostream&, _Setprecision);
- extern template wostream& operator<<(wostream&, _Setw);
-
extern template istream& operator>>(istream&, _Setfill<char>);
extern template istream& operator>>(istream&, _Setiosflags);
extern template istream& operator>>(istream&, _Resetiosflags);
extern template istream& operator>>(istream&, _Setbase);
extern template istream& operator>>(istream&, _Setprecision);
extern template istream& operator>>(istream&, _Setw);
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
+ extern template wostream& operator<<(wostream&, _Setiosflags);
+ extern template wostream& operator<<(wostream&, _Resetiosflags);
+ extern template wostream& operator<<(wostream&, _Setbase);
+ extern template wostream& operator<<(wostream&, _Setprecision);
+ extern template wostream& operator<<(wostream&, _Setw);
extern template wistream& operator>>(wistream&, _Setfill<wchar_t>);
extern template wistream& operator>>(wistream&, _Setiosflags);
extern template wistream& operator>>(wistream&, _Resetiosflags);
extern template wistream& operator>>(wistream&, _Setbase);
extern template wistream& operator>>(wistream&, _Setprecision);
extern template wistream& operator>>(wistream&, _Setw);
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/std/std_iosfwd.h b/contrib/libstdc++/include/std/std_iosfwd.h
index f76ca7c..797f493 100644
--- a/contrib/libstdc++/include/std/std_iosfwd.h
+++ b/contrib/libstdc++/include/std/std_iosfwd.h
@@ -116,6 +116,7 @@ namespace std
typedef basic_ofstream<char> ofstream;
typedef basic_fstream<char> fstream;
+#ifdef _GLIBCPP_USE_WCHAR_T
typedef basic_ios<wchar_t> wios;
typedef basic_streambuf<wchar_t> wstreambuf;
typedef basic_istream<wchar_t> wistream;
@@ -129,6 +130,7 @@ namespace std
typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
+#endif
} // namespace std
#endif
diff --git a/contrib/libstdc++/include/std/std_iostream.h b/contrib/libstdc++/include/std/std_iostream.h
index 5b3da9c..d0736b8 100644
--- a/contrib/libstdc++/include/std/std_iostream.h
+++ b/contrib/libstdc++/include/std/std_iostream.h
@@ -51,6 +51,7 @@ namespace std
extern ostream cout;
extern ostream cerr;
extern ostream clog;
+
#ifdef _GLIBCPP_USE_WCHAR_T
extern wistream wcin;
extern wostream wcout;
diff --git a/contrib/libstdc++/include/std/std_limits.h b/contrib/libstdc++/include/std/std_limits.h
index 64d8a9b..5f70dda 100644
--- a/contrib/libstdc++/include/std/std_limits.h
+++ b/contrib/libstdc++/include/std/std_limits.h
@@ -292,12 +292,12 @@
#define __glibcpp_char_min (char)__glibcpp_signed_char_min
#define __glibcpp_char_max (char)__glibcpp_signed_char_max
#define __glibcpp_char_digits __glibcpp_signed_char_digits
-#define __glibcpp_char_digits10 __glibcpp_signed_char_digits
+#define __glibcpp_char_digits10 __glibcpp_signed_char_digits10
#else
#define __glibcpp_char_min (char)__glibcpp_unsigned_char_min
#define __glibcpp_char_max (char)__glibcpp_unsigned_char_max
#define __glibcpp_char_digits __glibcpp_unsigned_char_digits
-#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits
+#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits10
#endif
// short
diff --git a/contrib/libstdc++/include/std/std_sstream.h b/contrib/libstdc++/include/std/std_sstream.h
index 07e47b5..6ee7505 100644
--- a/contrib/libstdc++/include/std/std_sstream.h
+++ b/contrib/libstdc++/include/std/std_sstream.h
@@ -105,7 +105,8 @@ namespace std
void
str(const __string_type& __s)
{
- _M_string = __s;
+ // Cannot use _M_string = __s, since v3 strings are COW.
+ _M_string.assign(__s.data(), __s.size());
_M_stringbuf_init(_M_mode);
}
diff --git a/contrib/libstdc++/libio/ChangeLog b/contrib/libstdc++/libio/ChangeLog
index 86c0903..d0055fd 100644
--- a/contrib/libstdc++/libio/ChangeLog
+++ b/contrib/libstdc++/libio/ChangeLog
@@ -1,3 +1,31 @@
+2002-11-19 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-11-19 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-11-18 Release Manager
+
+ * GCC 3.2.1 Released.
+
+2002-08-14 Release Manager
+
+ * GCC 3.2 Released.
+
+2002-07-25 Release Manager
+
+ * GCC 3.1.1 Released.
+
+2002-05-14 Release Manager
+
+ * GCC 3.1 Released.
+
+2002-05-14 Release Manager
+
+ * GCC 3.1 Released.
+
2001-02-03 Alexandre Oliva <aoliva@redhat.com>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
diff --git a/contrib/libstdc++/libio/Makefile.in b/contrib/libstdc++/libio/Makefile.in
index 085c1af..a5384b8 100644
--- a/contrib/libstdc++/libio/Makefile.in
+++ b/contrib/libstdc++/libio/Makefile.in
@@ -68,9 +68,6 @@ AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
AWK = @AWK@
BASIC_FILE_H = @BASIC_FILE_H@
-BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCODECVT_C = @CCODECVT_C@
CCODECVT_H = @CCODECVT_H@
@@ -78,29 +75,17 @@ CLOCALE_H = @CLOCALE_H@
CMESSAGES_H = @CMESSAGES_H@
CPP = @CPP@
CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
-CSHADOW_FLAGS = @CSHADOW_FLAGS@
CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
-DATADIRNAME = @DATADIRNAME@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GENCAT = @GENCAT@
-GLIBC21 = @GLIBC21@
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-INSTOBJEXT = @INSTOBJEXT@
-INTLBISON = @INTLBISON@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
-LIBICONV = @LIBICONV@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
@@ -110,25 +95,21 @@ LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+baseline_file = @baseline_file@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
@@ -147,7 +128,6 @@ gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
libio_la = @libio_la@
libtool_VERSION = @libtool_VERSION@
-release_VERSION = @release_VERSION@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 cygnus
diff --git a/contrib/libstdc++/src/codecvt.cc b/contrib/libstdc++/src/codecvt.cc
index a2fb42d..1fe6b97 100644
--- a/contrib/libstdc++/src/codecvt.cc
+++ b/contrib/libstdc++/src/codecvt.cc
@@ -50,7 +50,7 @@ namespace std
codecvt<char, char, mbstate_t>::
~codecvt()
- { }
+ { }
codecvt_base::result
codecvt<char, char, mbstate_t>::
diff --git a/contrib/libstdc++/src/ctype.cc b/contrib/libstdc++/src/ctype.cc
index 7ca934e..3d5ee61 100644
--- a/contrib/libstdc++/src/ctype.cc
+++ b/contrib/libstdc++/src/ctype.cc
@@ -79,8 +79,7 @@ namespace std
ctype<char>::~ctype()
{
- if (_M_c_locale_ctype != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_ctype);
+ _S_destroy_c_locale(_M_c_locale_ctype);
if (_M_del)
delete[] this->table();
}
@@ -135,17 +134,13 @@ namespace std
{ _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
ctype<wchar_t>::~ctype()
- {
- if (_M_c_locale_ctype != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_ctype);
- }
+ { _S_destroy_c_locale(_M_c_locale_ctype); }
template<>
ctype_byname<wchar_t>::ctype_byname(const char* __s, size_t __refs)
: ctype<wchar_t>(__refs)
{
- if (_M_c_locale_ctype != _S_c_locale)
- _S_destroy_c_locale(_M_c_locale_ctype);
+ _S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
}
#endif
diff --git a/contrib/libstdc++/src/globals.cc b/contrib/libstdc++/src/globals.cc
index 36d193f..c6ff69c 100644
--- a/contrib/libstdc++/src/globals.cc
+++ b/contrib/libstdc++/src/globals.cc
@@ -44,163 +44,209 @@
// Because <iostream> declares the standard streams to be [io]stream
// types instead of say [io]fstream types, it is also necessary to
// allocate the actual file buffers in this file.
-namespace std
+namespace __gnu_cxx
{
- // Standard "C" locale.
- typedef char fake_locale[sizeof(locale)]
- __attribute__ ((aligned(__alignof__(locale))));
- fake_locale c_locale;
+ using namespace std;
+
+ typedef char fake_facet_name[sizeof(char*)]
+ __attribute__ ((aligned(__alignof__(char*))));
+ fake_facet_name facet_name[6 + _GLIBCPP_NUM_CATEGORIES];
typedef char fake_locale_Impl[sizeof(locale::_Impl)]
__attribute__ ((aligned(__alignof__(locale::_Impl))));
fake_locale_Impl c_locale_impl;
-
+
+
+ // NB: The asm directives renames these non-exported, namespace
+ // __gnu_cxx symbols into the mistakenly exported, namespace std
+ // symbols in GLIBCPP_3.2.
+ // The rename syntax is
+ // asm (".symver currentname,oldname@@GLIBCPP_3.2")
+ // At the same time, these new __gnu_cxx symbols are not exported.
+ // In the future, GLIBCXX_ABI > 5 should remove all uses of
+ // _GLIBCPP_ASM_SYMVER in this file.
+ typedef char fake_locale[sizeof(locale)]
+ __attribute__ ((aligned(__alignof__(locale))));
+ fake_locale c_locale;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8c_localeE, _ZSt8c_locale, GLIBCPP_3.2)
+
+ // GLIBCXX_ABI > 5 will not need this symbol at all.
+ // It's here just as a placeholder, as the size of this exported
+ // object changed. The new symbol is not exported.
+ const int o = sizeof(locale::_Impl) - sizeof(char*[_GLIBCPP_NUM_CATEGORIES]);
+ typedef char fake_locale_Impl_compat[o]
+ __attribute__ ((aligned(__alignof__(o))));
+ fake_locale_Impl_compat c_locale_impl_compat;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx20c_locale_impl_compatE, _ZSt13c_locale_impl, GLIBCPP_3.2)
+
typedef char fake_facet_vec[sizeof(locale::facet*)]
__attribute__ ((aligned(__alignof__(locale::facet*))));
fake_facet_vec facet_vec[_GLIBCPP_NUM_FACETS];
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9facet_vecE, _ZSt9facet_vec, GLIBCPP_3.2)
typedef char fake_ctype_c[sizeof(std::ctype<char>)]
__attribute__ ((aligned(__alignof__(std::ctype<char>))));
fake_ctype_c ctype_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx7ctype_cE, _ZSt7ctype_c, GLIBCPP_3.2)
typedef char fake_collate_c[sizeof(std::collate<char>)]
__attribute__ ((aligned(__alignof__(std::collate<char>))));
fake_collate_c collate_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9collate_cE, _ZSt9collate_c, GLIBCPP_3.2)
typedef char fake_numpunct_c[sizeof(numpunct<char>)]
__attribute__ ((aligned(__alignof__(numpunct<char>))));
fake_numpunct_c numpunct_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10numpunct_cE, _ZSt10numpunct_c, GLIBCPP_3.2)
typedef char fake_num_get_c[sizeof(num_get<char>)]
__attribute__ ((aligned(__alignof__(num_get<char>))));
fake_num_get_c num_get_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9num_get_cE, _ZSt9num_get_c, GLIBCPP_3.2)
typedef char fake_num_put_c[sizeof(num_put<char>)]
__attribute__ ((aligned(__alignof__(num_put<char>))));
fake_num_put_c num_put_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9num_put_cE, _ZSt9num_put_c, GLIBCPP_3.2)
typedef char fake_codecvt_c[sizeof(codecvt<char, char, mbstate_t>)]
__attribute__ ((aligned(__alignof__(codecvt<char, char, mbstate_t>))));
fake_codecvt_c codecvt_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9codecvt_cE, _ZSt9codecvt_c, GLIBCPP_3.2)
typedef char fake_moneypunct_c[sizeof(moneypunct<char, true>)]
__attribute__ ((aligned(__alignof__(moneypunct<char, true>))));
fake_moneypunct_c moneypunct_tc;
fake_moneypunct_c moneypunct_fc;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx13moneypunct_tcE,\
+ _ZSt13moneypunct_tc, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx13moneypunct_fcE,\
+ _ZSt13moneypunct_fc, GLIBCPP_3.2)
typedef char fake_money_get_c[sizeof(money_get<char>)]
__attribute__ ((aligned(__alignof__(money_get<char>))));
fake_money_get_c money_get_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11money_get_cE, _ZSt11money_get_c, GLIBCPP_3.2)
typedef char fake_money_put_c[sizeof(money_put<char>)]
__attribute__ ((aligned(__alignof__(money_put<char>))));
fake_money_put_c money_put_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11money_put_cE, _ZSt11money_put_c, GLIBCPP_3.2)
typedef char fake_timepunct_c[sizeof(__timepunct<char>)]
__attribute__ ((aligned(__alignof__(__timepunct<char>))));
fake_timepunct_c timepunct_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11timepunct_cE, _ZSt11timepunct_c, GLIBCPP_3.2)
typedef char fake_time_get_c[sizeof(time_get<char>)]
__attribute__ ((aligned(__alignof__(time_get<char>))));
fake_time_get_c time_get_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10time_get_cE, _ZSt10time_get_c, GLIBCPP_3.2)
typedef char fake_time_put_c[sizeof(time_put<char>)]
__attribute__ ((aligned(__alignof__(time_put<char>))));
fake_time_put_c time_put_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10time_put_cE, _ZSt10time_put_c, GLIBCPP_3.2)
typedef char fake_messages_c[sizeof(messages<char>)]
__attribute__ ((aligned(__alignof__(messages<char>))));
fake_messages_c messages_c;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10messages_cE, _ZSt10messages_c, GLIBCPP_3.2)
#ifdef _GLIBCPP_USE_WCHAR_T
typedef char fake_wtype_w[sizeof(std::ctype<wchar_t>)]
__attribute__ ((aligned(__alignof__(std::ctype<wchar_t>))));
fake_wtype_w ctype_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx7ctype_wE, _ZSt7ctype_w, GLIBCPP_3.2)
typedef char fake_wollate_w[sizeof(std::collate<wchar_t>)]
__attribute__ ((aligned(__alignof__(std::collate<wchar_t>))));
fake_wollate_w collate_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9collate_wE, _ZSt9collate_w, GLIBCPP_3.2)
typedef char fake_numpunct_w[sizeof(numpunct<wchar_t>)]
__attribute__ ((aligned(__alignof__(numpunct<wchar_t>))));
fake_numpunct_w numpunct_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10numpunct_wE, _ZSt10numpunct_w, GLIBCPP_3.2)
typedef char fake_num_get_w[sizeof(num_get<wchar_t>)]
__attribute__ ((aligned(__alignof__(num_get<wchar_t>))));
fake_num_get_w num_get_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9num_get_wE, _ZSt9num_get_w, GLIBCPP_3.2)
typedef char fake_num_put_w[sizeof(num_put<wchar_t>)]
__attribute__ ((aligned(__alignof__(num_put<wchar_t>))));
fake_num_put_w num_put_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9num_put_wE, _ZSt9num_put_w, GLIBCPP_3.2)
typedef char fake_wodecvt_w[sizeof(codecvt<wchar_t, char, mbstate_t>)]
__attribute__ ((aligned(__alignof__(codecvt<wchar_t, char, mbstate_t>))));
fake_wodecvt_w codecvt_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9codecvt_wE, _ZSt9codecvt_w, GLIBCPP_3.2)
typedef char fake_moneypunct_w[sizeof(moneypunct<wchar_t, true>)]
__attribute__ ((aligned(__alignof__(moneypunct<wchar_t, true>))));
fake_moneypunct_w moneypunct_tw;
fake_moneypunct_w moneypunct_fw;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx13moneypunct_twE,\
+ _ZSt13moneypunct_tw, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx13moneypunct_fwE,\
+ _ZSt13moneypunct_fw, GLIBCPP_3.2)
typedef char fake_money_get_w[sizeof(money_get<wchar_t>)]
__attribute__ ((aligned(__alignof__(money_get<wchar_t>))));
fake_money_get_w money_get_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11money_get_wE, _ZSt11money_get_w, GLIBCPP_3.2)
typedef char fake_money_put_w[sizeof(money_put<wchar_t>)]
__attribute__ ((aligned(__alignof__(money_put<wchar_t>))));
fake_money_put_w money_put_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11money_put_wE, _ZSt11money_put_w, GLIBCPP_3.2)
typedef char fake_timepunct_w[sizeof(__timepunct<wchar_t>)]
__attribute__ ((aligned(__alignof__(__timepunct<wchar_t>))));
fake_timepunct_w timepunct_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx11timepunct_wE, _ZSt11timepunct_w, GLIBCPP_3.2)
typedef char fake_time_get_w[sizeof(time_get<wchar_t>)]
__attribute__ ((aligned(__alignof__(time_get<wchar_t>))));
fake_time_get_w time_get_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10time_get_wE, _ZSt10time_get_w, GLIBCPP_3.2)
typedef char fake_time_put_w[sizeof(time_put<wchar_t>)]
__attribute__ ((aligned(__alignof__(time_put<wchar_t>))));
fake_time_put_w time_put_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10time_put_wE, _ZSt10time_put_w, GLIBCPP_3.2)
typedef char fake_messages_w[sizeof(messages<wchar_t>)]
__attribute__ ((aligned(__alignof__(messages<wchar_t>))));
fake_messages_w messages_w;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10messages_wE, _ZSt10messages_w, GLIBCPP_3.2)
#endif
- // Standard stream objects.
- typedef char fake_istream[sizeof(istream)]
- __attribute__ ((aligned(__alignof__(istream))));
- typedef char fake_ostream[sizeof(ostream)]
- __attribute__ ((aligned(__alignof__(ostream))));
- fake_istream cin;
- fake_ostream cout;
- fake_ostream cerr;
- fake_ostream clog;
-
- typedef char fake_filebuf[sizeof(__gnu_cxx::stdio_filebuf<char>)]
- __attribute__ ((aligned(__alignof__(__gnu_cxx::stdio_filebuf<char>))));
+ typedef char fake_filebuf[sizeof(stdio_filebuf<char>)]
+ __attribute__ ((aligned(__alignof__(stdio_filebuf<char>))));
fake_filebuf buf_cout;
fake_filebuf buf_cin;
fake_filebuf buf_cerr;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8buf_coutE, _ZSt8buf_cout, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx7buf_cinE, _ZSt7buf_cin, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8buf_cerrE, _ZSt8buf_cerr, GLIBCPP_3.2)
#ifdef _GLIBCPP_USE_WCHAR_T
- typedef char fake_wistream[sizeof(wistream)]
- __attribute__ ((aligned(__alignof__(wistream))));
- typedef char fake_wostream[sizeof(wostream)]
- __attribute__ ((aligned(__alignof__(wostream))));
- fake_wistream wcin;
- fake_wostream wcout;
- fake_wostream wcerr;
- fake_wostream wclog;
-
- typedef char fake_wfilebuf[sizeof(__gnu_cxx::stdio_filebuf<wchar_t>)]
- __attribute__ ((aligned(__alignof__(__gnu_cxx::stdio_filebuf<wchar_t>))));
+ typedef char fake_wfilebuf[sizeof(stdio_filebuf<wchar_t>)]
+ __attribute__ ((aligned(__alignof__(stdio_filebuf<wchar_t>))));
fake_wfilebuf buf_wcout;
fake_wfilebuf buf_wcin;
fake_wfilebuf buf_wcerr;
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9buf_wcoutE, _ZSt9buf_wcout, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8buf_wcinE, _ZSt8buf_wcin, GLIBCPP_3.2)
+ _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx9buf_wcerrE, _ZSt9buf_wcerr, GLIBCPP_3.2)
#endif
+} // namespace __gnu_cxx
-
+namespace std
+{
// Globals for once-only runtime initialization of mutex objects. This
// allows static initialization of these objects on systems that need a
// function call to initialize a mutex. For example, see stl_threads.h.
@@ -223,4 +269,25 @@ namespace std
_GLIBCPP_mutex_address_init ()
{ __GTHREAD_MUTEX_INIT_FUNCTION (_GLIBCPP_mutex_address); }
#endif
-}
+
+ // Standard stream objects.
+ typedef char fake_istream[sizeof(istream)]
+ __attribute__ ((aligned(__alignof__(istream))));
+ typedef char fake_ostream[sizeof(ostream)]
+ __attribute__ ((aligned(__alignof__(ostream))));
+ fake_istream cin;
+ fake_ostream cout;
+ fake_ostream cerr;
+ fake_ostream clog;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ typedef char fake_wistream[sizeof(wistream)]
+ __attribute__ ((aligned(__alignof__(wistream))));
+ typedef char fake_wostream[sizeof(wostream)]
+ __attribute__ ((aligned(__alignof__(wostream))));
+ fake_wistream wcin;
+ fake_wostream wcout;
+ fake_wostream wcerr;
+ fake_wostream wclog;
+#endif
+} // namespace std
diff --git a/contrib/libstdc++/src/ios.cc b/contrib/libstdc++/src/ios.cc
index c1167f8..7bfdc5b 100644
--- a/contrib/libstdc++/src/ios.cc
+++ b/contrib/libstdc++/src/ios.cc
@@ -39,28 +39,34 @@
#include <bits/atomicity.h>
#include <ext/stdio_filebuf.h>
-namespace std
+namespace __gnu_cxx
{
// Extern declarations for global objects in src/globals.cc.
+ extern stdio_filebuf<char> buf_cout;
+ extern stdio_filebuf<char> buf_cin;
+ extern stdio_filebuf<char> buf_cerr;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern stdio_filebuf<wchar_t> buf_wcout;
+ extern stdio_filebuf<wchar_t> buf_wcin;
+ extern stdio_filebuf<wchar_t> buf_wcerr;
+#endif
+} // namespace __gnu_cxx
+
+namespace std
+{
+ using namespace __gnu_cxx;
+
extern istream cin;
extern ostream cout;
extern ostream cerr;
extern ostream clog;
- using __gnu_cxx::stdio_filebuf;
- extern stdio_filebuf<char> buf_cout;
- extern stdio_filebuf<char> buf_cin;
- extern stdio_filebuf<char> buf_cerr;
-
#ifdef _GLIBCPP_USE_WCHAR_T
extern wistream wcin;
extern wostream wcout;
extern wostream wcerr;
extern wostream wclog;
-
- extern stdio_filebuf<wchar_t> buf_wcout;
- extern stdio_filebuf<wchar_t> buf_wcin;
- extern stdio_filebuf<wchar_t> buf_wcerr;
#endif
// Definitions for static const data members of __ios_flags.
diff --git a/contrib/libstdc++/src/locale-inst.cc b/contrib/libstdc++/src/locale-inst.cc
index 5e6c675..8f2c863 100644
--- a/contrib/libstdc++/src/locale-inst.cc
+++ b/contrib/libstdc++/src/locale-inst.cc
@@ -35,11 +35,7 @@
#include <clocale>
#include <cstring>
#include <cassert>
-#include <limits>
-#include <exception>
#include <locale>
-#include <istream>
-#include <ostream>
namespace std
{
diff --git a/contrib/libstdc++/src/locale.cc b/contrib/libstdc++/src/locale.cc
index 6314ba6..127197d 100644
--- a/contrib/libstdc++/src/locale.cc
+++ b/contrib/libstdc++/src/locale.cc
@@ -31,19 +31,19 @@
#include <cassert>
#include <cctype>
#include <cwctype> // For towupper, etc.
-#include <limits>
-#include <exception>
#include <locale>
-#include <istream>
-#include <ostream>
#include <bits/atomicity.h>
-namespace std
+namespace __gnu_cxx
{
// Defined in globals.cc.
- extern locale c_locale;
- extern locale::_Impl c_locale_impl;
- extern locale::facet** facet_vec;
+ extern std::locale c_locale;
+ extern std::locale::_Impl c_locale_impl;
+} // namespace __gnu_cxx
+
+namespace std
+{
+ using namespace __gnu_cxx;
// Definitions for static const data members of locale.
const locale::category locale::none;
@@ -55,9 +55,14 @@ namespace std
const locale::category locale::messages;
const locale::category locale::all;
+ // In the future, GLIBCXX_ABI > 5 should remove all uses of
+ // _GLIBCPP_ASM_SYMVER in this file, and remove exports of any
+ // static data members of locale.
locale::_Impl* locale::_S_classic;
locale::_Impl* locale::_S_global;
- const size_t locale::_S_num_categories;
+ const size_t locale::_S_categories_size;
+ _GLIBCPP_ASM_SYMVER(_ZNSt6locale18_S_categories_sizeE, _ZNSt6locale17_S_num_categoriesE, GLIBCPP_3.2)
+ const size_t locale::_S_extra_categories_size;
// Definitions for static const data members of locale::id
_Atomic_word locale::id::_S_highwater; // init'd to 0 by linker
@@ -146,31 +151,12 @@ namespace std
locale::_Impl::_S_id_ctype,
locale::_Impl::_S_id_numeric,
locale::_Impl::_S_id_collate,
- locale::_Impl::_S_id_monetary,
locale::_Impl::_S_id_time,
+ locale::_Impl::_S_id_monetary,
locale::_Impl::_S_id_messages,
0
};
- locale::~locale() throw()
- { _M_impl->_M_remove_reference(); }
-
- void
- locale::_M_coalesce(const locale& __base, const locale& __add,
- category __cat)
- {
- __cat = _S_normalize_category(__cat);
- _M_impl = new _Impl(*__base._M_impl, 1);
-
- try
- { _M_impl->_M_replace_categories(__add._M_impl, __cat); }
- catch (...)
- {
- _M_impl->_M_remove_reference();
- __throw_exception_again;
- }
- }
-
locale::locale() throw()
{
_S_initialize();
@@ -182,6 +168,7 @@ namespace std
// This is used to initialize global and classic locales, and
// assumes that the _Impl objects are constructed correctly.
+ // The lack of a reference increment is intentional.
locale::locale(_Impl* __ip) throw() : _M_impl(__ip)
{ }
@@ -192,18 +179,110 @@ namespace std
_S_initialize();
if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
- else if (strcmp(__s, "") == 0)
+ else if (strcmp(__s, "") != 0)
+ _M_impl = new _Impl(__s, 1);
+ else
{
+ // Get it from the environment.
char* __env = getenv("LC_ALL");
- if (__env)
- _M_impl = new _Impl(__env, 1);
- else if ((__env = getenv("LANG")))
- _M_impl = new _Impl(__env, 1);
+ // If LC_ALL is set we are done.
+ if (__env && strcmp(__env, "") != 0)
+ {
+ if (strcmp(__env, "C") == 0 || strcmp(__env, "POSIX") == 0)
+ (_M_impl = _S_classic)->_M_add_reference();
+ else
+ _M_impl = new _Impl(__env, 1);
+ }
else
- (_M_impl = _S_classic)->_M_add_reference();
+ {
+ char* __res;
+ // LANG may set a default different from "C".
+ char* __env = getenv("LANG");
+ if (!__env || strcmp(__env, "") == 0 || strcmp(__env, "C") == 0
+ || strcmp(__env, "POSIX") == 0)
+ __res = strdup("C");
+ else
+ __res = strdup(__env);
+
+ // Scan the categories looking for the first one
+ // different from LANG.
+ size_t __i = 0;
+ if (strcmp(__res, "C") == 0)
+ for (__i = 0;
+ __i < _S_categories_size + _S_extra_categories_size;
+ ++__i)
+ {
+ __env = getenv(_S_categories[__i]);
+ if (__env && strcmp(__env, "") != 0
+ && strcmp(__env, "C") != 0
+ && strcmp(__env, "POSIX") != 0)
+ break;
+ }
+ else
+ for (__i = 0;
+ __i < _S_categories_size + _S_extra_categories_size;
+ ++__i)
+ {
+ __env = getenv(_S_categories[__i]);
+ if (__env && strcmp(__env, "") != 0
+ && strcmp(__env, __res) != 0)
+ break;
+ }
+
+ // If one is found, build the complete string of
+ // the form LC_CTYPE=xxx;LC_NUMERIC=yyy; and so on...
+ if (__i < _S_categories_size + _S_extra_categories_size)
+ {
+ string __str;
+ for (size_t __j = 0; __j < __i; ++__j)
+ {
+ __str += _S_categories[__j];
+ __str += "=";
+ __str += __res;
+ __str += ";";
+ }
+ __str += _S_categories[__i];
+ __str += "=";
+ __str += __env;
+ __str += ";";
+ __i++;
+ for (; __i < _S_categories_size
+ + _S_extra_categories_size; ++__i)
+ {
+ __env = getenv(_S_categories[__i]);
+ if (!__env || strcmp(__env, "") == 0)
+ {
+ __str += _S_categories[__i];
+ __str += '=';
+ __str += __res;
+ __str += ';';
+ }
+ else if (strcmp(__env, "C") == 0
+ || strcmp(__env, "POSIX") == 0)
+ {
+ __str += _S_categories[__i];
+ __str += "=C;";
+ }
+ else
+ {
+ __str += _S_categories[__i];
+ __str += "=";
+ __str += __env;
+ __str += ";";
+ }
+ }
+ __str.erase(__str.end() - 1);
+ _M_impl = new _Impl(__str.c_str(), 1);
+ }
+ // ... otherwise either an additional instance of
+ // the "C" locale or LANG.
+ else if (strcmp(__res, "C") == 0)
+ (_M_impl = _S_classic)->_M_add_reference();
+ else
+ _M_impl = new _Impl(__res, 1);
+ free(__res);
+ }
}
- else
- _M_impl = new _Impl(__s, 1);
}
else
__throw_runtime_error("attempt to create locale from NULL name");
@@ -221,6 +300,9 @@ namespace std
locale::locale(const locale& __base, const locale& __add, category __cat)
{ _M_coalesce(__base, __add, __cat); }
+ locale::~locale() throw()
+ { _M_impl->_M_remove_reference(); }
+
bool
locale::operator==(const locale& __rhs) const throw()
{
@@ -261,20 +343,22 @@ namespace std
string
locale::name() const
{
- // Need some kind of separator character. This one was pretty much
- // arbitrarily chosen as to not conflict with glibc locales: the
- // exact formatting is not set in stone.
- const char __separator = '|';
-
string __ret;
if (_M_impl->_M_check_same_name())
__ret = _M_impl->_M_names[0];
else
{
- for (size_t i = 0; i < _S_num_categories; ++i)
+ __ret += _S_categories[0];
+ __ret += "=";
+ __ret += _M_impl->_M_names[0];
+ for (size_t __i = 1;
+ __i < _S_categories_size + _S_extra_categories_size;
+ ++__i)
{
- __ret += __separator;
- __ret += _M_impl->_M_names[i];
+ __ret += ";";
+ __ret += _S_categories[__i];
+ __ret += "=";
+ __ret += _M_impl->_M_names[__i];
}
}
return __ret;
@@ -291,12 +375,8 @@ namespace std
try
{
// 26 Standard facets, 2 references.
- // One reference for _M_classic, one for _M_global
- facet** f = new(&facet_vec) facet*[_GLIBCPP_NUM_FACETS];
- for (size_t __i = 0; __i < _GLIBCPP_NUM_FACETS; ++__i)
- f[__i] = 0;
-
- _S_classic = new (&c_locale_impl) _Impl(f, 2, true);
+ // One reference for _S_classic, one for _S_global
+ _S_classic = new (&c_locale_impl) _Impl(0, 2, true);
_S_global = _S_classic;
new (&c_locale) locale(_S_classic);
}
@@ -313,6 +393,22 @@ namespace std
return c_locale;
}
+ void
+ locale::_M_coalesce(const locale& __base, const locale& __add,
+ category __cat)
+ {
+ __cat = _S_normalize_category(__cat);
+ _M_impl = new _Impl(*__base._M_impl, 1);
+
+ try
+ { _M_impl->_M_replace_categories(__add._M_impl, __cat); }
+ catch (...)
+ {
+ _M_impl->_M_remove_reference();
+ __throw_exception_again;
+ }
+ }
+
locale::category
locale::_S_normalize_category(category __cat)
{
@@ -361,11 +457,8 @@ namespace std
~facet() { }
locale::facet::
- facet(size_t __refs) throw() : _M_references(__refs)
- {
- if (!_S_c_locale)
- _S_create_c_locale(_S_c_locale, "C");
- }
+ facet(size_t __refs) throw() : _M_references(__refs ? 1 : 0)
+ { }
void
locale::facet::
@@ -376,7 +469,7 @@ namespace std
locale::facet::
_M_remove_reference() throw()
{
- if (__exchange_and_add(&_M_references, -1) == 0)
+ if (__exchange_and_add(&_M_references, -1) == 1)
{
try
{ delete this; }
diff --git a/contrib/libstdc++/src/localename.cc b/contrib/libstdc++/src/localename.cc
index 8fa9118..61aa952 100644
--- a/contrib/libstdc++/src/localename.cc
+++ b/contrib/libstdc++/src/localename.cc
@@ -30,9 +30,14 @@
#include <cstring>
#include <locale>
-namespace std
+namespace __gnu_cxx
{
+ using namespace std;
+
// Defined in globals.cc.
+ extern locale::facet** facet_vec;
+ extern char* facet_name[6 + _GLIBCPP_NUM_CATEGORIES];
+
extern std::ctype<char> ctype_c;
extern std::collate<char> collate_c;
extern numpunct<char> numpunct_c;
@@ -63,6 +68,11 @@ namespace std
extern time_put<wchar_t> time_put_w;
extern std::messages<wchar_t> messages_w;
#endif
+} // namespace __gnu_cxx
+
+namespace std
+{
+ using namespace __gnu_cxx;
locale::_Impl::
~_Impl() throw()
@@ -71,6 +81,10 @@ namespace std
if (_M_facets[__i])
_M_facets[__i]->_M_remove_reference();
delete [] _M_facets;
+
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size; ++__i)
+ delete [] _M_names[__i];
}
// Clone existing _Impl object.
@@ -95,14 +109,19 @@ namespace std
if (_M_facets[__i])
_M_facets[__i]->_M_add_reference();
}
- for (size_t __i = 0; __i < _S_num_categories; ++__i)
- _M_names[__i] = __imp._M_names[__i];
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size; ++__i)
+ {
+ char* __new = new char[strlen(__imp._M_names[__i]) + 1];
+ strcpy(__new, __imp._M_names[__i]);
+ _M_names[__i] = __new;
+ }
}
// Construct named _Impl.
locale::_Impl::
_Impl(const char* __s, size_t __refs)
- : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS) // XXX
+ : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS)
{
// Initialize the underlying locale model, which also checks
// to see if the given name is valid.
@@ -122,11 +141,40 @@ namespace std
}
// Name all the categories.
- for (size_t i = 0; i < _S_num_categories; ++i)
- _M_names[i] = __s;
+ if (!strchr(__s, ';'))
+ {
+ size_t __len = strlen(__s) + 1;
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size; ++__i)
+ {
+ _M_names[__i] = new char[__len];
+ strcpy(_M_names[__i], __s);
+ }
+ }
+ else
+ {
+ char* __tmp = strdup(__s);
+ __tmp[strlen(__tmp)] = ';';
+ strtok(__tmp, "=;");
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size - 1; ++__i)
+ {
+ char* __src = strtok(NULL, "=;");
+ char* __new = new char[strlen(__src) + 1];
+ strcpy(__new, __src);
+ _M_names[__i] = __new;
+ strtok(NULL, "=;");
+ }
+ char* __src = strtok(NULL, "=;");
+ char* __new = new char[strlen(__src) + 1];
+ strcpy(__new, __src);
+ _M_names[_S_categories_size + _S_extra_categories_size - 1] = __new;
- // Construct all standard facets and add them to _M_facets.
- _M_init_facet(new std::ctype<char>(__cloc));
+ free(__tmp);
+ }
+
+ // Construct all standard facets and add them to _M_facets.
+ _M_init_facet(new std::ctype<char>(__cloc, 0, false));
_M_init_facet(new codecvt<char, char, mbstate_t>);
_M_init_facet(new numpunct<char>(__cloc));
_M_init_facet(new num_get<char>);
@@ -162,47 +210,61 @@ namespace std
// Construct "C" _Impl.
locale::_Impl::
- _Impl(facet** __f, size_t __refs, bool)
- : _M_references(__refs), _M_facets(__f), _M_facets_size(_GLIBCPP_NUM_FACETS)
+ _Impl(facet**, size_t __refs, bool)
+ : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS)
{
+ // Initialize the underlying locale model.
+ locale::facet::_S_create_c_locale(locale::facet::_S_c_locale, "C");
+
+ _M_facets = new(&facet_vec) facet*[_M_facets_size];
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ _M_facets[__i] = 0;
+
// Name all the categories.
- for (size_t i = 0; i < _S_num_categories; ++i)
- _M_names[i] = "C";
+ for (size_t __i = 0;
+ __i < _S_categories_size + _S_extra_categories_size; ++__i)
+ {
+ _M_names[__i] = new (&facet_name[__i]) char[2];
+ strcpy(_M_names[__i], "C");
+ }
// This is needed as presently the C++ version of "C" locales
// != data in the underlying locale model for __timepunct,
// numpunct, and moneypunct. Also, the "C" locales must be
// constructed in a way such that they are pre-allocated.
- _M_init_facet(new (&ctype_c) std::ctype<char>);
- _M_init_facet(new (&codecvt_c) codecvt<char, char, mbstate_t>);
- _M_init_facet(new (&numpunct_c) numpunct<char>);
- _M_init_facet(new (&num_get_c) num_get<char>);
- _M_init_facet(new (&num_put_c) num_put<char>);
- _M_init_facet(new (&collate_c) std::collate<char>);
- _M_init_facet(new (&moneypunct_fc) moneypunct<char, false>);
- _M_init_facet(new (&moneypunct_tc) moneypunct<char, true>);
- _M_init_facet(new (&money_get_c) money_get<char>);
- _M_init_facet(new (&money_put_c) money_put<char>);
- _M_init_facet(new (&timepunct_c) __timepunct<char>);
- _M_init_facet(new (&time_get_c) time_get<char>);
- _M_init_facet(new (&time_put_c) time_put<char>);
- _M_init_facet(new (&messages_c) std::messages<char>);
+ // NB: Set locale::facets(ref) count to one so that each individual
+ // facet is not destroyed when the locale (and thus locale::_Impl) is
+ // destroyed.
+ _M_init_facet(new (&ctype_c) std::ctype<char>(0, false, 1));
+ _M_init_facet(new (&codecvt_c) codecvt<char, char, mbstate_t>(1));
+ _M_init_facet(new (&numpunct_c) numpunct<char>(1));
+ _M_init_facet(new (&num_get_c) num_get<char>(1));
+ _M_init_facet(new (&num_put_c) num_put<char>(1));
+ _M_init_facet(new (&collate_c) std::collate<char>(1));
+ _M_init_facet(new (&moneypunct_fc) moneypunct<char, false>(1));
+ _M_init_facet(new (&moneypunct_tc) moneypunct<char, true>(1));
+ _M_init_facet(new (&money_get_c) money_get<char>(1));
+ _M_init_facet(new (&money_put_c) money_put<char>(1));
+ _M_init_facet(new (&timepunct_c) __timepunct<char>(1));
+ _M_init_facet(new (&time_get_c) time_get<char>(1));
+ _M_init_facet(new (&time_put_c) time_put<char>(1));
+ _M_init_facet(new (&messages_c) std::messages<char>(1));
#ifdef _GLIBCPP_USE_WCHAR_T
- _M_init_facet(new (&ctype_w) std::ctype<wchar_t>);
- _M_init_facet(new (&codecvt_w) codecvt<wchar_t, char, mbstate_t>);
- _M_init_facet(new (&numpunct_w) numpunct<wchar_t>);
- _M_init_facet(new (&num_get_w) num_get<wchar_t>);
- _M_init_facet(new (&num_put_w) num_put<wchar_t>);
- _M_init_facet(new (&collate_w) std::collate<wchar_t>);
- _M_init_facet(new (&moneypunct_fw) moneypunct<wchar_t, false>);
- _M_init_facet(new (&moneypunct_tw) moneypunct<wchar_t, true>);
- _M_init_facet(new (&money_get_w) money_get<wchar_t>);
- _M_init_facet(new (&money_put_w) money_put<wchar_t>);
- _M_init_facet(new (&timepunct_w) __timepunct<wchar_t>);
- _M_init_facet(new (&time_get_w) time_get<wchar_t>);
- _M_init_facet(new (&time_put_w) time_put<wchar_t>);
- _M_init_facet(new (&messages_w) std::messages<wchar_t>);
-#endif
+ _M_init_facet(new (&ctype_w) std::ctype<wchar_t>(1));
+ _M_init_facet(new (&codecvt_w) codecvt<wchar_t, char, mbstate_t>(1));
+ _M_init_facet(new (&numpunct_w) numpunct<wchar_t>(1));
+ _M_init_facet(new (&num_get_w) num_get<wchar_t>(1));
+ _M_init_facet(new (&num_put_w) num_put<wchar_t>(1));
+ _M_init_facet(new (&collate_w) std::collate<wchar_t>(1));
+ _M_init_facet(new (&moneypunct_fw) moneypunct<wchar_t, false>(1));
+ _M_init_facet(new (&moneypunct_tw) moneypunct<wchar_t, true>(1));
+ _M_init_facet(new (&money_get_w) money_get<wchar_t>(1));
+ _M_init_facet(new (&money_put_w) money_put<wchar_t>(1));
+ _M_init_facet(new (&timepunct_w) __timepunct<wchar_t>(1));
+ _M_init_facet(new (&time_get_w) time_get<wchar_t>(1));
+ _M_init_facet(new (&time_put_w) time_put<wchar_t>(1));
+ _M_init_facet(new (&messages_w) std::messages<wchar_t>(1));
+#endif
}
void
@@ -210,7 +272,7 @@ namespace std
_M_replace_categories(const _Impl* __imp, category __cat)
{
category __mask;
- for (unsigned int __ix = 0; __ix < _S_num_categories; ++__ix)
+ for (size_t __ix = 0; __ix < _S_categories_size; ++__ix)
{
__mask = 1 << __ix;
if (__mask & __cat)
@@ -220,7 +282,12 @@ namespace std
// If both have names, go ahead and mangle.
if (strcmp(_M_names[__ix], "*") != 0
&& strcmp(__imp->_M_names[__ix], "*") != 0)
- _M_names[__ix] = __imp->_M_names[__ix];
+ {
+ delete [] _M_names[__ix];
+ char* __new = new char[strlen(__imp->_M_names[__ix]) + 1];
+ strcpy(__new, __imp->_M_names[__ix]);
+ _M_names[__ix] = __new;
+ }
}
}
}
@@ -250,6 +317,8 @@ namespace std
if (__fp)
{
size_t __index = __idp->_M_id();
+
+ // Check size of facet vector to ensure adequate room.
if (__index > _M_facets_size - 1)
{
facet** __old = _M_facets;
@@ -266,11 +335,11 @@ namespace std
delete [] __old;
}
+ __fp->_M_add_reference();
facet*& __fpr = _M_facets[__index];
if (__fpr)
{
// Replacing an existing facet. Order matters.
- __fp->_M_add_reference();
__fpr->_M_remove_reference();
__fpr = __fp;
}
diff --git a/contrib/libstdc++/src/string-inst.cc b/contrib/libstdc++/src/string-inst.cc
index e812aa0..3fcaf51 100644
--- a/contrib/libstdc++/src/string-inst.cc
+++ b/contrib/libstdc++/src/string-inst.cc
@@ -22,7 +22,8 @@
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this// file does not by itself cause the resulting executable to be covered by
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
@@ -48,6 +49,7 @@ namespace std
template class basic_string<C>;
template S operator+(const C*, const S&);
template S operator+(C, const S&);
+ template S operator+(const S&, const S&);
} // namespace std
namespace __gnu_cxx
diff --git a/contrib/libstdc++/testsuite/Makefile.in b/contrib/libstdc++/testsuite/Makefile.in
index 7c85678..20f9ec9 100644
--- a/contrib/libstdc++/testsuite/Makefile.in
+++ b/contrib/libstdc++/testsuite/Makefile.in
@@ -1,67 +1,428 @@
-# Copyright (C) 1997 Free Software Foundation
-#
-# This file is part of the GNU IO Library. This library is free
-# software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA. */
-
-srcdir = libstdc++.tests
-
-EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
- echo $${rootme}/../../expect/expect ; \
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AWK = @AWK@
+BASIC_FILE_H = @BASIC_FILE_H@
+CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CCODECVT_H = @CCODECVT_H@
+CLOCALE_H = @CLOCALE_H@
+CMESSAGES_H = @CMESSAGES_H@
+CPP = @CPP@
+CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
+CSTDIO_H = @CSTDIO_H@
+CXXCPP = @CXXCPP@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
+DEBUG_FLAGS = @DEBUG_FLAGS@
+DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
+LIBIO_INCLUDES = @LIBIO_INCLUDES@
+LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
+LIBTOOL = @LIBTOOL@
+LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
+OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+SECTION_FLAGS = @SECTION_FLAGS@
+SECTION_LDFLAGS = @SECTION_LDFLAGS@
+STRIP = @STRIP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_FLAGS = @WARN_FLAGS@
+WERROR = @WERROR@
+baseline_file = @baseline_file@
+check_msgfmt = @check_msgfmt@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
+glibcpp_MOFILES = @glibcpp_MOFILES@
+glibcpp_POFILES = @glibcpp_POFILES@
+glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_localedir = @glibcpp_localedir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
+glibcpp_toolexecdir = @glibcpp_toolexecdir@
+glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
+gxx_include_dir = @gxx_include_dir@
+ifGNUmake = @ifGNUmake@
+libio_la = @libio_la@
+libtool_VERSION = @libtool_VERSION@
+toplevel_srcdir = @toplevel_srcdir@
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
+
+DEJATOOL = libstdc++-v3
+
+EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
+ echo @glibcpp_builddir@/../../expect/expect ; \
else echo expect ; fi`
-RUNTEST = `if [ -f $${srcdir}/../../dejagnu/runtest ] ; then \
- echo $${srcdir}/../../dejagnu/runtest ; \
+
+RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
+ echo @glibcpp_srcdir@/../dejagnu/runtest ; \
else echo runtest; fi`
-RUNTESTFLAGS =
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-.PHONY: all
-all:
-
-.PHONY: check
-check: all just-check
-
-site.exp: ./config.status Makefile
- @echo "Making a new config file..."
- -@rm -f ./tmp?
- @touch site.exp
- -@mv site.exp site.bak
- @echo "## these variables are automatically generated by make ##" > ./tmp0
- @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
- @echo "# add them to the last section" >> ./tmp0
- @echo "set host_alias $(host_alias)" >> ./tmp0
- @echo "set host_triplet ${host_canonical}" >> ./tmp0
- @echo "set target_alias $(target_alias)" >> ./tmp0
- @echo "set target_triplet ${target_canonical}" >> ./tmp0
- @echo "set build_triplet ${build_canonical}" >> ./tmp0
- @echo "set srcdir ${srcdir}" >> ./tmp0
- @echo "set tool libstdc++" >> ./tmp0
- @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
- @cat ./tmp0 > site.exp
- @cat site.bak | sed \
- -e '1,/^## All variables above are.*##/ d' >> site.exp
- -@rm -f ./tmp?
-
-just-check: site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=${srcdir} ; export srcdir ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) $(RUNTESTFLAGS)
+
+
+RUNTESTFLAGS =
+
+CXX_fake = @glibcpp_CXX@
+CXX = `echo $(CXX_fake) | sed 's/xgcc/g++/g'`
+CXXLINK = \
+ LD_RUN_PATH=${LD_RUN_PATH:+$LD_RUN_PATH:}${glibcpp_builddir}/src/.libs\
+ $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+
+
+INCLUDES = \
+ -nostdinc++ \
+ @GLIBCPP_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@
+
+@GLIBCPP_BUILD_ABI_CHECK_TRUE@noinst_PROGRAMS = @GLIBCPP_BUILD_ABI_CHECK_TRUE@abi_check
+@GLIBCPP_BUILD_ABI_CHECK_FALSE@noinst_PROGRAMS =
+abi_check_SOURCES = abi_check.cc
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+@GLIBCPP_BUILD_ABI_CHECK_FALSE@noinst_PROGRAMS =
+PROGRAMS = $(noinst_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+abi_check_OBJECTS = abi_check.$(OBJEXT)
+abi_check_LDADD = $(LDADD)
+abi_check_DEPENDENCIES =
+abi_check_LDFLAGS =
+CXXFLAGS = @CXXFLAGS@
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+DIST_COMMON = README Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+SOURCES = $(abi_check_SOURCES)
+OBJECTS = $(abi_check_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cc .lo .o .obj .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus testsuite/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-noinstPROGRAMS:
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+distclean-noinstPROGRAMS:
+
+maintainer-clean-noinstPROGRAMS:
+
+.c.o:
+ $(COMPILE) -c $<
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+ -rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+abi_check$(EXEEXT): $(abi_check_OBJECTS) $(abi_check_DEPENDENCIES)
+ @rm -f abi_check$(EXEEXT)
+ $(CXXLINK) $(abi_check_LDFLAGS) $(abi_check_OBJECTS) $(abi_check_LDADD) $(LIBS)
+.cc.o:
+ $(CXXCOMPILE) -c $<
+.cc.obj:
+ $(CXXCOMPILE) -c `cygpath -w $<`
+.cc.lo:
+ $(LTCXXCOMPILE) -c $<
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = testsuite
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+
+check-DEJAGNU: site.exp
+ srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ @test ! -f site.bak || rm -f site.bak
+ @echo '## these variables are automatically generated by make ##' > $@-t
+ @echo '# Do not edit here. If you wish to override these values' >> $@-t
+ @echo '# edit the last section' >> $@-t
+ @echo 'set tool $(DEJATOOL)' >> $@-t
+ @echo 'set srcdir $(srcdir)' >> $@-t
+ @echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
+ @echo 'set target_alias $(target_alias)' >> $@-t
+ @echo 'set target_triplet $(target_triplet)' >> $@-t
+ @echo 'set build_alias $(build_alias)' >> $@-t
+ @echo 'set build_triplet $(build_triplet)' >> $@-t
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
+ @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
+ @test ! -f site.exp || mv site.exp site.bak
+ @mv $@-t site.exp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am:
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-info-am:
+install-info: install-info-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-tags \
+ mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \
+ clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-noinstPROGRAMS distclean-compile \
+ distclean-libtool distclean-tags distclean-generic \
+ clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-info-am install-info install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/libstdc++/testsuite/config/default.exp b/contrib/libstdc++/testsuite/config/default.exp
index 90967cc..dbe227b 100644
--- a/contrib/libstdc++/testsuite/config/default.exp
+++ b/contrib/libstdc++/testsuite/config/default.exp
@@ -1 +1,21 @@
+# Copyright (C) 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# libstdc++@gcc.gnu.org
+
load_lib "standard.exp"
+
OpenPOWER on IntegriCloud