Commit 9a56333e by Benjamin Kosnik Committed by Benjamin Kosnik

re PR libstdc++/7230 (<strstream> header file is missing (trunk))


2002-07-24  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/7230
	* config/linker-map.gnu: Revert strstream patch from 2002-07-01.
	* include/Makefile.am (backward_headers): Use strstream, not
	strstream.h.
	* include/Makefile.in: Regenerate.
	* include/backward/strstream: Revert.
	* include/backward/strstream.h: Remove.
	* src/strstream.cc: Revert.
	* testsuite/backward/strstream_members.cc: Change include.

From-SVN: r55730
parent 8d1b7ba1
2002-07-24 Benjamin Kosnik <bkoz@redhat.com> 2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7230
* config/linker-map.gnu: Revert strstream patch from 2002-07-01.
* include/Makefile.am (backward_headers): Use strstream, not
strstream.h.
* include/Makefile.in: Regenerate.
* include/backward/strstream: Revert.
* include/backward/strstream.h: Remove.
* src/strstream.cc: Revert.
* testsuite/backward/strstream_members.cc: Change include.
2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7219 PR libstdc++/7219
* testsuite/27_io/ios_base_type.cc: New.
* include/bits/ios_base.h (ios_base::streampos): Add. * include/bits/ios_base.h (ios_base::streampos): Add.
(ios_base::streamoff): Add. (ios_base::streamoff): Add.
* testsuite/27_io/ios_base_type.cc: New.
2002-07-24 Benjamin Kosnik <bkoz@redhat.com> 2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7286 PR libstdc++/7286
......
dnl aclocal.m4 generated automatically by aclocal 1.4 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
...@@ -2201,12 +2201,37 @@ AC_MSG_RESULT($enable_symvers) ...@@ -2201,12 +2201,37 @@ AC_MSG_RESULT($enable_symvers)
]) ])
# isc-posix.m4 serial 1 (gettext-0.10.40)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
# This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package)
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
# give these diagnostics:
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])
AC_DEFUN([AC_ISC_POSIX],
[
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
]
)
# Add --enable-maintainer-mode option to configure. # Add --enable-maintainer-mode option to configure.
# From Jim Meyering # From Jim Meyering
# serial 1 # serial 1
AC_DEFUN(AM_MAINTAINER_MODE, AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode, AC_ARG_ENABLE(maintainer-mode,
...@@ -2223,7 +2248,7 @@ AC_DEFUN(AM_MAINTAINER_MODE, ...@@ -2223,7 +2248,7 @@ AC_DEFUN(AM_MAINTAINER_MODE,
# Define a conditional. # Define a conditional.
AC_DEFUN(AM_CONDITIONAL, AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE) [AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE) AC_SUBST($1_FALSE)
if $2; then if $2; then
...@@ -2243,7 +2268,7 @@ fi]) ...@@ -2243,7 +2268,7 @@ fi])
dnl Usage: dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define]) dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE, AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL]) [AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1] PACKAGE=[$1]
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)
...@@ -2271,7 +2296,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])]) ...@@ -2271,7 +2296,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane. # Check to make sure that the build environment is sane.
# #
AC_DEFUN(AM_SANITY_CHECK, AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane]) [AC_MSG_CHECKING([whether build environment is sane])
# Just in case # Just in case
sleep 1 sleep 1
...@@ -2312,7 +2337,7 @@ AC_MSG_RESULT(yes)]) ...@@ -2312,7 +2337,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version. dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG, AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2) [AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
...@@ -2328,7 +2353,7 @@ AC_SUBST($1)]) ...@@ -2328,7 +2353,7 @@ AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file. # Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER, AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12]) [AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1]) AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file. dnl When config.status generates a header, we must update the stamp-h file.
......
...@@ -38,11 +38,7 @@ GLIBCPP_3.1 { ...@@ -38,11 +38,7 @@ GLIBCPP_3.1 {
std::_S_bit_count; std::_S_bit_count;
std::_S_first_one; std::_S_first_one;
std::__default_alloc_template*; std::__default_alloc_template*;
std::__malloc_alloc_template*; std::__malloc_alloc_template*
strstreambuf::*;
istrstream::*;
ostrstream::*;
strstream::*
}; };
# Names not in an 'extern' block are mangled names. # Names not in an 'extern' block are mangled names.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -137,7 +137,7 @@ backward_headers = \ ...@@ -137,7 +137,7 @@ backward_headers = \
${backward_srcdir}/tree.h \ ${backward_srcdir}/tree.h \
${backward_srcdir}/vector.h \ ${backward_srcdir}/vector.h \
${backward_srcdir}/fstream.h \ ${backward_srcdir}/fstream.h \
${backward_srcdir}/strstream.h \ ${backward_srcdir}/strstream \
${backward_srcdir}/backward_warning.h ${backward_srcdir}/backward_warning.h
ext_srcdir = ${glibcpp_srcdir}/include/ext ext_srcdir = ${glibcpp_srcdir}/include/ext
......
...@@ -139,59 +139,307 @@ glibcpp_builddir = @glibcpp_builddir@ ...@@ -139,59 +139,307 @@ glibcpp_builddir = @glibcpp_builddir@
bits_srcdir = ${glibcpp_srcdir}/include/bits bits_srcdir = ${glibcpp_srcdir}/include/bits
bits_builddir = ./bits bits_builddir = ./bits
bits_headers = ${bits_srcdir}/basic_ios.h ${bits_srcdir}/basic_ios.tcc ${bits_srcdir}/basic_string.h ${bits_srcdir}/basic_string.tcc ${bits_srcdir}/boost_concept_check.h ${bits_srcdir}/char_traits.h ${bits_srcdir}/codecvt.h ${bits_srcdir}/concept_check.h ${bits_srcdir}/cpp_type_traits.h ${bits_srcdir}/deque.tcc ${bits_srcdir}/fpos.h ${bits_srcdir}/fstream.tcc ${bits_srcdir}/functexcept.h ${bits_srcdir}/generic_shadow.h ${bits_srcdir}/gslice.h ${bits_srcdir}/gslice_array.h ${bits_srcdir}/indirect_array.h ${bits_srcdir}/ios_base.h ${bits_srcdir}/istream.tcc ${bits_srcdir}/list.tcc ${bits_srcdir}/locale_facets.h ${bits_srcdir}/locale_facets.tcc ${bits_srcdir}/localefwd.h ${bits_srcdir}/mask_array.h ${bits_srcdir}/ostream.tcc ${bits_srcdir}/pthread_allocimpl.h ${bits_srcdir}/stream_iterator.h ${bits_srcdir}/streambuf_iterator.h ${bits_srcdir}/slice_array.h ${bits_srcdir}/sstream.tcc ${bits_srcdir}/stl_algo.h ${bits_srcdir}/stl_algobase.h ${bits_srcdir}/stl_alloc.h ${bits_srcdir}/stl_bvector.h ${bits_srcdir}/stl_construct.h ${bits_srcdir}/stl_deque.h ${bits_srcdir}/stl_function.h ${bits_srcdir}/stl_heap.h ${bits_srcdir}/stl_iterator.h ${bits_srcdir}/stl_iterator_base_funcs.h ${bits_srcdir}/stl_iterator_base_types.h ${bits_srcdir}/stl_list.h ${bits_srcdir}/stl_map.h ${bits_srcdir}/stl_multimap.h ${bits_srcdir}/stl_multiset.h ${bits_srcdir}/stl_numeric.h ${bits_srcdir}/stl_pair.h ${bits_srcdir}/stl_pthread_alloc.h ${bits_srcdir}/stl_queue.h ${bits_srcdir}/stl_raw_storage_iter.h ${bits_srcdir}/stl_relops.h ${bits_srcdir}/stl_set.h ${bits_srcdir}/stl_stack.h ${bits_srcdir}/stl_tempbuf.h ${bits_srcdir}/stl_threads.h ${bits_srcdir}/stl_tree.h ${bits_srcdir}/stl_uninitialized.h ${bits_srcdir}/stl_vector.h ${bits_srcdir}/streambuf.tcc ${bits_srcdir}/stringfwd.h ${bits_srcdir}/type_traits.h ${bits_srcdir}/valarray_array.h ${bits_srcdir}/valarray_array.tcc ${bits_srcdir}/valarray_meta.h ${bits_srcdir}/vector.tcc bits_headers = \
${bits_srcdir}/basic_ios.h \
${bits_srcdir}/basic_ios.tcc \
${bits_srcdir}/basic_string.h \
${bits_srcdir}/basic_string.tcc \
${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
${bits_srcdir}/cpp_type_traits.h \
${bits_srcdir}/deque.tcc \
${bits_srcdir}/fpos.h \
${bits_srcdir}/fstream.tcc \
${bits_srcdir}/functexcept.h \
${bits_srcdir}/generic_shadow.h \
${bits_srcdir}/gslice.h \
${bits_srcdir}/gslice_array.h \
${bits_srcdir}/indirect_array.h \
${bits_srcdir}/ios_base.h \
${bits_srcdir}/istream.tcc \
${bits_srcdir}/list.tcc \
${bits_srcdir}/locale_facets.h \
${bits_srcdir}/locale_facets.tcc \
${bits_srcdir}/localefwd.h \
${bits_srcdir}/mask_array.h \
${bits_srcdir}/ostream.tcc \
${bits_srcdir}/pthread_allocimpl.h \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/slice_array.h \
${bits_srcdir}/sstream.tcc \
${bits_srcdir}/stl_algo.h \
${bits_srcdir}/stl_algobase.h \
${bits_srcdir}/stl_alloc.h \
${bits_srcdir}/stl_bvector.h \
${bits_srcdir}/stl_construct.h \
${bits_srcdir}/stl_deque.h \
${bits_srcdir}/stl_function.h \
${bits_srcdir}/stl_heap.h \
${bits_srcdir}/stl_iterator.h \
${bits_srcdir}/stl_iterator_base_funcs.h \
${bits_srcdir}/stl_iterator_base_types.h \
${bits_srcdir}/stl_list.h \
${bits_srcdir}/stl_map.h \
${bits_srcdir}/stl_multimap.h \
${bits_srcdir}/stl_multiset.h \
${bits_srcdir}/stl_numeric.h \
${bits_srcdir}/stl_pair.h \
${bits_srcdir}/stl_pthread_alloc.h \
${bits_srcdir}/stl_queue.h \
${bits_srcdir}/stl_raw_storage_iter.h \
${bits_srcdir}/stl_relops.h \
${bits_srcdir}/stl_set.h \
${bits_srcdir}/stl_stack.h \
${bits_srcdir}/stl_tempbuf.h \
${bits_srcdir}/stl_threads.h \
${bits_srcdir}/stl_tree.h \
${bits_srcdir}/stl_uninitialized.h \
${bits_srcdir}/stl_vector.h \
${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \
${bits_srcdir}/type_traits.h \
${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_meta.h \
${bits_srcdir}/vector.tcc
backward_srcdir = ${glibcpp_srcdir}/include/backward backward_srcdir = ${glibcpp_srcdir}/include/backward
backward_builddir = ./backward backward_builddir = ./backward
backward_headers = ${backward_srcdir}/complex.h ${backward_srcdir}/iomanip.h ${backward_srcdir}/istream.h ${backward_srcdir}/ostream.h ${backward_srcdir}/stream.h ${backward_srcdir}/streambuf.h ${backward_srcdir}/algo.h ${backward_srcdir}/algobase.h ${backward_srcdir}/alloc.h ${backward_srcdir}/bvector.h ${backward_srcdir}/defalloc.h ${backward_srcdir}/deque.h ${backward_srcdir}/function.h ${backward_srcdir}/hash_map.h ${backward_srcdir}/hash_set.h ${backward_srcdir}/hashtable.h ${backward_srcdir}/heap.h ${backward_srcdir}/iostream.h ${backward_srcdir}/iterator.h ${backward_srcdir}/list.h ${backward_srcdir}/map.h ${backward_srcdir}/multimap.h ${backward_srcdir}/new.h ${backward_srcdir}/multiset.h ${backward_srcdir}/pair.h ${backward_srcdir}/queue.h ${backward_srcdir}/rope.h ${backward_srcdir}/set.h ${backward_srcdir}/slist.h ${backward_srcdir}/stack.h ${backward_srcdir}/tempbuf.h ${backward_srcdir}/tree.h ${backward_srcdir}/vector.h ${backward_srcdir}/fstream.h ${backward_srcdir}/strstream.h ${backward_srcdir}/backward_warning.h backward_headers = \
${backward_srcdir}/complex.h \
${backward_srcdir}/iomanip.h \
${backward_srcdir}/istream.h \
${backward_srcdir}/ostream.h \
${backward_srcdir}/stream.h \
${backward_srcdir}/streambuf.h \
${backward_srcdir}/algo.h \
${backward_srcdir}/algobase.h \
${backward_srcdir}/alloc.h \
${backward_srcdir}/bvector.h \
${backward_srcdir}/defalloc.h \
${backward_srcdir}/deque.h \
${backward_srcdir}/function.h \
${backward_srcdir}/hash_map.h \
${backward_srcdir}/hash_set.h \
${backward_srcdir}/hashtable.h \
${backward_srcdir}/heap.h \
${backward_srcdir}/iostream.h \
${backward_srcdir}/iterator.h \
${backward_srcdir}/list.h \
${backward_srcdir}/map.h \
${backward_srcdir}/multimap.h \
${backward_srcdir}/new.h \
${backward_srcdir}/multiset.h \
${backward_srcdir}/pair.h \
${backward_srcdir}/queue.h \
${backward_srcdir}/rope.h \
${backward_srcdir}/set.h \
${backward_srcdir}/slist.h \
${backward_srcdir}/stack.h \
${backward_srcdir}/tempbuf.h \
${backward_srcdir}/tree.h \
${backward_srcdir}/vector.h \
${backward_srcdir}/fstream.h \
${backward_srcdir}/strstream \
${backward_srcdir}/backward_warning.h
ext_srcdir = ${glibcpp_srcdir}/include/ext ext_srcdir = ${glibcpp_srcdir}/include/ext
ext_builddir = ./ext ext_builddir = ./ext
ext_headers = ${ext_srcdir}/algorithm ${ext_srcdir}/enc_filebuf.h ${ext_srcdir}/stdio_filebuf.h ${ext_srcdir}/functional ${ext_srcdir}/hash_map ${ext_srcdir}/hash_set ${ext_srcdir}/iterator ${ext_srcdir}/memory ${ext_srcdir}/numeric ${ext_srcdir}/rb_tree ${ext_srcdir}/rope ${ext_srcdir}/ropeimpl.h ${ext_srcdir}/slist ${ext_srcdir}/stl_hash_fun.h ${ext_srcdir}/stl_hashtable.h ${ext_srcdir}/stl_rope.h ext_headers = \
${ext_srcdir}/algorithm \
${ext_srcdir}/enc_filebuf.h \
${ext_srcdir}/stdio_filebuf.h \
${ext_srcdir}/functional \
${ext_srcdir}/hash_map \
${ext_srcdir}/hash_set \
${ext_srcdir}/iterator \
${ext_srcdir}/memory \
${ext_srcdir}/numeric \
${ext_srcdir}/rb_tree \
${ext_srcdir}/rope \
${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \
${ext_srcdir}/stl_hash_fun.h \
${ext_srcdir}/stl_hashtable.h \
${ext_srcdir}/stl_rope.h
# This is the common subset of files that all three "C" header models use. # This is the common subset of files that all three "C" header models use.
c_base_srcdir = @C_INCLUDE_DIR@ c_base_srcdir = @C_INCLUDE_DIR@
c_base_builddir = . c_base_builddir = .
c_base_headers = ${c_base_srcdir}/std_cassert.h ${c_base_srcdir}/std_cctype.h ${c_base_srcdir}/std_cerrno.h ${c_base_srcdir}/std_cfloat.h ${c_base_srcdir}/std_ciso646.h ${c_base_srcdir}/std_climits.h ${c_base_srcdir}/std_clocale.h ${c_base_srcdir}/std_cmath.h ${c_base_srcdir}/std_csetjmp.h ${c_base_srcdir}/std_csignal.h ${c_base_srcdir}/std_cstdarg.h ${c_base_srcdir}/std_cstddef.h ${c_base_srcdir}/std_cstdio.h ${c_base_srcdir}/std_cstdlib.h ${c_base_srcdir}/std_cstring.h ${c_base_srcdir}/std_ctime.h ${c_base_srcdir}/std_cwchar.h ${c_base_srcdir}/std_cwctype.h c_base_headers = \
${c_base_srcdir}/std_cassert.h \
c_base_headers_rename = cassert cctype cerrno cfloat ciso646 climits clocale cmath csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime cwchar cwctype ${c_base_srcdir}/std_cctype.h \
${c_base_srcdir}/std_cerrno.h \
${c_base_srcdir}/std_cfloat.h \
${c_base_srcdir}/std_ciso646.h \
${c_base_srcdir}/std_climits.h \
${c_base_srcdir}/std_clocale.h \
${c_base_srcdir}/std_cmath.h \
${c_base_srcdir}/std_csetjmp.h \
${c_base_srcdir}/std_csignal.h \
${c_base_srcdir}/std_cstdarg.h \
${c_base_srcdir}/std_cstddef.h \
${c_base_srcdir}/std_cstdio.h \
${c_base_srcdir}/std_cstdlib.h \
${c_base_srcdir}/std_cstring.h \
${c_base_srcdir}/std_ctime.h \
${c_base_srcdir}/std_cwchar.h \
${c_base_srcdir}/std_cwctype.h
c_base_headers_rename = \
cassert \
cctype \
cerrno \
cfloat \
ciso646 \
climits \
clocale \
cmath \
csetjmp \
csignal \
cstdarg \
cstddef \
cstdio \
cstdlib \
cstring \
ctime \
cwchar \
cwctype
# "C" compatibility headers. # "C" compatibility headers.
c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility
c_compatibility_builddir = . c_compatibility_builddir = .
c_compatibility_headers = ${c_compatibility_srcdir}/assert.h ${c_compatibility_srcdir}/ctype.h ${c_compatibility_srcdir}/errno.h ${c_compatibility_srcdir}/float.h ${c_compatibility_srcdir}/iso646.h ${c_compatibility_srcdir}/limits.h ${c_compatibility_srcdir}/locale.h ${c_compatibility_srcdir}/math.h ${c_compatibility_srcdir}/setjmp.h ${c_compatibility_srcdir}/signal.h ${c_compatibility_srcdir}/stdarg.h ${c_compatibility_srcdir}/stddef.h ${c_compatibility_srcdir}/stdio.h ${c_compatibility_srcdir}/stdlib.h ${c_compatibility_srcdir}/string.h ${c_compatibility_srcdir}/time.h ${c_compatibility_srcdir}/wchar.h ${c_compatibility_srcdir}/wctype.h c_compatibility_headers = \
${c_compatibility_srcdir}/assert.h \
@GLIBCPP_C_HEADERS_C_STD_TRUE@c_base_headers_extra = ${c_base_srcdir}/cmath.tcc ${c_compatibility_srcdir}/ctype.h \
${c_compatibility_srcdir}/errno.h \
${c_compatibility_srcdir}/float.h \
${c_compatibility_srcdir}/iso646.h \
${c_compatibility_srcdir}/limits.h \
${c_compatibility_srcdir}/locale.h \
${c_compatibility_srcdir}/math.h \
${c_compatibility_srcdir}/setjmp.h \
${c_compatibility_srcdir}/signal.h \
${c_compatibility_srcdir}/stdarg.h \
${c_compatibility_srcdir}/stddef.h \
${c_compatibility_srcdir}/stdio.h \
${c_compatibility_srcdir}/stdlib.h \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
${c_compatibility_srcdir}/wctype.h
@GLIBCPP_C_HEADERS_C_STD_TRUE@c_base_headers_extra = @GLIBCPP_C_HEADERS_C_STD_TRUE@${c_base_srcdir}/cmath.tcc
@GLIBCPP_C_HEADERS_C_STD_FALSE@c_base_headers_extra = @GLIBCPP_C_HEADERS_C_STD_FALSE@c_base_headers_extra =
@GLIBCPP_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers} @GLIBCPP_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = @GLIBCPP_C_HEADERS_COMPATIBILITY_TRUE@${c_compatibility_headers}
@GLIBCPP_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra = @GLIBCPP_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra =
std_srcdir = ${glibcpp_srcdir}/include/std std_srcdir = ${glibcpp_srcdir}/include/std
std_builddir = . std_builddir = .
std_headers = ${std_srcdir}/std_algorithm.h ${std_srcdir}/std_bitset.h ${std_srcdir}/std_complex.h ${std_srcdir}/std_deque.h ${std_srcdir}/std_fstream.h ${std_srcdir}/std_functional.h ${std_srcdir}/std_iomanip.h ${std_srcdir}/std_ios.h ${std_srcdir}/std_iosfwd.h ${std_srcdir}/std_iostream.h ${std_srcdir}/std_istream.h ${std_srcdir}/std_iterator.h ${std_srcdir}/std_limits.h ${std_srcdir}/std_list.h ${std_srcdir}/std_locale.h ${std_srcdir}/std_map.h ${std_srcdir}/std_memory.h ${std_srcdir}/std_numeric.h ${std_srcdir}/std_ostream.h ${std_srcdir}/std_queue.h ${std_srcdir}/std_set.h ${std_srcdir}/std_sstream.h ${std_srcdir}/std_stack.h ${std_srcdir}/std_stdexcept.h ${std_srcdir}/std_streambuf.h ${std_srcdir}/std_string.h ${std_srcdir}/std_utility.h ${std_srcdir}/std_valarray.h ${std_srcdir}/std_vector.h std_headers = \
${std_srcdir}/std_algorithm.h \
${std_srcdir}/std_bitset.h \
${std_srcdir}/std_complex.h \
${std_srcdir}/std_deque.h \
${std_srcdir}/std_fstream.h \
${std_srcdir}/std_functional.h \
${std_srcdir}/std_iomanip.h \
${std_srcdir}/std_ios.h \
${std_srcdir}/std_iosfwd.h \
${std_srcdir}/std_iostream.h \
${std_srcdir}/std_istream.h \
${std_srcdir}/std_iterator.h \
${std_srcdir}/std_limits.h \
${std_srcdir}/std_list.h \
${std_srcdir}/std_locale.h \
${std_srcdir}/std_map.h \
${std_srcdir}/std_memory.h \
${std_srcdir}/std_numeric.h \
${std_srcdir}/std_ostream.h \
${std_srcdir}/std_queue.h \
${std_srcdir}/std_set.h \
${std_srcdir}/std_sstream.h \
${std_srcdir}/std_stack.h \
${std_srcdir}/std_stdexcept.h \
${std_srcdir}/std_streambuf.h \
${std_srcdir}/std_string.h \
${std_srcdir}/std_utility.h \
${std_srcdir}/std_valarray.h \
${std_srcdir}/std_vector.h
# Renamed at build time. # Renamed at build time.
std_headers_rename = algorithm bitset complex deque fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory numeric ostream queue set sstream stack stdexcept streambuf string utility valarray vector std_headers_rename = \
algorithm \
bitset \
complex \
deque \
fstream \
functional \
iomanip \
ios \
iosfwd \
iostream \
istream \
iterator \
limits \
list \
locale \
map \
memory \
numeric \
ostream \
queue \
set \
sstream \
stack \
stdexcept \
streambuf \
string \
utility \
valarray \
vector
target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
target_builddir = ./${target_alias}/bits target_builddir = ./${target_alias}/bits
target_headers = ${target_srcdir}/ctype_base.h ${target_srcdir}/ctype_inline.h ${target_srcdir}/ctype_noninline.h ${target_srcdir}/os_defines.h ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h ${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h target_headers = \
${target_srcdir}/ctype_base.h \
${target_srcdir}/ctype_inline.h \
${target_srcdir}/ctype_noninline.h \
${target_srcdir}/os_defines.h \
${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h
# These target_headers_extra files are all built with ad hoc naming rules. # These target_headers_extra files are all built with ad hoc naming rules.
target_headers_extra = ${target_builddir}/basic_file.h ${target_builddir}/c++config.h ${target_builddir}/c++io.h ${target_builddir}/c++locale.h ${target_builddir}/messages_members.h ${target_builddir}/codecvt_specializations.h target_headers_extra = \
${target_builddir}/basic_file.h \
${target_builddir}/c++config.h \
${target_builddir}/c++io.h \
${target_builddir}/c++locale.h \
${target_builddir}/messages_members.h \
${target_builddir}/codecvt_specializations.h
thread_target_headers = ${target_builddir}/gthr.h ${target_builddir}/gthr-single.h ${target_builddir}/gthr-posix.h ${target_builddir}/gthr-default.h thread_target_headers = \
${target_builddir}/gthr.h \
${target_builddir}/gthr-single.h \
${target_builddir}/gthr-posix.h \
${target_builddir}/gthr-default.h
# List of all timestamp files. By keeping only one copy of this list, both # List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date. # CLEANFILES and all-local are kept up-to-date.
allstamps = stamp-std stamp-bits stamp-c_base stamp-c_compatibility stamp-backward stamp-ext ${target_builddir}/stamp-target allstamps = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
stamp-backward stamp-ext \
${target_builddir}/stamp-target
# Target includes for threads # Target includes for threads
...@@ -214,7 +462,7 @@ DIST_COMMON = Makefile.am Makefile.in ...@@ -214,7 +462,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = gtar
GZIP_ENV = --best GZIP_ENV = --best
all: all-redirect all: all-redirect
.SUFFIXES: .SUFFIXES:
......
// Backward-compat support -*- C++ -*- // Backward-compat support -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
// MAY BE REMOVED in a future standard revision. You should use the // MAY BE REMOVED in a future standard revision. You should use the
// header <sstream> instead. // header <sstream> instead.
#ifndef _CPP_BACKWARD_STRSTREAM_H #ifndef __SGI_STL_STRSTREAM
#define _CPP_BACKWARD_STRSTREAM_H 1 #define __SGI_STL_STRSTREAM
#include "backward_warning.h" #include "backward_warning.h"
#include <iosfwd> #include <iosfwd>
...@@ -55,120 +55,120 @@ ...@@ -55,120 +55,120 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
// Class strstreambuf, a streambuf class that manages an array of char. namespace std
// Note that this class is not a template.
class strstreambuf : public std::basic_streambuf<char>
{ {
public: // Class strstreambuf, a streambuf class that manages an array of char.
// Types. // Note that this class is not a template.
typedef std::char_traits<char> _Traits; class strstreambuf : public basic_streambuf<char, char_traits<char> >
typedef std::basic_streambuf<char, _Traits> _Base; {
public:
public: // Types.
// Constructor, destructor typedef char_traits<char> _Traits;
explicit strstreambuf(std::streamsize __initial_capacity = 0); typedef basic_streambuf<char, _Traits> _Base;
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
public:
strstreambuf(char* __get, std::streamsize __n, char* __put = 0); // Constructor, destructor
strstreambuf(signed char* __get, std::streamsize __n, explicit strstreambuf(streamsize __initial_capacity = 0);
signed char* __put = 0); strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
strstreambuf(unsigned char* __get, std::streamsize __n,
unsigned char* __put=0); strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(const char* __get, std::streamsize __n); strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
strstreambuf(const signed char* __get, std::streamsize __n);
strstreambuf(const unsigned char* __get, std::streamsize __n); strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
virtual ~strstreambuf(); strstreambuf(const unsigned char* __get, streamsize __n);
public: virtual ~strstreambuf();
void freeze(bool = true);
char* str(); public:
int pcount() const; void freeze(bool = true);
char* str();
protected: int pcount() const;
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof()); protected:
virtual int_type underflow(); virtual int_type overflow(int_type __c = _Traits::eof());
virtual _Base* setbuf(char* __buf, std::streamsize __n); virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual pos_type seekoff(off_type __off, std::ios_base::seekdir __dir, virtual int_type underflow();
std::ios_base::openmode __mode virtual _Base* setbuf(char* __buf, streamsize __n);
= std::ios_base::in | std::ios_base::out); virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
virtual pos_type seekpos(pos_type __pos, std::ios_base::openmode __mode ios_base::openmode __mode
= std::ios_base::in | std::ios_base::out); = ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
private: = ios_base::in | ios_base::out);
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t); private:
void _M_free(char*); // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
// Helper function used in constructors. void _M_free(char*);
void _M_setup(char* __get, char* __put, std::streamsize __n);
// Helper function used in constructors.
private: void _M_setup(char* __get, char* __put, streamsize __n);
// Data members.
void* (*_M_alloc_fun)(size_t); private:
void (*_M_free_fun)(void*); // Data members.
void* (*_M_alloc_fun)(size_t);
bool _M_dynamic : 1; void (*_M_free_fun)(void*);
bool _M_frozen : 1;
bool _M_constant : 1; bool _M_dynamic : 1;
}; bool _M_frozen : 1;
bool _M_constant : 1;
// Class istrstream, an istream that manages a strstreambuf. };
class istrstream : public std::basic_istream<char>
{ // Class istrstream, an istream that manages a strstreambuf.
public: class istrstream : public basic_istream<char>
explicit istrstream(char*); {
explicit istrstream(const char*); public:
istrstream(char* , std::streamsize); explicit istrstream(char*);
istrstream(const char*, std::streamsize); explicit istrstream(const char*);
virtual ~istrstream(); istrstream(char* , streamsize);
istrstream(const char*, streamsize);
strstreambuf* rdbuf() const; virtual ~istrstream();
char* str();
strstreambuf* rdbuf() const;
private: char* str();
strstreambuf _M_buf;
}; private:
strstreambuf _M_buf;
// Class ostrstream };
class ostrstream : public std::basic_ostream<char>
{ // Class ostrstream
public: class ostrstream : public basic_ostream<char>
ostrstream(); {
ostrstream(char*, int, std::ios_base::openmode = std::ios_base::out); public:
virtual ~ostrstream(); ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
strstreambuf* rdbuf() const; virtual ~ostrstream();
void freeze(bool = true);
char* str(); strstreambuf* rdbuf() const;
int pcount() const; void freeze(bool = true);
char* str();
private: int pcount() const;
strstreambuf _M_buf;
}; private:
strstreambuf _M_buf;
// Class strstream };
class strstream : public std::basic_iostream<char>
{ // Class strstream
public: class strstream : public basic_iostream<char>
typedef char char_type; {
typedef std::char_traits<char>::int_type int_type; public:
typedef std::char_traits<char>::pos_type pos_type; typedef char char_type;
typedef std::char_traits<char>::off_type off_type; typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
strstream(); typedef char_traits<char>::off_type off_type;
strstream(char*, int,
std::ios_base::openmode = std::ios_base::in | std::ios_base::out); strstream();
virtual ~strstream(); strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true); strstreambuf* rdbuf() const;
int pcount() const; void freeze(bool = true);
char* str(); int pcount() const;
char* str();
private:
strstreambuf _M_buf; private:
}; strstreambuf _M_buf;
};
} // namespace std
#endif #endif
...@@ -47,156 +47,156 @@ ...@@ -47,156 +47,156 @@
// MAY BE REMOVED in a future standard revision. You should use the // MAY BE REMOVED in a future standard revision. You should use the
// header <sstream> instead. // header <sstream> instead.
#include <strstream.h> #include <strstream>
#include <algorithm> #include <algorithm>
#include <new> #include <new>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
using namespace std; namespace std
strstreambuf::strstreambuf(streamsize initial_capacity)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true),
_M_frozen(false), _M_constant(false)
{ {
_M_buf_size = _M_buf_size_opt = max(initial_capacity, streamsize(16)); strstreambuf::strstreambuf(streamsize initial_capacity)
_M_buf = _M_alloc(_M_buf_size); : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true),
if (_M_buf) _M_frozen(false), _M_constant(false)
{ {
setp(_M_buf, _M_buf + _M_buf_size); _M_buf_size = _M_buf_size_opt = max(initial_capacity, streamsize(16));
setg(_M_buf, _M_buf, _M_buf); _M_buf = _M_alloc(_M_buf_size);
} if (_M_buf)
} {
setp(_M_buf, _M_buf + _M_buf_size);
strstreambuf::strstreambuf(void* (*alloc_f)(size_t), void (*free_f)(void*)) setg(_M_buf, _M_buf, _M_buf);
: _Base(), _M_alloc_fun(alloc_f), _M_free_fun(free_f), _M_dynamic(true), }
}
strstreambuf::strstreambuf(void* (*alloc_f)(size_t), void (*free_f)(void*))
: _Base(), _M_alloc_fun(alloc_f), _M_free_fun(free_f), _M_dynamic(true),
_M_frozen(false), _M_constant(false)
{
_M_buf_size = _M_buf_size_opt = 16;
_M_buf = _M_alloc(_M_buf_size);
if (_M_buf)
{
setp(_M_buf, _M_buf + _M_buf_size);
setg(_M_buf, _M_buf, _M_buf);
}
}
strstreambuf::strstreambuf(char* get, streamsize n, char* put)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false)
{ _M_setup(get, put, n); }
strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false) _M_frozen(false), _M_constant(false)
{ { _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); }
_M_buf_size = _M_buf_size_opt = 16;
_M_buf = _M_alloc(_M_buf_size); strstreambuf::strstreambuf(unsigned char* get, streamsize n,
if (_M_buf) unsigned char* put)
{ : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
setp(_M_buf, _M_buf + _M_buf_size); _M_frozen(false), _M_constant(false)
setg(_M_buf, _M_buf, _M_buf); { _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); }
}
} strstreambuf::strstreambuf(const char* get, streamsize n)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
strstreambuf::strstreambuf(char* get, streamsize n, char* put) _M_frozen(false), _M_constant(true)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), { _M_setup(const_cast<char*>(get), 0, n); }
_M_frozen(false), _M_constant(false)
{ _M_setup(get, put, n); } strstreambuf::strstreambuf(const signed char* get, streamsize n)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put) _M_frozen(false), _M_constant(true)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), { _M_setup(reinterpret_cast<char*>(const_cast<signed char*>(get)), 0, n); }
_M_frozen(false), _M_constant(false)
{ _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); } strstreambuf::strstreambuf(const unsigned char* get, streamsize n)
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
strstreambuf::strstreambuf(unsigned char* get, streamsize n, _M_frozen(false), _M_constant(true)
unsigned char* put) { _M_setup(reinterpret_cast<char*>(const_cast<unsigned char*>(get)), 0, n); }
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false),
_M_frozen(false), _M_constant(false) strstreambuf::~strstreambuf()
{ _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); } {
if (_M_dynamic && !_M_frozen)
strstreambuf::strstreambuf(const char* get, streamsize n) {
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), char* p = this->eback();
_M_frozen(false), _M_constant(true) _M_free(p);
{ _M_setup(const_cast<char*>(get), 0, n); } if (p == _M_buf)
_M_buf = 0;
strstreambuf::strstreambuf(const signed char* get, streamsize n) }
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), if (_M_buf)
_M_frozen(false), _M_constant(true) _M_free(_M_buf);
{ _M_setup(reinterpret_cast<char*>(const_cast<signed char*>(get)), 0, n); } }
strstreambuf::strstreambuf(const unsigned char* get, streamsize n) void
: _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), strstreambuf::freeze(bool frozenflag)
_M_frozen(false), _M_constant(true) {
{ _M_setup(reinterpret_cast<char*>(const_cast<unsigned char*>(get)), 0, n); } if (_M_dynamic)
_M_frozen = frozenflag;
strstreambuf::~strstreambuf() }
{
if (_M_dynamic && !_M_frozen) char*
{ strstreambuf::str()
char* p = this->eback(); {
_M_free(p); freeze(true);
if (p == _M_buf) return eback();
_M_buf = 0; }
}
if (_M_buf) int
_M_free(_M_buf); strstreambuf::pcount() const
} { return pptr() ? pptr() - pbase() : 0; }
void strstreambuf::int_type
strstreambuf::freeze(bool frozenflag) strstreambuf::overflow(int_type c)
{ {
if (_M_dynamic) if (c == traits_type::eof())
_M_frozen = frozenflag; return traits_type::not_eof(c);
}
char*
strstreambuf::str()
{
freeze(true);
return eback();
}
int
strstreambuf::pcount() const
{ return pptr() ? pptr() - pbase() : 0; }
strstreambuf::int_type
strstreambuf::overflow(int_type c)
{
if (c == traits_type::eof())
return traits_type::not_eof(c);
// Try to expand the buffer. // Try to expand the buffer.
if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant)
{ {
ptrdiff_t old_size = epptr() - pbase(); ptrdiff_t old_size = epptr() - pbase();
ptrdiff_t new_size = max(2 * old_size, ptrdiff_t(1)); ptrdiff_t new_size = max(2 * old_size, ptrdiff_t(1));
char* buf = _M_alloc(new_size); char* buf = _M_alloc(new_size);
if (buf) if (buf)
{ {
memcpy(buf, pbase(), old_size); memcpy(buf, pbase(), old_size);
char* old_buffer = pbase(); char* old_buffer = pbase();
bool reposition_get = false; bool reposition_get = false;
ptrdiff_t old_get_offset; ptrdiff_t old_get_offset;
if (gptr() != 0) if (gptr() != 0)
{ {
reposition_get = true; reposition_get = true;
old_get_offset = gptr() - eback(); old_get_offset = gptr() - eback();
} }
_M_buf = buf; _M_buf = buf;
_M_buf_size = _M_buf_size_opt = new_size; _M_buf_size = _M_buf_size_opt = new_size;
setp(buf, buf + new_size); setp(buf, buf + new_size);
pbump(old_size); pbump(old_size);
if (reposition_get) if (reposition_get)
setg(buf, buf + old_get_offset, buf + setg(buf, buf + old_get_offset, buf +
max(old_get_offset, old_size)); max(old_get_offset, old_size));
_M_free(old_buffer); _M_free(old_buffer);
} }
} }
if (pptr() != epptr()) if (pptr() != epptr())
{ {
*pptr() = c; *pptr() = c;
pbump(1); pbump(1);
return c; return c;
} }
else else
return traits_type::eof(); return traits_type::eof();
} }
strstreambuf::int_type strstreambuf::int_type
strstreambuf::pbackfail(int_type c) strstreambuf::pbackfail(int_type c)
{ {
if (gptr() != eback()) if (gptr() != eback())
{ {
if (c == _Traits::eof()) if (c == _Traits::eof())
{ {
gbump(-1); gbump(-1);
...@@ -214,208 +214,211 @@ strstreambuf::pbackfail(int_type c) ...@@ -214,208 +214,211 @@ strstreambuf::pbackfail(int_type c)
return c; return c;
} }
} }
return _Traits::eof();
}
strstreambuf::int_type
strstreambuf::underflow()
{
if (gptr() == egptr() && pptr() && pptr() > egptr())
setg(eback(), gptr(), pptr());
if (gptr() != egptr())
return (unsigned char) *gptr();
else
return _Traits::eof(); return _Traits::eof();
} }
basic_streambuf<char, char_traits<char> >*
strstreambuf::setbuf(char*, streamsize)
{ return this; }
strstreambuf::pos_type strstreambuf::int_type
strstreambuf::seekoff(off_type off, ios_base::seekdir dir, strstreambuf::underflow()
ios_base::openmode mode) {
{ if (gptr() == egptr() && pptr() && pptr() > egptr())
bool do_get = false; setg(eback(), gptr(), pptr());
bool do_put = false;
if ((mode & (ios_base::in | ios_base::out))
== (ios_base::in | ios_base::out) &&
(dir == ios_base::beg || dir == ios_base::end))
do_get = do_put = true;
else if (mode & ios_base::in)
do_get = true;
else if (mode & ios_base::out)
do_put = true;
// !gptr() is here because, according to D.7.1 paragraph 4, the seekable
// area is undefined if there is no get area.
if ((!do_get && !do_put) || (do_put && !pptr()) || !gptr())
return pos_type(off_type(-1));
char* seeklow = eback();
char* seekhigh = epptr() ? epptr() : egptr();
off_type newoff;
switch (dir)
{
case ios_base::beg:
newoff = 0;
break;
case ios_base::end:
newoff = seekhigh - seeklow;
break;
case ios_base::cur:
newoff = do_put ? pptr() - seeklow : gptr() - seeklow;
break;
default:
return pos_type(off_type(-1));
}
off += newoff; if (gptr() != egptr())
if (off < 0 || off > seekhigh - seeklow) return (unsigned char) *gptr();
return pos_type(off_type(-1)); else
return _Traits::eof();
if (do_put) }
{
if (seeklow + off < pbase()) basic_streambuf<char, char_traits<char> >*
{ strstreambuf::setbuf(char*, streamsize)
setp(seeklow, epptr()); { return this; }
pbump(off);
} strstreambuf::pos_type
else strstreambuf::seekoff(off_type off, ios_base::seekdir dir,
{ ios_base::openmode mode)
setp(pbase(), epptr()); {
pbump(off - (pbase() - seeklow)); bool do_get = false;
} bool do_put = false;
}
if (do_get) if ((mode & (ios_base::in | ios_base::out))
{ == (ios_base::in | ios_base::out) &&
if (off <= egptr() - seeklow) (dir == ios_base::beg || dir == ios_base::end))
setg(seeklow, seeklow + off, egptr()); do_get = do_put = true;
else if (off <= pptr() - seeklow) else if (mode & ios_base::in)
setg(seeklow, seeklow + off, pptr()); do_get = true;
else else if (mode & ios_base::out)
setg(seeklow, seeklow + off, epptr()); do_put = true;
}
return pos_type(newoff); // !gptr() is here because, according to D.7.1 paragraph 4, the seekable
} // area is undefined if there is no get area.
if ((!do_get && !do_put) || (do_put && !pptr()) || !gptr())
return pos_type(off_type(-1));
strstreambuf::pos_type char* seeklow = eback();
strstreambuf::seekpos(pos_type pos, ios_base::openmode mode) char* seekhigh = epptr() ? epptr() : egptr();
{ return seekoff(pos - pos_type(off_type(0)), ios_base::beg, mode); }
off_type newoff;
switch (dir)
{
case ios_base::beg:
newoff = 0;
break;
case ios_base::end:
newoff = seekhigh - seeklow;
break;
case ios_base::cur:
newoff = do_put ? pptr() - seeklow : gptr() - seeklow;
break;
default:
return pos_type(off_type(-1));
}
off += newoff;
if (off < 0 || off > seekhigh - seeklow)
return pos_type(off_type(-1));
char* if (do_put)
strstreambuf::_M_alloc(size_t n) {
{ if (seeklow + off < pbase())
if (_M_alloc_fun) {
return static_cast<char*>(_M_alloc_fun(n)); setp(seeklow, epptr());
else pbump(off);
return new char[n]; }
} else
{
void setp(pbase(), epptr());
strstreambuf::_M_free(char* p) pbump(off - (pbase() - seeklow));
{ }
if (p) }
if (_M_free_fun) if (do_get)
_M_free_fun(p); {
if (off <= egptr() - seeklow)
setg(seeklow, seeklow + off, egptr());
else if (off <= pptr() - seeklow)
setg(seeklow, seeklow + off, pptr());
else
setg(seeklow, seeklow + off, epptr());
}
return pos_type(newoff);
}
strstreambuf::pos_type
strstreambuf::seekpos(pos_type pos, ios_base::openmode mode)
{ return seekoff(pos - pos_type(off_type(0)), ios_base::beg, mode); }
char*
strstreambuf::_M_alloc(size_t n)
{
if (_M_alloc_fun)
return static_cast<char*>(_M_alloc_fun(n));
else else
delete[] p; return new char[n];
} }
void void
strstreambuf::_M_setup(char* get, char* put, streamsize n) strstreambuf::_M_free(char* p)
{ {
if (get) if (p)
{ if (_M_free_fun)
size_t N = n > 0 ? size_t(n) : n == 0 ? strlen(get) : size_t(INT_MAX); _M_free_fun(p);
else
delete[] p;
}
void
strstreambuf::_M_setup(char* get, char* put, streamsize n)
{
if (get)
{
size_t N = n > 0 ? size_t(n) : n == 0 ? strlen(get) : size_t(INT_MAX);
if (put) if (put)
{ {
setg(get, get, put); setg(get, get, put);
setp(put, put + N); setp(put, put + N);
} }
else else
setg(get, get, get + N); setg(get, get, get + N);
} }
} }
istrstream::istrstream(char* s) istrstream::istrstream(char* s)
: basic_ios<char>(), basic_istream<char>(0), _M_buf(s, 0) : basic_ios<char>(), basic_istream<char>(0), _M_buf(s, 0)
{ basic_ios<char>::init(&_M_buf); } { basic_ios<char>::init(&_M_buf); }
istrstream::istrstream(const char* s) istrstream::istrstream(const char* s)
: basic_ios<char>(), basic_istream<char>(0), _M_buf(s, 0) : basic_ios<char>(), basic_istream<char>(0), _M_buf(s, 0)
{ basic_ios<char>::init(&_M_buf); } { basic_ios<char>::init(&_M_buf); }
istrstream::istrstream(char* s, streamsize n) istrstream::istrstream(char* s, streamsize n)
: basic_ios<char>(), basic_istream<char>(0), _M_buf(s, n) : basic_ios<char>(), basic_istream<char>(0), _M_buf(s, n)
{ basic_ios<char>::init(&_M_buf); } { basic_ios<char>::init(&_M_buf); }
istrstream::istrstream(const char* s, streamsize n) istrstream::istrstream(const char* s, streamsize n)
: basic_ios<char>(), basic_istream<char>(0), _M_buf(s, n) : basic_ios<char>(), basic_istream<char>(0), _M_buf(s, n)
{ basic_ios<char>::init(&_M_buf); } { basic_ios<char>::init(&_M_buf); }
istrstream::~istrstream() { } istrstream::~istrstream() { }
strstreambuf* strstreambuf*
istrstream::rdbuf() const istrstream::rdbuf() const
{ return const_cast<strstreambuf*>(&_M_buf); } { return const_cast<strstreambuf*>(&_M_buf); }
char* char*
istrstream::str() istrstream::str()
{ return _M_buf.str(); } { return _M_buf.str(); }
ostrstream::ostrstream() : basic_ios<char>(), basic_ostream<char>(0), _M_buf() ostrstream::ostrstream()
{ basic_ios<char>::init(&_M_buf); } : basic_ios<char>(), basic_ostream<char>(0), _M_buf()
{ basic_ios<char>::init(&_M_buf); }
ostrstream::ostrstream(char* s, int n, ios_base::openmode mode)
: basic_ios<char>(), basic_ostream<char>(0), ostrstream::ostrstream(char* s, int n, ios_base::openmode mode)
_M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s) : basic_ios<char>(), basic_ostream<char>(0),
{ basic_ios<char>::init(&_M_buf); } _M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s)
{ basic_ios<char>::init(&_M_buf); }
ostrstream::~ostrstream() {}
ostrstream::~ostrstream() {}
strstreambuf*
ostrstream::rdbuf() const strstreambuf*
{ return const_cast<strstreambuf*>(&_M_buf); } ostrstream::rdbuf() const
{ return const_cast<strstreambuf*>(&_M_buf); }
void
ostrstream::freeze(bool freezeflag) void
{ _M_buf.freeze(freezeflag); } ostrstream::freeze(bool freezeflag)
{ _M_buf.freeze(freezeflag); }
char*
ostrstream::str() char*
{ return _M_buf.str(); } ostrstream::str()
{ return _M_buf.str(); }
int
ostrstream::pcount() const int
{ return _M_buf.pcount(); } ostrstream::pcount() const
{ return _M_buf.pcount(); }
strstream::strstream() : basic_ios<char>(), basic_iostream<char>(0), _M_buf()
{ basic_ios<char>::init(&_M_buf); } strstream::strstream()
: basic_ios<char>(), basic_iostream<char>(0), _M_buf()
strstream::strstream(char* s, int n, ios_base::openmode mode) { basic_ios<char>::init(&_M_buf); }
: basic_ios<char>(), basic_iostream<char>(0),
_M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s) strstream::strstream(char* s, int n, ios_base::openmode mode)
{ basic_ios<char>::init(&_M_buf); } : basic_ios<char>(), basic_iostream<char>(0),
_M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s)
strstream::~strstream() { } { basic_ios<char>::init(&_M_buf); }
strstreambuf* strstream::~strstream() { }
strstream::rdbuf() const
{ return const_cast<strstreambuf*>(&_M_buf); } strstreambuf*
strstream::rdbuf() const
void { return const_cast<strstreambuf*>(&_M_buf); }
strstream::freeze(bool freezeflag)
{ _M_buf.freeze(freezeflag); } void
strstream::freeze(bool freezeflag)
int { _M_buf.freeze(freezeflag); }
strstream::pcount() const
{ return _M_buf.pcount(); } int
strstream::pcount() const
char* { return _M_buf.pcount(); }
strstream::str()
{ return _M_buf.str(); } char*
strstream::str()
{ return _M_buf.str(); }
} // namespace std
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
// backward strstream members // backward strstream members
#include <strstream.h> #include <strstream>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
// { dg-options "-Wno-deprecated" } // { dg-options "-Wno-deprecated" }
int test01() int test01()
{ {
strstream s; std::strstream s;
for (unsigned i=0 ; i!= 1000 ; ++i) for (unsigned i=0 ; i!= 1000 ; ++i)
s << i << std::endl; s << i << std::endl;
s << std::ends; s << std::ends;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment