configure.in: Change AM_PROG_LIBTOOL to AC_PROG_LIBTOOL.

2000-07-25  Benjamin Kosnik  <bkoz@gnu.org>

	* configure.in: Change AM_PROG_LIBTOOL to AC_PROG_LIBTOOL. Change
	it back for current versions of maintainer-tools...
	* acinclude.m4: Some cleanups...
	* aclocal: Regenerated.
	* configure: Regenerated.

	* src/Makefile.am (CXXLINK): Add -Wl,-01 to the link line for
	optimizing/adapting the hash table using GNU ld.
	* src/Makefile.in: Regenerate.

	* bits/std_fstream.h: Parameterize __basic_file.
	* config/c_io_libio.cc: Add wchar_t methods for parameterization.
	* bits/basic_file.h: Same here.

	* bits/fstream.tcc: Shorten __retval to __ret.
	* bits/ostream.tcc: Same.
	* bits/sbuf_iter.h: Same.
	* bits/sstream.tcc: Same.
	* bits/streambuf.tcc: Same.
	* bits/std_fstream.h: Same.
	* src/string-inst.cc: Same.
	* src/ios.cc: Same.
	* config/c_io_libio.cc: Same.
	* bits/string.tcc: Same.
	* bits/std_streambuf.h: Same.

From-SVN: r35262
This commit is contained in:
Benjamin Kosnik 2000-07-26 06:51:38 +00:00
parent 44fc6a025a
commit 5780a46bca
18 changed files with 1789 additions and 1634 deletions

View file

@ -1,7 +1,43 @@
2000-07-25 Benjamin Kosnik <bkoz@gnu.org>
* configure.in: Change AM_PROG_LIBTOOL to AC_PROG_LIBTOOL. Change
it back for current versions of maintainer-tools...
* acinclude.m4: Some cleanups...
* aclocal: Regenerated.
* configure: Regenerated.
* src/Makefile.am (CXXLINK): Add -Wl,-01 to the link line for
optimizing/adapting the hash table using GNU ld.
* src/Makefile.in: Regenerate.
2000-07-24 H.J. Lu <hjl@gnu.org>
* src/Makefile.am (LIBIO_INCLUDES): Set to -I$(top_srcdir)/libio
even if GLIBCPP_NEED_LIBIO is false. The installed glibc header
files don't include private libio header files needed by
libstdc++ v3.
* src/Makefile.in: Rebuild.
2000-07-24 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/std_fstream.h: Parameterize __basic_file.
* config/c_io_libio.cc: Add wchar_t methods for parameterization.
* bits/basic_file.h: Same here.
* bits/istream.tcc (getline): Tweaks.
* bits/fstream.tcc: Shorten __retval to __ret.
* bits/ostream.tcc: Same.
* bits/sbuf_iter.h: Same.
* bits/sstream.tcc: Same.
* bits/streambuf.tcc: Same.
* bits/std_fstream.h: Same.
* src/string-inst.cc: Same.
* src/ios.cc: Same.
* config/c_io_libio.cc: Same.
* bits/string.tcc: Same.
* bits/std_streambuf.h: Same.
2000-07-23 Brent Verner <brent@rcfile.org>
* bits/istream.tcc: istream::getline(char_type*, streamsize,

View file

@ -1,3 +1,4 @@
dnl
dnl Initialize configure bits.
dnl
@ -27,10 +28,11 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
fi
AC_SUBST(glibcpp_basedir)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
# AC_PROG_CC
# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
@ -73,6 +75,9 @@ fi
LIB_AC_PROG_CC
# Can't just call these here as g++ requires libstc++ to be built....
# AC_PROG_CXX
# Likewise for AC_PROG_CXX.
AC_DEFUN(LIB_AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
@ -107,49 +112,42 @@ fi
LIB_AC_PROG_CXX
# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
# run it explicitly here, it will be run implicitly before
# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
AC_CANONICAL_BUILD
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PROG_INSTALL
AC_PROG_INSTALL
AM_MAINTAINER_MODE
AM_MAINTAINER_MODE
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
AC_EXEEXT
fi
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
AC_EXEEXT
fi
# configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags
glibcpp_cflags=
glibcpp_cxxflags=
# configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags
. [$]{glibcpp_basedir}/configure.host
glibcpp_cflags=
glibcpp_cxxflags=
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
AC_SUBST(GLIBCPP_CFLAGS)
AC_SUBST(GLIBCPP_CXXFLAGS)
GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
AC_SUBST(GLIBCPP_CFLAGS)
AC_SUBST(GLIBCPP_CXXFLAGS)
])
@ -676,7 +674,7 @@ dnl GLIBCPP_CHECK_CPU
AC_DEFUN(GLIBCPP_CHECK_CPU, [
AC_MSG_CHECKING([for cpu primitives directory])
CPU_FLAGS=
case "$target_cpu" in
case "${target_cpu}" in
alpha*)
cpu_include_dir="config/cpu/alpha"
;;
@ -1039,14 +1037,15 @@ AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
[case "${enableval}" in
yes) enable_debug=yes ;;
no) enable_debug=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "$enable_debug" in
case "${enable_debug}" in
yes)
DEBUG_FLAGS='-O0 -ggdb'
;;
@ -1081,13 +1080,20 @@ changequote(<<, >>)dnl
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enableval" in
xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x) enable_cxx_flags='' ;;
*) enable_cxx_flags="$enableval" ;;
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
dnl Thinko on my part during design. This kludge is the workaround.
if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
if test "$enable_cxx_flags" = "none"; then
enable_cxx_flags='';
fi
dnl Run through flags (either default or command-line) and set anything
dnl extra (e.g., #defines) that must accompany particular g++ options.
if test -n "$enable_cxx_flags"; then
@ -1389,30 +1395,31 @@ AC_ARG_ENABLE(cshadow-headers,
changequote(<<, >>)dnl
<< --enable-cshadow-headers construct "shadowed" C header files for
g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
yes) enable_cshadow_headers=yes
changequote([, ])
[case "$enableval" in
yes) enable_cshadow_headers=yes
;;
no) enable_cshadow_headers=no
no) enable_cshadow_headers=no
;;
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
;;
esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
AC_MSG_RESULT($enable_cshadow_headers)
dnl Option parsed, now set things appropriately
dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
case "$enable_cshadow_headers" in
esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)
AC_MSG_RESULT($enable_cshadow_headers)
dnl Option parsed, now set things appropriately
dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
case "$enable_cshadow_headers" in
yes)
CSHADOWFLAGS=""
;;
no)
CSHADOWFLAGS=""
;;
esac
esac
AC_SUBST(CSHADOWFLAGS)
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
AC_SUBST(CSHADOWFLAGS)
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
])
@ -1508,7 +1515,7 @@ dnl Then, if any (well almost any) other make is called, and GNU make also
dnl exists, then the other make wraps the GNU make.
dnl
dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
dnl @version $Id: acinclude.m4,v 1.45 2000/07/21 20:59:23 gdr Exp $
dnl @version $Id: acinclude.m4,v 1.46 2000/07/24 16:33:55 bkoz Exp $
dnl
dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
@ -1534,5 +1541,3 @@ dnl string, '#' otherwise
fi
AC_SUBST(ifGNUmake)
])

