diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-07 16:31:42 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-07 16:31:42 +0000 |
commit | d8d674a19a9f3d2f17427e7a7b5217e2c15880cf (patch) | |
tree | 4342fb258227c31c859682720d4d979a6df73063 /libstdc++-v3/src | |
parent | 964944fc854c1dd723f7b8150d0deac634aabdbb (diff) |
This commit was manufactured by cvs2svn to create taghammer-3_3-merge-20030407
'hammer-3_3-merge-20030407'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/hammer-3_3-merge-20030407@65335 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/Makefile.am | 100 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.in | 117 | ||||
-rw-r--r-- | libstdc++-v3/src/codecvt.cc | 40 | ||||
-rw-r--r-- | libstdc++-v3/src/concept-inst.cc | 3 | ||||
-rw-r--r-- | libstdc++-v3/src/fstream.cc | 22 | ||||
-rw-r--r-- | libstdc++-v3/src/globals.cc | 8 | ||||
-rw-r--r-- | libstdc++-v3/src/ios.cc | 18 | ||||
-rw-r--r-- | libstdc++-v3/src/locale-inst.cc | 126 | ||||
-rw-r--r-- | libstdc++-v3/src/locale.cc | 32 | ||||
-rw-r--r-- | libstdc++-v3/src/localename.cc | 13 | ||||
-rw-r--r-- | libstdc++-v3/src/misc-inst.cc | 18 | ||||
-rw-r--r-- | libstdc++-v3/src/strstream.cc | 4 |
12 files changed, 384 insertions, 117 deletions
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 4592168f48d..304c035defc 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -1,6 +1,6 @@ ## Makefile for the src subdirectory of the GNU C++ Standard library. ## -## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 ## Free Software Foundation, Inc. ## ## This file is part of the libstdc++ version 3 distribution. @@ -29,19 +29,30 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs # Cross compiler support. CXX = @glibcpp_CXX@ +glibcpp_srcdir=@glibcpp_srcdir@ +glibcpp_builddir=@glibcpp_builddir@ toolexecdir = @glibcpp_toolexecdir@ toolexeclibdir = @glibcpp_toolexeclibdir@ toolexeclib_LTLIBRARIES = libstdc++.la +# Symbol versioning for shared libraries. +if GLIBCPP_BUILD_VERSIONED_SHLIB +version_arg = -Wl,--version-script=libstdc++-symbol.ver +libstdc++-symbol.ver: ${glibcpp_srcdir}/@SYMVER_MAP@ + @LN_S@ ${glibcpp_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver || true +else +version_arg = +libstdc++-symbol.ver: +endif + # Compile flags that should be constant throughout the build, both for # SUBDIRS and for libstdc++-v3 in general. OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS -# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. CONFIG_CXXFLAGS = \ - @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @DEBUG_FLAGS@ + @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@ # Warning flags to use. WARN_CXXFLAGS = \ @@ -60,7 +71,8 @@ INCLUDES = \ $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \ $(TOPLEVEL_INCLUDES) -# Source files linked in via configuration magic for a particular target. +# Source files linked in via configuration/make substitution for a +# particular target. target_sources = \ codecvt_members.cc \ collate_members.cc \ @@ -70,12 +82,39 @@ target_sources = \ numeric_members.cc \ time_members.cc -# Source files linked in via configuration magic for a particular -# target, but with ad hoc naming rules. +codecvt_members.cc: ${glibcpp_srcdir}/@CCODECVT_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCODECVT_CC@ . || true + +collate_members.cc: ${glibcpp_srcdir}/@CCOLLATE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCOLLATE_CC@ . || true + +ctype_members.cc: ${glibcpp_srcdir}/@CCTYPE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCTYPE_CC@ . || true + +messages_members.cc: ${glibcpp_srcdir}/@CMESSAGES_CC@ + @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_CC@ . || true + +monetary_members.cc: ${glibcpp_srcdir}/@CMONEY_CC@ + @LN_S@ ${glibcpp_srcdir}/@CMONEY_CC@ . || true + +numeric_members.cc: ${glibcpp_srcdir}/@CNUMERIC_CC@ + @LN_S@ ${glibcpp_srcdir}/@CNUMERIC_CC@ . || true + +time_members.cc: ${glibcpp_srcdir}/@CTIME_CC@ + @LN_S@ ${glibcpp_srcdir}/@CTIME_CC@ . || true + +# Source files linked in via configuration/make substitution for a +# particular target, but with ad hoc naming rules. target_sources_extra = \ basic_file.cc \ c++locale.cc +c++locale.cc: ${glibcpp_srcdir}/@CLOCALE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CLOCALE_CC@ ./$@ || true + +basic_file.cc: ${glibcpp_srcdir}/@BASIC_FILE_CC@ + @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_CC@ ./$@ || true + # Sources present in the src directory. sources = \ bitset.cc \ @@ -114,20 +153,15 @@ VPATH = $(top_srcdir)/src:$(top_srcdir) libstdc___la_SOURCES = $(sources) libstdc___la_LIBADD = \ - ../libmath/libmath.la @libio_la@ \ - ../libsupc++/libsupc++convenience.la + $(top_builddir)/libmath/libmath.la @libio_la@ \ + $(top_builddir)/libsupc++/libsupc++convenience.la -if GLIBCPP_BUILD_VERSIONED_SHLIB -version_arg=-Wl,--version-script=linker.map -else -version_arg= -endif +libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD) libstdc___la_LDFLAGS = \ -version-info @libtool_VERSION@ ${version_arg} \ -lm @LIBUNWIND_FLAG@ -libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) linker.map # Use special rules for the deprecated source files so that they find # deprecated include files. @@ -150,13 +184,13 @@ concept-inst.o: concept-inst.cc # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden -# as the occasion call for it. (ie, --enable-debug) +# as the occasion call for it. AM_CXXFLAGS = \ -fno-implicit-templates \ $(LIBSUPCXX_CXXFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) # libstdc++ libtool notes @@ -188,3 +222,37 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ # compilation driver. CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ + + +# Added bits to build debug library. +if GLIBCPP_BUILD_DEBUG +all-local: build_debug +install-data-local: install_debug +else +all-local: +install-data-local: +endif + +debugdir = debug + +# Build parallel set of debug objects here. +stamp-debug: + if test ! -d ${debugdir}; then \ + mkdir -p ${debugdir}; \ + (cd ${debugdir}; \ + sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \ + -e 's/srcdir = \.\./srcdir = ..\/../' \ + -e 's/glibcpp_basedir = \.\./glibcpp_basedir = ..\/../' \ + -e 's/all-local: build_debug/all-local:/' \ + -e 's/install-data-local: install_debug/install-data-local:/' \ + < ../Makefile > Makefile) ; \ + fi; \ + echo `date` > stamp-debug; + +build_debug: stamp-debug + (cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all) + +# Install debug library here. +install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=@glibcpp_toolexeclibdir@/debug install) diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 0974449aaa1..95c1cf881e2 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -66,14 +66,25 @@ AR = @AR@ AS = @AS@ ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@ AWK = @AWK@ +BASIC_FILE_CC = @BASIC_FILE_CC@ BASIC_FILE_H = @BASIC_FILE_H@ CC = @CC@ CCODECVT_C = @CCODECVT_C@ +CCODECVT_CC = @CCODECVT_CC@ CCODECVT_H = @CCODECVT_H@ +CCOLLATE_CC = @CCOLLATE_CC@ +CCTYPE_CC = @CCTYPE_CC@ +CLOCALE_CC = @CLOCALE_CC@ CLOCALE_H = @CLOCALE_H@ +CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@ +CMESSAGES_CC = @CMESSAGES_CC@ CMESSAGES_H = @CMESSAGES_H@ +CMONEY_CC = @CMONEY_CC@ +CNUMERIC_CC = @CNUMERIC_CC@ CPP = @CPP@ CSTDIO_H = @CSTDIO_H@ +CTIME_CC = @CTIME_CC@ +CTIME_H = @CTIME_H@ CXXCPP = @CXXCPP@ C_INCLUDE_DIR = @C_INCLUDE_DIR@ DEBUG_FLAGS = @DEBUG_FLAGS@ @@ -99,6 +110,7 @@ RANLIB = @RANLIB@ SECTION_FLAGS = @SECTION_FLAGS@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ STRIP = @STRIP@ +SYMVER_MAP = @SYMVER_MAP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_FLAGS = @WARN_FLAGS@ @@ -111,10 +123,8 @@ 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@ @@ -131,9 +141,13 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs # Cross compiler support. CXX = @glibcpp_CXX@ +glibcpp_srcdir = @glibcpp_srcdir@ +glibcpp_builddir = @glibcpp_builddir@ toolexecdir = @glibcpp_toolexecdir@ toolexeclibdir = @glibcpp_toolexeclibdir@ toolexeclib_LTLIBRARIES = libstdc++.la +@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_arg = @GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@-Wl,--version-script=libstdc++-symbol.ver +@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@version_arg = # Compile flags that should be constant throughout the build, both for # SUBDIRS and for libstdc++-v3 in general. @@ -141,9 +155,8 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS -# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. CONFIG_CXXFLAGS = \ - @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @DEBUG_FLAGS@ + @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@ # Warning flags to use. @@ -165,7 +178,8 @@ INCLUDES = \ $(TOPLEVEL_INCLUDES) -# Source files linked in via configuration magic for a particular target. +# Source files linked in via configuration/make substitution for a +# particular target. target_sources = \ codecvt_members.cc \ collate_members.cc \ @@ -176,8 +190,8 @@ target_sources = \ time_members.cc -# Source files linked in via configuration magic for a particular -# target, but with ad hoc naming rules. +# Source files linked in via configuration/make substitution for a +# particular target, but with ad hoc naming rules. target_sources_extra = \ basic_file.cc \ c++locale.cc @@ -222,19 +236,17 @@ VPATH = $(top_srcdir)/src:$(top_srcdir) libstdc___la_SOURCES = $(sources) libstdc___la_LIBADD = \ - ../libmath/libmath.la @libio_la@ \ - ../libsupc++/libsupc++convenience.la + $(top_builddir)/libmath/libmath.la @libio_la@ \ + $(top_builddir)/libsupc++/libsupc++convenience.la -@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_arg = @GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@-Wl,--version-script=linker.map -@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@version_arg = + +libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD) libstdc___la_LDFLAGS = \ -version-info @libtool_VERSION@ ${version_arg} \ -lm @LIBUNWIND_FLAG@ -libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) linker.map - # Use special rules for the deprecated source files so that they find # deprecated include files. GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include @@ -243,13 +255,13 @@ GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden -# as the occasion call for it. (ie, --enable-debug) +# as the occasion call for it. AM_CXXFLAGS = \ -fno-implicit-templates \ $(LIBSUPCXX_CXXFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) # libstdc++ libtool notes @@ -283,6 +295,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ + +debugdir = debug CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(toolexeclib_LTLIBRARIES) @@ -460,7 +474,7 @@ install-info: install-info-am install-exec-am: install-toolexeclibLTLIBRARIES install-exec: install-exec-am -install-data-am: +install-data-am: install-data-local install-data: install-data-am install-am: all-am @@ -468,7 +482,7 @@ install-am: all-am install: install-am uninstall-am: uninstall-toolexeclibLTLIBRARIES uninstall: uninstall-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) all-local all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install @@ -521,11 +535,42 @@ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir 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 +install-info install-exec-am install-exec install-data-local \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-local all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + +@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver: ${glibcpp_srcdir}/@SYMVER_MAP@ +@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@ @LN_S@ ${glibcpp_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver || true +@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@libstdc++-symbol.ver: +codecvt_members.cc: ${glibcpp_srcdir}/@CCODECVT_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCODECVT_CC@ . || true + +collate_members.cc: ${glibcpp_srcdir}/@CCOLLATE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCOLLATE_CC@ . || true + +ctype_members.cc: ${glibcpp_srcdir}/@CCTYPE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CCTYPE_CC@ . || true + +messages_members.cc: ${glibcpp_srcdir}/@CMESSAGES_CC@ + @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_CC@ . || true + +monetary_members.cc: ${glibcpp_srcdir}/@CMONEY_CC@ + @LN_S@ ${glibcpp_srcdir}/@CMONEY_CC@ . || true + +numeric_members.cc: ${glibcpp_srcdir}/@CNUMERIC_CC@ + @LN_S@ ${glibcpp_srcdir}/@CNUMERIC_CC@ . || true + +time_members.cc: ${glibcpp_srcdir}/@CTIME_CC@ + @LN_S@ ${glibcpp_srcdir}/@CTIME_CC@ . || true + +c++locale.cc: ${glibcpp_srcdir}/@CLOCALE_CC@ + @LN_S@ ${glibcpp_srcdir}/@CLOCALE_CC@ ./$@ || true + +basic_file.cc: ${glibcpp_srcdir}/@BASIC_FILE_CC@ + @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_CC@ ./$@ || true strstream.lo: strstream.cc $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $< strstream.o: strstream.cc @@ -539,6 +584,34 @@ concept-inst.lo: concept-inst.cc concept-inst.o: concept-inst.cc $(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $< +# Added bits to build debug library. +@GLIBCPP_BUILD_DEBUG_TRUE@all-local: build_debug +@GLIBCPP_BUILD_DEBUG_TRUE@install-data-local: install_debug +@GLIBCPP_BUILD_DEBUG_FALSE@all-local: +@GLIBCPP_BUILD_DEBUG_FALSE@install-data-local: + +# Build parallel set of debug objects here. +stamp-debug: + if test ! -d ${debugdir}; then \ + mkdir -p ${debugdir}; \ + (cd ${debugdir}; \ + sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \ + -e 's/srcdir = \.\./srcdir = ..\/../' \ + -e 's/glibcpp_basedir = \.\./glibcpp_basedir = ..\/../' \ + -e 's/all-local: build_debug/all-local:/' \ + -e 's/install-data-local: install_debug/install-data-local:/' \ + < ../Makefile > Makefile) ; \ + fi; \ + echo `date` > stamp-debug; + +build_debug: stamp-debug + (cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all) + +# Install debug library here. +install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=@glibcpp_toolexeclibdir@/debug install) + # 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/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc index b9575cf70bc..bc5508a4f40 100644 --- a/libstdc++-v3/src/codecvt.cc +++ b/libstdc++-v3/src/codecvt.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2000, 2002 Free Software Foundation, Inc. +// Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -46,26 +46,22 @@ namespace std codecvt<char, char, mbstate_t>:: codecvt(size_t __refs) : __codecvt_abstract_base<char, char, mbstate_t>(__refs) - { _M_c_locale_codecvt = _S_c_locale; } - - codecvt<char, char, mbstate_t>:: - codecvt(__c_locale __cloc, size_t __refs) - : __codecvt_abstract_base<char, char, mbstate_t>(__refs) - { _M_c_locale_codecvt = _S_clone_c_locale(__cloc); } + { } codecvt<char, char, mbstate_t>:: ~codecvt() - { _S_destroy_c_locale(_M_c_locale_codecvt); } + { } codecvt_base::result codecvt<char, char, mbstate_t>:: do_out(state_type&, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, + const intern_type*, const intern_type*& __from_next, + extern_type* __to, extern_type*, extern_type*& __to_next) const { - size_t __len = min(__from_end - __from, __to_end - __to); - memcpy(__to, __from, __len); + // _GLIBCPP_RESOLVE_LIB_DEFECTS + // According to the resolution of DR19, "If returns noconv [...] + // there are no changes to the values in [to, to_limit)." __from_next = __from; __to_next = __to; return noconv; @@ -83,12 +79,13 @@ namespace std codecvt_base::result codecvt<char, char, mbstate_t>:: do_in(state_type&, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, + const extern_type*, const extern_type*& __from_next, + intern_type* __to, intern_type*, intern_type*& __to_next) const - { - size_t __len = min(__from_end - __from, __to_end - __to); - memcpy(__to, __from, __len); + { + // _GLIBCPP_RESOLVE_LIB_DEFECTS + // According to the resolution of DR19, "If returns noconv [...] + // there are no changes to the values in [to, to_limit)." __from_next = __from; __to_next = __to; return noconv; @@ -120,16 +117,11 @@ namespace std codecvt<wchar_t, char, mbstate_t>:: codecvt(size_t __refs) : __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs) - { _M_c_locale_codecvt = _S_c_locale; } - - codecvt<wchar_t, char, mbstate_t>:: - codecvt(__c_locale __cloc, size_t __refs) - : __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs) - { _M_c_locale_codecvt = _S_clone_c_locale(__cloc); } + { } codecvt<wchar_t, char, mbstate_t>:: ~codecvt() - { _S_destroy_c_locale(_M_c_locale_codecvt); } + { } codecvt_base::result codecvt<wchar_t, char, mbstate_t>:: diff --git a/libstdc++-v3/src/concept-inst.cc b/libstdc++-v3/src/concept-inst.cc index d0129e5f940..e173549105d 100644 --- a/libstdc++-v3/src/concept-inst.cc +++ b/libstdc++-v3/src/concept-inst.cc @@ -1,6 +1,6 @@ // Concept checking instantiations -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation +// Copyright (C) 2001, 2002, 2003 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -39,6 +39,7 @@ #ifdef _GLIBCPP_CONCEPT_CHECKS #include <memory> +#include <iterator> #include <ostream> #define _Instantiate(...) template void __function_requires< __VA_ARGS__ > () diff --git a/libstdc++-v3/src/fstream.cc b/libstdc++-v3/src/fstream.cc index be711339b72..544f6a4741f 100644 --- a/libstdc++-v3/src/fstream.cc +++ b/libstdc++-v3/src/fstream.cc @@ -1,6 +1,6 @@ // File based streams -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -50,10 +50,14 @@ namespace std // normal buffers and jet outta here before expensive // fileops happen... if (_M_pback_init) + _M_pback_destroy(); + + if (_M_in_cur && _M_in_cur < _M_in_end) { - _M_pback_destroy(); - if (_M_in_cur < _M_in_end) - return traits_type::to_int_type(*_M_in_cur); + __ret = traits_type::to_int_type(*_M_in_cur); + if (__bump) + _M_in_cur_move(1); + return __ret; } // Sync internal and external buffers. @@ -115,10 +119,14 @@ namespace std // normal buffers and jet outta here before expensive // fileops happen... if (_M_pback_init) + _M_pback_destroy(); + + if (_M_in_cur && _M_in_cur < _M_in_end) { - _M_pback_destroy(); - if (_M_in_cur < _M_in_end) - return traits_type::to_int_type(*_M_in_cur); + __ret = traits_type::to_int_type(*_M_in_cur); + if (__bump) + _M_in_cur_move(1); + return __ret; } // Sync internal and external buffers. diff --git a/libstdc++-v3/src/globals.cc b/libstdc++-v3/src/globals.cc index d85bf3a6369..e3b012235bf 100644 --- a/libstdc++-v3/src/globals.cc +++ b/libstdc++-v3/src/globals.cc @@ -266,6 +266,14 @@ namespace __gnu_cxx _GLIBCPP_mutex_address_init () { __GTHREAD_MUTEX_INIT_FUNCTION (_GLIBCPP_mutex_address); } #endif + + // GLIBCXX_ABI. + struct __compat + { + static const char _S_atoms[]; + }; + const char __compat::_S_atoms[] = "0123456789eEabcdfABCDF"; + _GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8__compat8_S_atomsE, _ZNSt10__num_base8_S_atomsE, GLIBCPP_3.2) } // namespace __gnu_cxx namespace std diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 9f4c71841b4..c6cff753472 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -159,11 +159,12 @@ namespace std void ios_base::Init::_S_ios_create(bool __sync) { - int __out_size = __sync ? 0 : static_cast<int>(BUFSIZ); + size_t __out_size = __sync ? 0 : static_cast<size_t>(BUFSIZ); #ifdef _GLIBCPP_HAVE_ISATTY - int __in_size = (__sync || isatty (0)) ? 1 : static_cast<int>(BUFSIZ); + size_t __in_size = + (__sync || isatty (0)) ? 1 : static_cast<size_t>(BUFSIZ); #else - int __in_size = 1; + size_t __in_size = 1; #endif // NB: The file globals.cc creates the four standard files @@ -252,8 +253,6 @@ namespace std { words = new _Words[newsize]; } catch (...) { - delete [] _M_word; - _M_word = 0; _M_streambuf_state |= badbit; if (_M_streambuf_state & _M_exception) __throw_ios_failure("ios_base::_M_grow_words failure"); @@ -270,6 +269,8 @@ namespace std else { _M_streambuf_state |= badbit; + if (_M_streambuf_state & _M_exception) + __throw_ios_failure("ios_base::_M_grow_words failure"); return _M_word_zero; } } @@ -286,8 +287,6 @@ namespace std _M_precision = 6; _M_width = 0; _M_flags = skipws | dec; - _M_callbacks = 0; - _M_word_size = 0; _M_ios_locale = locale(); } @@ -301,7 +300,8 @@ namespace std return __old; } - ios_base::ios_base() : _M_callbacks(0), _M_word(0) + ios_base::ios_base() : _M_callbacks(0), _M_word_size(_S_local_word_size), + _M_word(_M_local_word) { // Do nothing: basic_ios::init() does it. // NB: _M_callbacks and _M_word must be zero for non-initialized @@ -313,7 +313,7 @@ namespace std { _M_call_callbacks(erase_event); _M_dispose_callbacks(); - if (_M_word && _M_word != _M_local_word) + if (_M_word != _M_local_word) { delete [] _M_word; _M_word = 0; diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 8f2c8638177..5da5c1449cc 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,7 +34,6 @@ #include <cstdlib> #include <clocale> #include <cstring> -#include <cassert> #include <locale> namespace std @@ -64,26 +63,26 @@ namespace std template ostreambuf_iterator<char> num_put<char, ostreambuf_iterator<char> >:: - _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, long) const; template ostreambuf_iterator<char> num_put<char, ostreambuf_iterator<char> >:: - _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, unsigned long) const; #ifdef _GLIBCPP_USE_LONG_LONG template ostreambuf_iterator<char> num_put<char, ostreambuf_iterator<char> >:: - _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, long long) const; template ostreambuf_iterator<char> num_put<char, ostreambuf_iterator<char> >:: - _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, unsigned long long) const; #endif @@ -97,8 +96,8 @@ namespace std ostreambuf_iterator<char> num_put<char, ostreambuf_iterator<char> >:: _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char, - long double) const; - + long double) const; + #ifdef _GLIBCPP_USE_WCHAR_T template class numpunct<wchar_t>; template class numpunct_byname<wchar_t>; @@ -108,27 +107,27 @@ namespace std template ostreambuf_iterator<wchar_t> num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: - _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, - char, long) const; + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, + long) const; template ostreambuf_iterator<wchar_t> num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: - _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, - char, unsigned long) const; + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, + unsigned long) const; #ifdef _GLIBCPP_USE_LONG_LONG template ostreambuf_iterator<wchar_t> num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: - _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, - char, long long) const; + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, + long long) const; template ostreambuf_iterator<wchar_t> num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: - _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, - char, unsigned long long) const; + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, + unsigned long long) const; #endif template @@ -144,6 +143,64 @@ namespace std long double) const; #endif +#if 1 + // XXX GLIBCXX_ABI Deprecated, compatibility only. + template + ostreambuf_iterator<char> + num_put<char, ostreambuf_iterator<char> >:: + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + long) const; + + template + ostreambuf_iterator<char> + num_put<char, ostreambuf_iterator<char> >:: + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + unsigned long) const; + +#ifdef _GLIBCPP_USE_LONG_LONG + template + ostreambuf_iterator<char> + num_put<char, ostreambuf_iterator<char> >:: + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + long long) const; + + template + ostreambuf_iterator<char> + num_put<char, ostreambuf_iterator<char> >:: + _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, char, char, + unsigned long long) const; +#endif + +#ifdef _GLIBCPP_USE_WCHAR_T + template + ostreambuf_iterator<wchar_t> + num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, + char, long) const; + + template + ostreambuf_iterator<wchar_t> + num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, + char, unsigned long) const; + +#ifdef _GLIBCPP_USE_LONG_LONG + template + ostreambuf_iterator<wchar_t> + num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, + char, long long) const; + + template + ostreambuf_iterator<wchar_t> + num_put<wchar_t, ostreambuf_iterator<wchar_t> >:: + _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, + char, unsigned long long) const; +#endif +#endif + +#endif + // time_get and time_put template class __timepunct<char>; template class time_put<char, ostreambuf_iterator<char> >; @@ -451,6 +508,7 @@ namespace std __convert_from_v(char*, const int, const char*, unsigned long, const __c_locale&, int); +#ifdef _GLIBCPP_USE_LONG_LONG template int __convert_from_v(char*, const int, const char*, long long, @@ -460,4 +518,40 @@ namespace std int __convert_from_v(char*, const int, const char*, unsigned long long, const __c_locale&, int); +#endif + + template + int + __int_to_char(char*, const int, unsigned long, const char*, + ios_base::fmtflags, bool); + +#ifdef _GLIBCPP_USE_WCHAR_T + template + int + __int_to_char(wchar_t*, const int, unsigned long, const wchar_t*, + ios_base::fmtflags, bool); +#endif + +#ifdef _GLIBCPP_USE_LONG_LONG + template + int + __int_to_char(char*, const int, unsigned long long, const char*, + ios_base::fmtflags, bool); + +#ifdef _GLIBCPP_USE_WCHAR_T + template + int + __int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*, + ios_base::fmtflags, bool); +#endif +#endif + + template<typename _CharT> + void + __locale_cache<_CharT>::_S_callback(ios_base::event __ev, ios_base& __io, int); + + template class __locale_cache<char>; +#ifdef _GLIBCPP_USE_WCHAR_T + template class __locale_cache<wchar_t>; +#endif } // namespace std diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index c5c6dd8a049..17ccdc2e4c6 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -1,4 +1,4 @@ -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -28,7 +28,6 @@ #include <clocale> #include <cstring> -#include <cassert> #include <cctype> #include <cwctype> // For towupper, etc. #include <locale> @@ -449,6 +448,8 @@ namespace std __c_locale locale::facet::_S_c_locale; + char locale::facet::_S_c_name[2]; + locale::facet:: ~facet() { } @@ -500,13 +501,16 @@ namespace std const money_base::pattern money_base::_S_default_pattern = { {symbol, sign, none, value} }; - const char __num_base::_S_atoms[] = "0123456789eEabcdfABCDF"; + const char* __num_base::_S_atoms_in = "0123456789eEabcdfABCDF"; + const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF"; - bool - __num_base::_S_format_float(const ios_base& __io, char* __fptr, char __mod, - streamsize __prec) + // _GLIBCPP_RESOLVE_LIB_DEFECTS + // According to the resolution of DR 231, about 22.2.2.2.2, p11, + // "str.precision() is specified in the conversion specification". + void + __num_base::_S_format_float(const ios_base& __io, char* __fptr, + char __mod, streamsize/* unused post DR 231 */) { - bool __incl_prec = false; ios_base::fmtflags __flags = __io.flags(); *__fptr++ = '%'; // [22.2.2.2.2] Table 60 @@ -514,13 +518,12 @@ namespace std *__fptr++ = '+'; if (__flags & ios_base::showpoint) *__fptr++ = '#'; - // As per [22.2.2.2.2.11] - if (__flags & ios_base::fixed || __prec > 0) - { - *__fptr++ = '.'; - *__fptr++ = '*'; - __incl_prec = true; - } + + // As per DR 231: _always_, not only when + // __flags & ios_base::fixed || __prec > 0 + *__fptr++ = '.'; + *__fptr++ = '*'; + if (__mod) *__fptr++ = __mod; ios_base::fmtflags __fltfield = __flags & ios_base::floatfield; @@ -532,7 +535,6 @@ namespace std else *__fptr++ = (__flags & ios_base::uppercase) ? 'G' : 'g'; *__fptr = '\0'; - return __incl_prec; } void diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc index 892a951ce0d..7f1a51917da 100644 --- a/libstdc++-v3/src/localename.cc +++ b/libstdc++-v3/src/localename.cc @@ -1,4 +1,4 @@ -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002m 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -170,7 +170,7 @@ namespace std // 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>(__cloc)); + _M_init_facet(new codecvt<char, char, mbstate_t>); _M_init_facet(new numpunct<char>(__cloc)); _M_init_facet(new num_get<char>); _M_init_facet(new num_put<char>); @@ -186,7 +186,7 @@ namespace std #ifdef _GLIBCPP_USE_WCHAR_T _M_init_facet(new std::ctype<wchar_t>(__cloc)); - _M_init_facet(new codecvt<wchar_t, char, mbstate_t>(__cloc)); + _M_init_facet(new codecvt<wchar_t, char, mbstate_t>); _M_init_facet(new numpunct<wchar_t>(__cloc)); _M_init_facet(new num_get<wchar_t>); _M_init_facet(new num_put<wchar_t>); @@ -209,7 +209,10 @@ namespace std : _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"); + locale::facet::_S_c_name[0] = 'C'; + locale::facet::_S_c_name[1] = '\0'; + locale::facet::_S_create_c_locale(locale::facet::_S_c_locale, + locale::facet::_S_c_name); _M_facets = new(&facet_vec) facet*[_M_facets_size]; for (size_t __i = 0; __i < _M_facets_size; ++__i) @@ -220,7 +223,7 @@ namespace std __i < _S_categories_size + _S_extra_categories_size; ++__i) { _M_names[__i] = new (&facet_name[__i]) char[2]; - strcpy(_M_names[__i], "C"); + strcpy(_M_names[__i], locale::facet::_S_c_name); } // This is needed as presently the C++ version of "C" locales diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc index 74224b1d983..61cb1b36449 100644 --- a/libstdc++-v3/src/misc-inst.cc +++ b/libstdc++-v3/src/misc-inst.cc @@ -87,3 +87,21 @@ namespace std string*, __false_type); #endif } // namespace std + +#ifdef _GLIBCPP_NEED_GENERIC_MUTEX +namespace __gnu_cxx +{ +#ifdef __GTHREAD_MUTEX_INIT + __gthread_mutex_t _Atomic_add_mutex = __GTHREAD_MUTEX_INIT; +#else + // generic atomicity.h without static initialization + __gthread_mutex_t _Atomic_add_mutex; + __gthread_once_t _Atomic_add_mutex_once = __GTHREAD_ONCE_INIT; + void __gthread_atomic_add_mutex_once() + { + __GTHREAD_MUTEX_INIT_FUNCTION (&_Atomic_add_mutex); + } +#endif +} // namespace __gnu_cxx +#endif // _GLIBCPP_NEED_GLOBAL_MUTEX + diff --git a/libstdc++-v3/src/strstream.cc b/libstdc++-v3/src/strstream.cc index 4d585659b9b..00f5b734b7b 100644 --- a/libstdc++-v3/src/strstream.cc +++ b/libstdc++-v3/src/strstream.cc @@ -1,6 +1,6 @@ // strstream definitions -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation +// Copyright (C) 2001, 2002, 2003 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -148,7 +148,7 @@ namespace std if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) { ptrdiff_t old_size = epptr() - pbase(); - ptrdiff_t new_size = max(2 * old_size, ptrdiff_t(1)); + ptrdiff_t new_size = max(ptrdiff_t(2 * old_size), ptrdiff_t(1)); char* buf = _M_alloc(new_size); if (buf) |