View file

@ -10,6 +10,7 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl
dnl Initialize configure bits.
dnl
@ -39,10 +40,11 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
fi
AC_SUBST(glibcpp_basedir)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
# AC_PROG_CC
# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
@ -85,6 +87,9 @@ fi
LIB_AC_PROG_CC
# Can't just call these here as g++ requires libstc++ to be built....
# AC_PROG_CXX
# Likewise for AC_PROG_CXX.
AC_DEFUN(LIB_AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
@ -119,49 +124,42 @@ fi
LIB_AC_PROG_CXX
# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
# run it explicitly here, it will be run implicitly before
# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
AC_CANONICAL_BUILD
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PROG_INSTALL
AC_PROG_INSTALL
AM_MAINTAINER_MODE
AM_MAINTAINER_MODE
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
AC_EXEEXT
fi
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
AC_EXEEXT
fi
# configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags
glibcpp_cflags=
glibcpp_cxxflags=
# configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags
. [$]{glibcpp_basedir}/configure.host
glibcpp_cflags=
glibcpp_cxxflags=
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
AC_SUBST(GLIBCPP_CFLAGS)
AC_SUBST(GLIBCPP_CXXFLAGS)
GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
AC_SUBST(GLIBCPP_CFLAGS)
AC_SUBST(GLIBCPP_CXXFLAGS)
])
@ -688,7 +686,7 @@ dnl GLIBCPP_CHECK_CPU
AC_DEFUN(GLIBCPP_CHECK_CPU, [
AC_MSG_CHECKING([for cpu primitives directory])
CPU_FLAGS=
case "$target_cpu" in
case "${target_cpu}" in
alpha*)
cpu_include_dir="config/cpu/alpha"
;;
@ -1051,14 +1049,15 @@ AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
[case "${enableval}" in
yes) enable_debug=yes ;;
no) enable_debug=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "$enable_debug" in
case "${enable_debug}" in
yes)
DEBUG_FLAGS='-O0 -ggdb'
;;
@ -1093,13 +1092,20 @@ changequote(<<, >>)dnl
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enableval" in
xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x) enable_cxx_flags='' ;;
*) enable_cxx_flags="$enableval" ;;
xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x)
enable_cxx_flags='' ;;
*)
enable_cxx_flags="$enableval" ;;
esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
dnl Thinko on my part during design. This kludge is the workaround.
if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
if test "$enable_cxx_flags" = "none"; then
enable_cxx_flags='';
fi
dnl Run through flags (either default or command-line) and set anything
dnl extra (e.g., #defines) that must accompany particular g++ options.
if test -n "$enable_cxx_flags"; then
@ -1401,30 +1407,31 @@ AC_ARG_ENABLE(cshadow-headers,
changequote(<<, >>)dnl
<< --enable-cshadow-headers construct "shadowed" C header files for
g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
yes) enable_cshadow_headers=yes
changequote([, ])
[case "$enableval" in
yes) enable_cshadow_headers=yes
;;
no) enable_cshadow_headers=no
no) enable_cshadow_headers=no
;;
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
;;
esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
AC_MSG_RESULT($enable_cshadow_headers)
dnl Option parsed, now set things appropriately
dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
case "$enable_cshadow_headers" in
esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)
AC_MSG_RESULT($enable_cshadow_headers)
dnl Option parsed, now set things appropriately
dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
case "$enable_cshadow_headers" in
yes)
CSHADOWFLAGS=""
;;
no)
CSHADOWFLAGS=""
;;
esac
esac
AC_SUBST(CSHADOWFLAGS)
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
AC_SUBST(CSHADOWFLAGS)
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
])
@ -1547,8 +1554,6 @@ dnl string, '#' otherwise
AC_SUBST(ifGNUmake)
])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.

View file

@ -42,129 +42,206 @@ namespace std {
// Some of these member functions are based on libio/filebuf.cc.
// Also note that the order and number of virtual functions has to precisely
// match the order and number in the _IO_jump_t struct defined in libioP.h.
template<typename _CharT>
#if _GLIBCPP_BASIC_FILE_INHERITANCE
class __basic_file: public __c_file_type
class __basic_file: public __c_file_type
#else
class __basic_file
class __basic_file
#endif
{
{
#if _GLIBCPP_BASIC_FILE_ENCAPSULATION
int _M_fileno;
__c_file_type* _M_cfile;
int _M_fileno;
__c_file_type* _M_cfile;
#endif
public:
__basic_file(__c_lock* __lock = 0);
public:
__basic_file(__c_lock* __lock = 0);
void
__basic_file::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
int& __rw_mode);
// Eqivalent to the normal fopen function.
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
void
__basic_file::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
int& __rw_mode);
// Used for opening the standard streams, cin, cout, cerr, clog,
// and their wide-stream equivalents. Instead of calling open, it
// just sets __c_file_type->_fileno and the respective _flags bits, and
// returns.
__basic_file*
sys_open(int __fd, ios_base::openmode __mode);
// Eqivalent to the normal fopen function.
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
__basic_file*
close();
// Used for opening the standard streams, cin, cout, cerr, clog,
// and their wide-stream equivalents. Instead of calling open, it
// just sets __c_file_type->_fileno and the respective _flags bits, and
// returns.
__basic_file*
sys_open(int __fd, ios_base::openmode __mode);
bool
is_open();
__basic_file*
close();
// Needed by ios_base::sync_with_stdio.
int get_fileno(void);
bool
is_open();
// NB: Must match FILE specific jump table starting here--this
// means all virtual functions starting with the dtor must match,
// slot by slot. For glibc-based dystems, this means the _IO_FILE
// as the FILE struct and _IO_jump_t as the jump table.
virtual
~__basic_file(); // Takes the place of __finish.
// Needed by ios_base::sync_with_stdio.
int get_fileno(void);
virtual int
overflow(int __c = EOF);
// NB: Must match FILE specific jump table starting here--this
// means all virtual functions starting with the dtor must match,
// slot by slot. For glibc-based dystems, this means the _IO_FILE
// as the FILE struct and _IO_jump_t as the jump table.
virtual
~__basic_file(); // Takes the place of __finish.
virtual int
underflow();
virtual int
overflow(int __c = EOF);
virtual int
uflow();
virtual int
underflow();
virtual int
pbackfail(int __c);
virtual int
uflow();
// A complex "write" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamsize
xsputn(const char* __s, streamsize __n);
virtual int
pbackfail(int __c);
// A complex "read" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamsize
xsgetn(char* __s, streamsize __n);
// A complex "write" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamsize
xsputn(const char* __s, streamsize __n);
// A complex "seekoff" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
// A complex "read" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamsize
xsgetn(char* __s, streamsize __n);
// A complex "seekpos" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
// A complex "seekoff" function that sets all of __c_file_type's
// ponters and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
virtual streambuf*
setbuf(_CharT* __b, int __len);
// A complex "seekpos" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages it's
// relation to the external byte sequence.
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
virtual int
sync();
virtual streambuf*
setbuf(char* __b, int __len);
virtual int
doallocate();
virtual int
sync();
// A simple read function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_read(char* __s, streamsize __n);
virtual int
doallocate();
// A simple write function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_write(const char* __s, streamsize __n);
// A simple read function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_read(char* __s, streamsize __n);
// A simple seek function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamoff
sys_seek(streamoff __off, ios_base::seekdir __way);
// A simple write function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_write(const char* __s, streamsize __n);
virtual int
sys_close();
// A simple seek function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamoff
sys_seek(streamoff __off, ios_base::seekdir __way);
virtual int
sys_stat(void* __v);
virtual int
sys_close();
virtual int
showmanyc();
virtual int
sys_stat(void* __v);
virtual int
showmanyc();
virtual void
imbue(void* __v);
virtual void
imbue(void* __v);
};
// __basic_file<char> specializations
template<>
__basic_file<char>::__basic_file(__c_lock* __lock);
template<>
int
__basic_file<char>::overflow(int __c);
template<>
int
__basic_file<char>::underflow();
template<>
streamsize
__basic_file<char>::xsputn(const char* __s, streamsize __n);
template<>
streamoff
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode);
template<>
streamoff
__basic_file<char>::seekpos(streamoff __pos, ios_base::openmode __mode);
template<>
streambuf*
__basic_file<char>::setbuf(char* __b, int __len);
template<>
int
__basic_file<char>::sync();
template<>
int
__basic_file<char>::doallocate();
// __basic_file<wchar_t> specializations
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
__basic_file<wchar_t>::__basic_file(__c_lock* __lock);
template<>
int
__basic_file<wchar_t>::overflow(int __c);
template<>
int
__basic_file<wchar_t>::underflow();
template<>
streamsize
__basic_file<wchar_t>::xsputn(const char* __s, streamsize __n);
template<>
streamoff
__basic_file<wchar_t>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode);
template<>
streamoff
__basic_file<wchar_t>::seekpos(streamoff __pos, ios_base::openmode __mode);
template<>
streambuf*
__basic_file<wchar_t>::setbuf(wchar_t* __b, int __len);
template<>
int
__basic_file<wchar_t>::sync();
template<>
int
__basic_file<wchar_t>::doallocate();
#endif
} // namespace std
#endif /* _CPP_BASIC_FILE */

View file

@ -111,7 +111,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
open(const char* __s, ios_base::openmode __mode)
{
__filebuf_type *__retval = NULL;
__filebuf_type *__ret = NULL;
if (!this->is_open())
{
_M_filebuf_init();
@ -126,10 +126,10 @@ namespace std
if (__mode & ios_base::ate
&& this->seekoff(0, ios_base::end, __mode) < 0)
this->close();
__retval = this;
__ret = this;
}
}
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -137,7 +137,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
close()
{
__filebuf_type *__retval = NULL;
__filebuf_type *__ret = NULL;
if (this->is_open())
{
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
@ -164,7 +164,7 @@ namespace std
_M_pback = NULL;
this->setg(NULL, NULL, NULL);
this->setp(NULL, NULL);
__retval = this;
__ret = this;
}
// Can actually allocate this file as part of an open and never
@ -175,7 +175,7 @@ namespace std
_M_file = NULL;
}
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -183,7 +183,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
showmanyc()
{
streamsize __retval = -1;
streamsize __ret = -1;
bool __testin = _M_mode & ios_base::in;
if (__testin)
@ -192,10 +192,10 @@ namespace std
if (_M_in_cur >= _M_in_end)
__testeof = this->underflow() == traits_type::eof();
if (!__testeof)
__retval = _M_in_end - _M_in_cur;
__ret = _M_in_end - _M_in_cur;
}
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -203,7 +203,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
underflow()
{
int_type __retval = traits_type::eof();
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
if (__testin)
@ -265,7 +265,7 @@ namespace std
{
if (__testout)
_M_out_cur = _M_in_cur;
__retval = traits_type::to_int_type(*_M_in_cur);
__ret = traits_type::to_int_type(*_M_in_cur);
}
// Part three: Sync the current internal buffer
@ -281,7 +281,7 @@ namespace std
}
}
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -289,14 +289,14 @@ namespace std
basic_filebuf<_CharT, _Traits>::
pbackfail(int_type __i)
{
int_type __retval = traits_type::eof();
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
if (__testin)
{
bool __testpb = _M_in_beg < _M_in_cur;
char_type __c = traits_type::to_char_type(__i);
bool __testeof = traits_type::eq_int_type(__i, __retval);
bool __testeof = traits_type::eq_int_type(__i, __ret);
if (__testpb)
{
@ -310,14 +310,14 @@ namespace std
--_M_in_cur;
if (__testout)
--_M_out_cur;
__retval = __i;
__ret = __i;
}
else if (__testeof)
{
--_M_in_cur;
if (__testout)
--_M_out_cur;
__retval = traits_type::not_eof(__i);
__ret = traits_type::not_eof(__i);
}
else if (!__testeof)
{
@ -326,7 +326,7 @@ namespace std
--_M_out_cur;
_M_pback_create();
*_M_in_cur = __c;
__retval = __i;
__ret = __i;
}
}
else
@ -342,14 +342,14 @@ namespace std
_M_pback_create();
*_M_in_cur = __c;
}
__retval = __i;
__ret = __i;
}
else
__retval = traits_type::not_eof(__i);
__ret = traits_type::not_eof(__i);
}
}
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -357,7 +357,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
overflow(int_type __c)
{
int_type __retval = traits_type::eof();
int_type __ret = traits_type::eof();
bool __testpos = _M_out_cur && _M_out_cur >= _M_buf + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
@ -367,14 +367,14 @@ namespace std
{
*_M_out_cur = traits_type::to_char_type(__c);
_M_out_cur_move(1);
__retval = traits_type::not_eof(__c);
__ret = traits_type::not_eof(__c);
}
else
__retval = this->_M_really_overflow(__c);
__ret = this->_M_really_overflow(__c);
}
_M_last_overflowed = false; // Set in _M_really_overflow, below.
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -382,7 +382,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
_M_really_overflow(int_type __c)
{
int_type __retval = traits_type::eof();
int_type __ret = traits_type::eof();
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
@ -424,12 +424,12 @@ namespace std
if (__len == __plen)
{
_M_set_indeterminate();
__retval = traits_type::not_eof(__c);
__ret = traits_type::not_eof(__c);
}
}
}
_M_last_overflowed = true;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -437,7 +437,7 @@ namespace std
basic_filebuf<_CharT, _Traits>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
pos_type __retval = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
bool __testopen = this->is_open();
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
@ -471,19 +471,19 @@ namespace std
else if (__testget && __way == ios_base::cur)
__computed_off += _M_in_cur - _M_in_beg;
__retval = _M_file->seekoff(__computed_off, __way, __mode);
__ret = _M_file->seekoff(__computed_off, __way, __mode);
_M_set_indeterminate();
}
// NB: Need to do this in case _M_file in indeterminate
// state, ie _M_file->_offset == -1
else
{
__retval = _M_file->seekoff(__off, ios_base::cur, __mode);
__retval += max(_M_out_cur, _M_in_cur) - _M_buf;
__ret = _M_file->seekoff(__off, ios_base::cur, __mode);
__ret += max(_M_out_cur, _M_in_cur) - _M_buf;
}
}
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -491,13 +491,13 @@ namespace std
basic_filebuf<_CharT, _Traits>::
seekpos(pos_type __pos, ios_base::openmode __mode)
{
pos_type __retval;
pos_type __ret;
off_type __off = __pos;
__retval = this->seekoff(__off, ios_base::beg, __mode);
__ret = this->seekoff(__off, ios_base::beg, __mode);
_M_last_overflowed = false;
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>

View file

@ -876,17 +876,17 @@ namespace std {
basic_istream<_CharT, _Traits>::
sync(void)
{
int __retval = traits_type::eof();
int __ret = traits_type::eof();
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try {
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __retval == __sb->pubsync())
if (!__sb || __ret == __sb->pubsync())
this->setstate(ios_base::badbit);
else
__retval = 0;
__ret = 0;
}
catch(exception& __fail){
// 27.6.1.3 paragraph 1
@ -896,7 +896,7 @@ namespace std {
throw;
}
}
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -904,14 +904,13 @@ namespace std {
basic_istream<_CharT, _Traits>::
tellg(void)
{
pos_type __retval = pos_type(-1);
pos_type __ret = pos_type(-1);
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try {
__retval = this->rdbuf()->pubseekoff(0, ios_base::cur,
ios_base::in);
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
}
catch(exception& __fail){
// 27.6.1.3 paragraph 1
@ -921,7 +920,7 @@ namespace std {
throw;
}
}
return __retval;
return __ret;
}

View file

@ -360,12 +360,12 @@ namespace std {
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::tellp()
{
pos_type __retval = pos_type(-1);
pos_type __ret = pos_type(-1);
bool __testok = this->fail() != true;
if (__testok)
__retval = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
return __retval;
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
return __ret;
}

View file

@ -164,14 +164,14 @@ namespace std
operator*() const
{
// The result of operator*() on an end of stream is undefined.
char_type __retval;
char_type __ret;
if (_M_istreambuf && _M_c != static_cast<int_type>(-2))
__retval = _M_c;
__ret = _M_c;
else if (_M_istreambuf)
__retval = traits_type::to_char_type(_M_istreambuf->sgetc());
__ret = traits_type::to_char_type(_M_istreambuf->sgetc());
else
__retval = static_cast<char_type>(traits_type::eof());
return __retval;
__ret = static_cast<char_type>(traits_type::eof());
return __ret;
}
__istreambufiter_type&

View file

@ -43,7 +43,7 @@ namespace std {
basic_stringbuf<_CharT, _Traits, _Alloc>::
pbackfail(int_type __c)
{
int_type __retval = traits_type::eof();
int_type __ret = traits_type::eof();
bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
@ -55,21 +55,21 @@ namespace std {
&& !__testeof)
{
--_M_in_cur;
__retval = __c;
__ret = __c;
}
else if (!__testeof)
{
--_M_in_cur;
*_M_in_cur = traits_type::to_char_type(__c);
__retval = __c;
__ret = __c;
}
else if (__testeof)
{
--_M_in_cur;
__retval = traits_type::not_eof(__c);
__ret = traits_type::not_eof(__c);
}
}
return __retval;
return __ret;
}
template <class _CharT, class _Traits, class _Alloc>
@ -77,8 +77,8 @@ namespace std {
basic_stringbuf<_CharT, _Traits, _Alloc>::
overflow(int_type __c)
{
int_type __retval = traits_type::eof();
bool __testeof = traits_type::eq_int_type(__c, __retval);
int_type __ret = traits_type::eof();
bool __testeof = traits_type::eq_int_type(__c, __ret);
bool __testwrite = _M_out_cur < _M_buf + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
@ -92,7 +92,7 @@ namespace std {
__len *= 2;
if (__testwrite)
__retval = this->sputc(__c);
__ret = this->sputc(__c);
else if (__len <= _M_string.max_size())
{
// Force-allocate, re-sync.
@ -103,13 +103,13 @@ namespace std {
_M_out_cur - _M_out_beg);
*_M_out_cur = traits_type::to_char_type(__c);
_M_out_cur_move(1);
__retval = __c;
__ret = __c;
}
}
else
__retval = traits_type::not_eof(__c);
__ret = traits_type::not_eof(__c);
}
return __retval;
return __ret;
}
template <class _CharT, class _Traits, class _Alloc>
@ -117,7 +117,7 @@ namespace std {
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
pos_type __retval = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
bool __testboth = __testin && __testout && __way != ios_base::cur;
@ -158,16 +158,16 @@ namespace std {
&& __newoffi + __off >= 0 && __endi - __beg >= __newoffi + __off)
{
_M_in_cur = __beg + __newoffi + __off;
__retval = pos_type(__newoffi);
__ret = pos_type(__newoffi);
}
if (__testout
&& __newoffo + __off >= 0 && __endo - __beg >= __newoffo + __off)
{
_M_out_cur_move(__newoffo + __off - (_M_out_cur - __beg));
__retval = pos_type(__newoffo);
__ret = pos_type(__newoffo);
}
}
return __retval;
return __ret;
}
template <class _CharT, class _Traits, class _Alloc>
@ -175,7 +175,7 @@ namespace std {
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode)
{
pos_type __retval = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
off_type __pos = __sp._M_position();
char_type* __beg = NULL;
char_type* __end = NULL;
@ -200,10 +200,10 @@ namespace std {
_M_in_cur = _M_in_beg + __pos;
if (__testout)
_M_out_cur_move((__pos) - (_M_out_cur - __beg));
__retval = pos_type(off_type(__pos));
__ret = pos_type(off_type(__pos));
}
return __retval;
return __ret;
}
} // namespace std

View file

@ -56,7 +56,7 @@ namespace std {
// Non-standard Types:
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef __basic_file __file_type;
typedef __basic_file<char_type> __file_type;
typedef typename traits_type::state_type __state_type;
typedef codecvt<char_type, char, __state_type> __codecvt_type;
typedef typename __codecvt_type::result __res_type;
@ -199,22 +199,22 @@ namespace std {
virtual streamsize
xsgetn(char_type* __s, streamsize __n)
{
streamsize __retval = 0;
streamsize __ret = 0;
// Clear out pback buffer before going on to the real deal...
if (_M_pback_init)
{
while (__retval < __n && _M_in_cur < _M_in_end)
while (__ret < __n && _M_in_cur < _M_in_end)
{
*__s = *_M_in_cur;
++__retval;
++__ret;
++__s;
++_M_in_cur;
}
_M_pback_destroy();
}
if (__retval < __n)
__retval += __streambuf_type::xsgetn(__s, __n - __retval);
return __retval;
if (__ret < __n)
__ret += __streambuf_type::xsgetn(__s, __n - __ret);
return __ret;
}
virtual streamsize

View file

@ -232,12 +232,12 @@ namespace std {
bool
_M_is_indeterminate(void)
{
bool __retval = false;
bool __ret = false;
if (_M_mode & ios_base::in)
__retval = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
__ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
if (_M_mode & ios_base::out)
__retval = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
return __retval;
__ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
return __ret;
}
public:
@ -294,21 +294,21 @@ namespace std {
streamsize
in_avail()
{
streamsize __retval;
streamsize __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
{
if (_M_pback_init)
{
int_type __save_len = _M_pback_end_save - _M_pback_cur_save;
int_type __pback_len = _M_in_cur - _M_pback;
__retval = __save_len - __pback_len;
__ret = __save_len - __pback_len;
}
else
__retval = this->egptr() - this->gptr();
__ret = this->egptr() - this->gptr();
}
else
__retval = this->showmanyc();
return __retval;
__ret = this->showmanyc();
return __ret;
}
int_type
@ -324,12 +324,12 @@ namespace std {
int_type
sgetc()
{
int_type __retval;
int_type __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
__retval = traits_type::to_int_type(*gptr());
__ret = traits_type::to_int_type(*gptr());
else
__retval = this->underflow();
return __retval;
__ret = this->underflow();
return __ret;
}
streamsize
@ -457,18 +457,18 @@ namespace std {
virtual int_type
uflow()
{
int_type __retval = traits_type::eof();
bool __testeof = this->underflow() == __retval;
int_type __ret = traits_type::eof();
bool __testeof = this->underflow() == __ret;
bool __testpending = _M_in_cur && _M_in_cur < _M_in_end;
if (!__testeof && __testpending)
{
__retval = traits_type::to_int_type(*_M_in_cur);
__ret = traits_type::to_int_type(*_M_in_cur);
++_M_in_cur;
if (_M_buf_unified && _M_mode & ios_base::out)
++_M_out_cur;
}
return __retval;
return __ret;
}
// Putback:

View file

@ -41,18 +41,18 @@ namespace std {
basic_streambuf<_CharT, _Traits>::
sbumpc()
{
int_type __retval;
int_type __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
{
char_type __c = *gptr();
++_M_in_cur;
if (_M_buf_unified && _M_mode & ios_base::out)
++_M_out_cur;
__retval = traits_type::to_int_type(__c);
__ret = traits_type::to_int_type(__c);
}
else
__retval = this->uflow();
return __retval;
__ret = this->uflow();
return __ret;
}
template<typename _CharT, typename _Traits>
@ -60,19 +60,19 @@ namespace std {
basic_streambuf<_CharT, _Traits>::
sputbackc(char_type __c)
{
int_type __retval;
int_type __ret;
bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
bool __testne = _M_in_cur && !traits_type::eq(__c, this->gptr()[-1]);
if (!__testpos || __testne)
__retval = pbackfail(traits_type::to_int_type(__c));
__ret = pbackfail(traits_type::to_int_type(__c));
else
{
--_M_in_cur;
if (_M_buf_unified && _M_mode & ios_base::out)
--_M_out_cur;
__retval = traits_type::to_int_type(*this->gptr());
__ret = traits_type::to_int_type(*this->gptr());
}
return __retval;
return __ret;
}
template<typename _CharT, typename _Traits>
@ -80,17 +80,17 @@ namespace std {
basic_streambuf<_CharT, _Traits>::
sungetc()
{
int_type __retval;
int_type __ret;
if (_M_in_cur && _M_in_beg < _M_in_cur)
{
--_M_in_cur;
if (_M_buf_unified && _M_mode & ios_base::out)
--_M_out_cur;
__retval = traits_type::to_int_type(*_M_in_cur);
__ret = traits_type::to_int_type(*_M_in_cur);
}
else
__retval = this->pbackfail();
return __retval;
__ret = this->pbackfail();
return __ret;
}
// Don't test against _M_buf + _M_buf_size, because _M_buf reflects
@ -103,17 +103,17 @@ namespace std {
basic_streambuf<_CharT, _Traits>::
sputc(char_type __c)
{
int_type __retval;
int_type __ret;
if (_M_out_cur && _M_out_cur < _M_out_beg + _M_buf_size)
{
*_M_out_cur = __c;
_M_out_cur_move(1);
__retval = traits_type::to_int_type(__c);
__ret = traits_type::to_int_type(__c);
}
else
__retval = this->overflow(traits_type::to_int_type(__c));
return __retval;
__ret = this->overflow(traits_type::to_int_type(__c));
return __ret;
}
template<typename _CharT, typename _Traits>
@ -122,39 +122,39 @@ namespace std {
xsgetn(char_type* __s, streamsize __n)
{
bool __testout = _M_mode & ios_base::out;
streamsize __retval = 0;
streamsize __ret = 0;
if (__n)
{
while (__retval < __n)
while (__ret < __n)
{
if (_M_in_cur < _M_in_end)
{
size_t __len;
if (_M_in_cur + __n - __retval <= _M_in_end)
__len = __n - __retval;
if (_M_in_cur + __n - __ret <= _M_in_end)
__len = __n - __ret;
else
__len = _M_in_end - _M_in_cur;
traits_type::copy(__s, _M_in_cur, __len);
__retval += __len;
__ret += __len;
__s += __len;
_M_in_cur += __len;
if (_M_buf_unified && __testout)
_M_out_cur += __len;
}
if (__retval != __n)
if (__ret != __n)
{
int_type __c = this->uflow();
if (traits_type::eq_int_type(__c, traits_type::eof()))
break;
traits_type::assign(*__s++, traits_type::to_char_type(__c));
++__retval;
++__ret;
}
}
}
return __retval;
return __ret;
}
// Don't test against _M_buf + _M_buf_size, because _M_buf reflects
@ -167,11 +167,11 @@ namespace std {
basic_streambuf<_CharT, _Traits>::
xsputn(const char_type* __s, streamsize __n)
{
streamsize __retval = 0;
streamsize __ret = 0;
if (__n)
{
while (__retval < __n)
while (__ret < __n)
{
bool __testput = _M_out_cur < _M_out_beg + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
@ -181,28 +181,28 @@ namespace std {
int_type __overfc = this->overflow(__c);
if (traits_type::eq_int_type(__c, __overfc))
{
++__retval;
++__ret;
++__s;
}
else
break;
}
if (__retval != __n)
if (__ret != __n)
{
size_t __len;
if (_M_out_cur + __n - __retval <= _M_out_beg + _M_buf_size)
__len = __n - __retval;
if (_M_out_cur + __n - __ret <= _M_out_beg + _M_buf_size)
__len = __n - __ret;
else
__len = _M_out_beg + _M_buf_size - _M_out_cur;
traits_type::copy(_M_out_cur, __s, __len);
__retval += __len;
__ret += __len;
__s += __len;
_M_out_cur_move(__len);
}
}
}
return __retval;
return __ret;
}
@ -218,7 +218,7 @@ namespace std {
{
typedef typename _Traits::int_type int_type;
streamsize __retval = 0;
streamsize __ret = 0;
streamsize __bufsize = __sbin->in_avail();
streamsize __xtrct;
bool __testout = __sbin->_M_mode & ios_base::out;
@ -227,7 +227,7 @@ namespace std {
while (__testput && __bufsize != -1)
{
__xtrct = __sbout->sputn(__sbin->gptr(), __bufsize);
__retval += __xtrct;
__ret += __xtrct;
__sbin->_M_in_cur += __xtrct;
if (__testout && __sbin->_M_buf_unified)
__sbin->_M_out_cur += __xtrct;
@ -249,7 +249,7 @@ namespace std {
if ((__ios.exceptions() & ios_base::failbit) != 0)
throw;
}
return __retval;
return __ret;
}
} // namespace std

View file

@ -613,16 +613,16 @@ namespace std
find(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
size_type __retval = npos;
size_type __ret = npos;
if (__pos < __size)
{
const _CharT* __data = _M_data();
const _CharT* __end = __data + __size;
const _CharT* __p = _S_find(__data + __pos, __end, __c);
if (__p != __end)
__retval = __p - __data;
__ret = __p - __data;
}
return __retval;
return __ret;
}

View file

@ -37,7 +37,176 @@
namespace std {
__basic_file::__basic_file(__c_lock* __lock)
template<typename _CharT>
int
__basic_file<_CharT>::get_fileno(void)
{ return _fileno; }
template<typename _CharT>
__basic_file<_CharT>::~__basic_file()
{ _IO_file_finish(this, 0); }
template<typename _CharT>
void
__basic_file<_CharT>::_M_open_mode(ios_base::openmode __mode,
int& __p_mode, int& __rw_mode)
{
#ifdef O_BINARY
bool __testb = __mode & ios_base::binary;
#endif
bool __testi = __mode & ios_base::in;
bool __testo = __mode & ios_base::out;
bool __testt = __mode & ios_base::trunc;
bool __testa = __mode & ios_base::app;
if (!__testi && __testo && !__testt && !__testa)
{
__p_mode = O_WRONLY | O_TRUNC | O_CREAT;
__rw_mode = _IO_NO_READS;
}
if (!__testi && __testo && !__testt && __testa)
{
__p_mode = O_WRONLY | O_APPEND | O_CREAT;
__rw_mode = _IO_NO_READS | _IO_IS_APPENDING;
}
if (!__testi && __testo && __testt && !__testa)
{
__p_mode = O_WRONLY | O_TRUNC | O_CREAT;
__rw_mode = _IO_NO_READS;
}
if (__testi && !__testo && !__testt && !__testa)
{
__p_mode = O_RDONLY;
__rw_mode = _IO_NO_WRITES;
}
if (__testi && __testo && !__testt && !__testa)
{
__p_mode = O_RDWR;
__rw_mode = 0;
}
if (__testi && __testo && __testt && !__testa)
{
__p_mode = O_RDWR | O_TRUNC | O_CREAT;
__rw_mode = 0;
}
#ifdef O_BINARY
if (__testb)
__p_mode |= O_BINARY;
#endif
}
template<typename _CharT>
__basic_file<_CharT>*
__basic_file<_CharT>::sys_open(int __fd, ios_base::openmode __mode)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
_M_open_mode(__mode, __p_mode, __rw_mode);
// _IO_file_attach
// sets _IO_DELETE_DONT_CLOSE
// clears _IO_NO_READS + _IO_NO_WRITES
if (_IO_file_attach(this, __fd) != NULL)
{
// Set flags appropriately for openmode...
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_IO_mask_flags(this, __rw_mode, __mask);
}
else
_IO_un_link((_IO_FILE_plus*) this);
return __ret;
}
template<typename _CharT>
__basic_file<_CharT>*
__basic_file<_CharT>::open(const char* __name, ios_base::openmode __mode,
int __prot = 0664)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
_M_open_mode(__mode, __p_mode, __rw_mode);
if (!_IO_file_is_open(this))
{
__c_file_type* __f;
__f = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
__ret = __f ? this: NULL;
}
return __ret;
}
template<typename _CharT>
bool
__basic_file<_CharT>::is_open() { return _fileno >= 0; }
template<typename _CharT>
__basic_file<_CharT>*
__basic_file<_CharT>::close()
{
return _IO_file_close_it(this) ? static_cast<__basic_file*>(NULL) : this;
}
// NB: Unused.
template<typename _CharT>
int
__basic_file<_CharT>::uflow()
{ return _IO_default_uflow(this); }
// NB: Unused.
template<typename _CharT>
int
__basic_file<_CharT>::pbackfail(int __c)
{ return _IO_default_pbackfail(this, __c); }
template<typename _CharT>
streamsize
__basic_file<_CharT>::xsgetn(char* __s, streamsize __n)
{ return _IO_file_xsgetn(this, __s, __n); }
// NB: Unused.
template<typename _CharT>
streamsize
__basic_file<_CharT>::sys_read(char* __s, streamsize __n)
{ return _IO_file_read(this, __s, __n); }
// NB: Unused.
template<typename _CharT>
streamsize
__basic_file<_CharT>::sys_write(const char* __s, streamsize __n)
{ return _IO_file_write(this, __s, __n); }
// NB: Unused.
template<typename _CharT>
streamoff
__basic_file<_CharT>::sys_seek(streamoff __pos, ios_base::seekdir __way)
{ return _IO_file_seek(this, __pos, __way); }
// NB: Unused.
template<typename _CharT>
int
__basic_file<_CharT>::sys_close()
{ return _IO_file_close(this); }
// NB: Unused.
template<typename _CharT>
int
__basic_file<_CharT>::sys_stat(void* __v)
{ return _IO_file_stat(this, __v); }
// NB: Unused.
template<typename _CharT>
int
__basic_file<_CharT>::showmanyc() { return EOF; }
// NB: Unused.
template<typename _CharT>
void
__basic_file<_CharT>::imbue(void* /*__v*/) { }
// __basic_file<char> definitions
__basic_file<char>::__basic_file(__c_lock* __lock)
{
#ifdef _IO_MTSAFE_IO
_lock = __lock;
@ -47,196 +216,94 @@ namespace std {
_IO_file_init((_IO_FILE_plus*)this);
}
int
__basic_file::get_fileno(void)
{ return _fileno; }
__basic_file::~__basic_file()
{ _IO_file_finish(this, 0); }
void
__basic_file::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
int& __rw_mode)
{
#ifdef O_BINARY
bool __testb = __mode & ios_base::binary;
#endif
bool __testi = __mode & ios_base::in;
bool __testo = __mode & ios_base::out;
bool __testt = __mode & ios_base::trunc;
bool __testa = __mode & ios_base::app;
if (!__testi && __testo && !__testt && !__testa)
{
__p_mode = O_WRONLY | O_TRUNC | O_CREAT;
__rw_mode = _IO_NO_READS;
}
if (!__testi && __testo && !__testt && __testa)
{
__p_mode = O_WRONLY | O_APPEND | O_CREAT;
__rw_mode = _IO_NO_READS | _IO_IS_APPENDING;
}
if (!__testi && __testo && __testt && !__testa)
{
__p_mode = O_WRONLY | O_TRUNC | O_CREAT;
__rw_mode = _IO_NO_READS;
}
if (__testi && !__testo && !__testt && !__testa)
{
__p_mode = O_RDONLY;
__rw_mode = _IO_NO_WRITES;
}
if (__testi && __testo && !__testt && !__testa)
{
__p_mode = O_RDWR;
__rw_mode = 0;
}
if (__testi && __testo && __testt && !__testa)
{
__p_mode = O_RDWR | O_TRUNC | O_CREAT;
__rw_mode = 0;
}
#ifdef O_BINARY
if (__testb)
__p_mode |= O_BINARY;
#endif
}
__basic_file*
__basic_file::sys_open(int __fd, ios_base::openmode __mode)
{
__basic_file* __retval = NULL;
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
_M_open_mode(__mode, __p_mode, __rw_mode);
// _IO_file_attach
// sets _IO_DELETE_DONT_CLOSE
// clears _IO_NO_READS + _IO_NO_WRITES
if (_IO_file_attach(this, __fd) != NULL)
{
// Set flags appropriately for openmode...
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_IO_mask_flags(this, __rw_mode, __mask);
}
else
{
_IO_un_link((_IO_FILE_plus*) this);
// XXX Extended error checking?? Note that v2 does not even have this.
}
return __retval;
}
__basic_file*
__basic_file::open(const char* __name, ios_base::openmode __mode,
int __prot = 0664)
{
__basic_file* __retval = NULL;
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
_M_open_mode(__mode, __p_mode, __rw_mode);
if (!_IO_file_is_open(this))
{
//#if _G_HAVE_IO_FILE_OPEN
__c_file_type* __f;
__f = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
// _flags &= ~_IO_DELETE_DONT_CLOSE;
__retval = __f ? this: NULL;
}
return __retval;
}
bool
__basic_file::is_open() { return _fileno >= 0; }
__basic_file*
__basic_file::close()
{ return _IO_file_close_it(this) ? static_cast<__basic_file*>(NULL) : this; }
// NB: Unused.
int
__basic_file::overflow(int __c)
__basic_file<char>::overflow(int __c)
{ return _IO_file_overflow(this, __c); }
// NB: Unused.
int
__basic_file::underflow()
__basic_file<char>::underflow()
{ return _IO_file_underflow(this); }
// NB: Unused.
int
__basic_file::uflow()
{ return _IO_default_uflow(this); }
// NB: Unused.
int
__basic_file::pbackfail(int __c)
{ return _IO_default_pbackfail(this, __c); }
streamsize
__basic_file::xsputn(const char* __s, streamsize __n)
__basic_file<char>::xsputn(const char* __s, streamsize __n)
{ return _IO_file_xsputn(this, __s, __n); }
streamsize
__basic_file::xsgetn(char* __s, streamsize __n)
{ return _IO_file_xsgetn(this, __s, __n); }
streamoff
__basic_file::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode)
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode)
{ return _IO_file_seekoff(this, __off, __way, __mode); }
streamoff
__basic_file::seekpos(streamoff __pos, ios_base::openmode __mode)
__basic_file<char>::seekpos(streamoff __pos, ios_base::openmode __mode)
{ return _IO_file_seekoff(this, __pos, ios_base::beg, __mode); }
// NB: Unused.
// NB: Unused.
streambuf*
__basic_file::setbuf(char* __b, int __len)
__basic_file<char>::setbuf(char* __b, int __len)
{ return (streambuf*) _IO_file_setbuf(this,__b, __len); }
int
__basic_file::sync()
int
__basic_file<char>::sync()
{ return _IO_file_sync(this); }
// NB: Unused.
int
__basic_file::doallocate()
__basic_file<char>::doallocate()
{ return _IO_file_doallocate(this); }
// NB: Unused.
streamsize
__basic_file::sys_read(char* __s, streamsize __n)
{ return _IO_file_read(this, __s, __n); }
template class __basic_file<char>;
// NB: Unused.
streamsize
__basic_file::sys_write(const char* __s, streamsize __n)
{ return _IO_file_write(this, __s, __n); }
// __basic_file<wchar_t> definitions
#ifdef _GLIBCPP_USE_WCHAR_T
__basic_file<wchar_t>::__basic_file(__c_lock* __lock)
{
#ifdef _IO_MTSAFE_IO
_lock = __lock;
#endif
// bkoz this should be -1
// _IO_no_init(this, 0 /* ??? */, 1, 0, 0);
_IO_no_init(this, 0 /* ??? */, -1, 0, 0);
_IO_JUMPS(this) = &_IO_file_jumps;
_IO_file_init((_IO_FILE_plus*)this);
}
// NB: Unused.
streamoff
__basic_file::sys_seek(streamoff __pos, ios_base::seekdir __way)
{ return _IO_file_seek(this, __pos, __way); }
int
__basic_file<wchar_t>::overflow(int __c)
{ return _IO_wfile_overflow(this, __c); }
int
__basic_file<wchar_t>::underflow()
{ return _IO_wfile_underflow(this); }
streamsize
__basic_file<wchar_t>::xsputn(const char* __s, streamsize __n)
{ return _IO_wfile_xsputn(this, __s, __n); }
// NB: Unused.
int
__basic_file::sys_close()
{ return _IO_file_close(this); }
streamoff
__basic_file<wchar_t>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode)
{ return _IO_wfile_seekoff(this, __off, __way, __mode); }
// NB: Unused.
int
__basic_file::sys_stat(void* __v)
{ return _IO_file_stat(this, __v); }
streamoff
__basic_file<wchar_t>::seekpos(streamoff __pos, ios_base::openmode __mode)
{ return _IO_wfile_seekoff(this, __pos, ios_base::beg, __mode); }
// NB: Unused.
int
__basic_file::showmanyc() { return EOF; }
streambuf*
__basic_file<wchar_t>::setbuf(wchar_t* __b, int __len)
{ return (streambuf*) _IO_wfile_setbuf(this,__b, __len); }
// NB: Unused.
void
__basic_file::imbue(void* /*__v*/) { }
int
__basic_file<wchar_t>::sync()
{ return _IO_wfile_sync(this); }
int
__basic_file<wchar_t>::doallocate()
{ return _IO_wfile_doallocate(this); }
template class __basic_file<wchar_t>;
#endif
} // namespace std

2182
libstdc++-v3/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -17,11 +17,11 @@ AC_ARG_WITH(cross-host,
GLIBCPP_CONFIGURE(.)
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
GLIBCPP_CHECK_GNU_MAKE
if test "x$_cv_gnu_make_command" = "x"; then
AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
fi
AM_PROG_LIBTOOL
AM_CONFIG_HEADER(config.h)
# Check for c++ or library specific bits that don't require linking.
@ -185,23 +185,23 @@ then
AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
fi
# Trying to get more people to read documentation. Possibly remove check
# and warn all the time.
# Trying to get more people to read documentation. Possibly remove
# check and warn all the time. There is no "informational" AC_MSG_
# macro, so these are going to be printed even when --quiet/--silent
# is given.
if test ! -f stamp-sanity-warned; then
touch stamp-sanity-warned
# There is no "informational" AC_MSG_ macro, so these are going to be
# printed even when --quiet/--silent is given.
echo ''
echo 'Please make certain that you read the installation information here:'
echo ""
echo "Please make certain that you read the installation information here:"
echo " faster => ${srcdir}/docs/install.html"
echo ' slower => <URL:http://sources.redhat.com/libstdc++/install.html>'
echo ''
echo 'and the configuration information here:'
echo " slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
echo ""
echo "and the configuration information here:"
echo " faster => ${srcdir}/docs/configopts.html"
echo ' slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>'
echo ''
echo 'before proceeding with "make".'
echo ''
echo " slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
echo ""
echo "before proceeding with make."
echo ""
fi

View file

@ -271,10 +271,10 @@ namespace std {
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 49. Underspecification of ios_base::sync_with_stdio
bool __retval = __ioinit._M_cin->_M_file->get_fileno() == 0;
bool __ret = __ioinit._M_cin->_M_file->get_fileno() == 0;
// Turn off sync with C FILE* for cin, cout, cerr, clog.
if (!__sync && __retval)
if (!__sync && __ret)
{
// Need to dispose of the buffers created at initialization.
__ioinit._M_cout->~filebuf();
@ -309,7 +309,7 @@ namespace std {
#endif
}
return __retval;
return __ret;
#endif
}

View file

@ -209,8 +209,8 @@ namespace std
const char*
string::_S_find(const char* __beg, const char* __end, char __c)
{
const char* __retval = strchr(__beg, __c);
return (__retval ? __retval : __end);
const char* __ret = strchr(__beg, __c);
return (__ret ? __ret : __end);
}
#else
template<>