mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 10:54:07 +08:00
[multiple changes]
2000-07-23 Brent Verner <brent@rcfile.org> * bits/istream.tcc: istream::getline(char_type*, streamsize, char_type) make compliant * testsuite/27_io/istream_unformatted.cc: test for compliant behavior 2000-07-23 Benjamin Kosnik <bkoz@haight.constant.com> * acinclude.m4 (enable_cshadow_headers): Fix problems with blddir and srcdir used to define CSHADOW_INCLUDES.. * configure.in: For consistency, change .sanity_warned to stamp-sanity-warned. * acinclude.m4: Tweak formatting. * Makefile.am (check): Call mkcheck with full pathname for build directory... (check-install): And here. * Makefile.in: Regenerate. From-SVN: r35227
This commit is contained in:
parent
55d3f91712
commit
99b5135954
@ -1,3 +1,23 @@
|
||||
2000-07-23 Brent Verner <brent@rcfile.org>
|
||||
|
||||
* bits/istream.tcc: istream::getline(char_type*, streamsize,
|
||||
char_type) make compliant
|
||||
* testsuite/27_io/istream_unformatted.cc: test for compliant behavior
|
||||
|
||||
2000-07-23 Benjamin Kosnik <bkoz@haight.constant.com>
|
||||
|
||||
* acinclude.m4 (enable_cshadow_headers): Fix problems with blddir
|
||||
and srcdir used to define CSHADOW_INCLUDES..
|
||||
|
||||
* configure.in: For consistency, change .sanity_warned to
|
||||
stamp-sanity-warned.
|
||||
|
||||
* acinclude.m4: Tweak formatting.
|
||||
* Makefile.am (check): Call mkcheck with full pathname for build
|
||||
directory...
|
||||
(check-install): And here.
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2000-07-22 Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
Line up with libstdc++-v2 version of valarray.
|
||||
|
@ -31,13 +31,16 @@ gxx_include_dir=$(includedir)/g++
|
||||
|
||||
SUBDIRS = math libio src
|
||||
|
||||
# Use $(blddir) instead of $(top_builddir) for arguments to "mkcheck"
|
||||
# because then the paths will be full pathnames, not relative
|
||||
# pathnames. (-Wl,--rpath seems to like this better.)
|
||||
check: $(top_builddir)/mkcheck
|
||||
chmod +x $(top_builddir)/mkcheck
|
||||
$(top_builddir)/mkcheck 0 $(top_builddir) $(top_srcdir)
|
||||
$(top_builddir)/mkcheck 0 `pwd` $(top_srcdir)
|
||||
|
||||
check-install: $(top_builddir)/mkcheck
|
||||
chmod +x $(top_builddir)/mkcheck
|
||||
$(top_builddir)/mkcheck 1 $(top_builddir) $(top_srcdir) $(prefix)
|
||||
$(top_builddir)/mkcheck 1 `pwd` $(top_srcdir) $(prefix)
|
||||
|
||||
#all-local: stamp-rebuild
|
||||
|
||||
|
@ -65,12 +65,10 @@ target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
BUILD_LIBIO_INCLUDE = @BUILD_LIBIO_INCLUDE@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CPU_FLAGS = @CPU_FLAGS@
|
||||
CSHADOWFLAGS = @CSHADOWFLAGS@
|
||||
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
@ -465,13 +463,16 @@ distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Use $(blddir) instead of $(top_builddir) for arguments to "mkcheck"
|
||||
# because then the paths will be full pathnames, not relative
|
||||
# pathnames. (-Wl,--rpath seems to like this better.)
|
||||
check: $(top_builddir)/mkcheck
|
||||
chmod +x $(top_builddir)/mkcheck
|
||||
$(top_builddir)/mkcheck 0 $(top_builddir) $(top_srcdir)
|
||||
$(top_builddir)/mkcheck 0 `pwd` $(top_srcdir)
|
||||
|
||||
check-install: $(top_builddir)/mkcheck
|
||||
chmod +x $(top_builddir)/mkcheck
|
||||
$(top_builddir)/mkcheck 1 $(top_builddir) $(top_srcdir) $(prefix)
|
||||
$(top_builddir)/mkcheck 1 `pwd` $(top_srcdir) $(prefix)
|
||||
|
||||
# Multilib Makefile bits.
|
||||
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
|
||||
|
@ -1196,12 +1196,10 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
esac
|
||||
|
||||
if test x$glibc_satisfactory = x"yes"; then
|
||||
BUILD_LIBIO_INCLUDE=
|
||||
need_libio=no
|
||||
need_xtra_libio=no
|
||||
need_wlibio=no
|
||||
else
|
||||
BUILD_LIBIO_INCLUDE='-I../libio'
|
||||
need_libio=yes
|
||||
need_xtra_libio=yes
|
||||
# bkoz XXX need to add checks to enable this
|
||||
@ -1210,7 +1208,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
|
||||
# Using libio, but <libio.h> doesn't exist on the target system. . .
|
||||
else
|
||||
BUILD_LIBIO_INCLUDE='-I../libio'
|
||||
need_libio=yes
|
||||
need_xtra_libio=no
|
||||
# bkoz XXX need to add checks to enable this
|
||||
@ -1224,8 +1221,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
AC_MSG_RESULT(wince)
|
||||
|
||||
need_libio=no
|
||||
BUILD_LIBIO_INCLUDE=
|
||||
AC_SUBST(BUILD_LIBIO_INCLUDE)
|
||||
;;
|
||||
*)
|
||||
echo "$enable_cstdio is an unknown io package" 1>&2
|
||||
@ -1406,19 +1401,17 @@ changequote([, ])dnl
|
||||
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
|
||||
yes)
|
||||
CSHADOWFLAGS="-D_GNU_SOURCE"
|
||||
CSHADOW_INCLUDES=" -I$srcdir/shadow -I$blddir/cshadow"
|
||||
CSHADOWFLAGS=""
|
||||
;;
|
||||
no)
|
||||
CSHADOWFLAGS=""
|
||||
CSHADOW_INCLUDES=""
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CSHADOWFLAGS)
|
||||
AC_SUBST(CSHADOW_INCLUDES)
|
||||
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
|
||||
])
|
||||
|
||||
@ -1480,7 +1473,7 @@ AC_SUBST(LIBSTRINGOBJS)dnl
|
||||
|
||||
dnl This macro searches for a GNU version of make. If a match is found, the
|
||||
dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
|
||||
dnl set to "#". This is useful for including a special features in a Makefile,
|
||||
dnl set to "#". This is useful for including a special features in a Makefile,
|
||||
dnl which cannot be handled by other versions of make. The variable
|
||||
dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
|
||||
dnl the empty string otherwise.
|
||||
@ -1515,7 +1508,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.44 2000/07/21 01:02:31 bkoz Exp $
|
||||
dnl @version $Id: acinclude.m4,v 1.45 2000/07/21 20:59:23 gdr Exp $
|
||||
dnl
|
||||
dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
|
||||
dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
|
||||
|
15
libstdc++-v3/aclocal.m4
vendored
15
libstdc++-v3/aclocal.m4
vendored
@ -1208,12 +1208,10 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
esac
|
||||
|
||||
if test x$glibc_satisfactory = x"yes"; then
|
||||
BUILD_LIBIO_INCLUDE=
|
||||
need_libio=no
|
||||
need_xtra_libio=no
|
||||
need_wlibio=no
|
||||
else
|
||||
BUILD_LIBIO_INCLUDE='-I../libio'
|
||||
need_libio=yes
|
||||
need_xtra_libio=yes
|
||||
# bkoz XXX need to add checks to enable this
|
||||
@ -1222,7 +1220,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
|
||||
# Using libio, but <libio.h> doesn't exist on the target system. . .
|
||||
else
|
||||
BUILD_LIBIO_INCLUDE='-I../libio'
|
||||
need_libio=yes
|
||||
need_xtra_libio=no
|
||||
# bkoz XXX need to add checks to enable this
|
||||
@ -1236,8 +1233,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
||||
AC_MSG_RESULT(wince)
|
||||
|
||||
need_libio=no
|
||||
BUILD_LIBIO_INCLUDE=
|
||||
AC_SUBST(BUILD_LIBIO_INCLUDE)
|
||||
;;
|
||||
*)
|
||||
echo "$enable_cstdio is an unknown io package" 1>&2
|
||||
@ -1418,19 +1413,17 @@ changequote([, ])dnl
|
||||
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
|
||||
yes)
|
||||
CSHADOWFLAGS="-D_GNU_SOURCE"
|
||||
CSHADOW_INCLUDES=" -I$srcdir/shadow -I$blddir/cshadow"
|
||||
CSHADOWFLAGS=""
|
||||
;;
|
||||
no)
|
||||
CSHADOWFLAGS=""
|
||||
CSHADOW_INCLUDES=""
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CSHADOWFLAGS)
|
||||
AC_SUBST(CSHADOW_INCLUDES)
|
||||
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
|
||||
])
|
||||
|
||||
@ -1492,7 +1485,7 @@ AC_SUBST(LIBSTRINGOBJS)dnl
|
||||
|
||||
dnl This macro searches for a GNU version of make. If a match is found, the
|
||||
dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
|
||||
dnl set to "#". This is useful for including a special features in a Makefile,
|
||||
dnl set to "#". This is useful for including a special features in a Makefile,
|
||||
dnl which cannot be handled by other versions of make. The variable
|
||||
dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
|
||||
dnl the empty string otherwise.
|
||||
@ -1527,7 +1520,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: aclocal.m4,v 1.45 2000/07/21 01:02:31 bkoz Exp $
|
||||
dnl @version $Id: acinclude.m4,v 1.45 2000/07/21 20:59:23 gdr Exp $
|
||||
dnl
|
||||
dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
|
||||
dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
|
||||
|
@ -590,9 +590,7 @@ namespace std {
|
||||
bool __testput = true;
|
||||
streamsize __n = __this_sb->in_avail();
|
||||
|
||||
while (_M_gcount <= __n
|
||||
&& !__testeof
|
||||
&& !__testdelim
|
||||
while (_M_gcount <= __n && !__testeof && !__testdelim
|
||||
&& (__testput = __sb.sputc(traits_type::to_char_type(__c))
|
||||
!= __eof))
|
||||
{
|
||||
@ -625,50 +623,30 @@ namespace std {
|
||||
sentry __cerb(*this, true);
|
||||
if (__cerb)
|
||||
{
|
||||
try {
|
||||
const int_type __idelim = traits_type::to_int_type(__delim);
|
||||
const int_type __eof = traits_type::eof();
|
||||
try {
|
||||
__streambuf_type* __sb = this->rdbuf();
|
||||
bool __testdelim = false;
|
||||
bool __testeof = false;
|
||||
|
||||
// This is completely idiotic, but attempts to recreate
|
||||
// the smoke-filled air of the committee meeting where
|
||||
// getline was defined. It's unspecified for __n == 1,
|
||||
// what happens to the extracted char if it is not a
|
||||
// delimiter or EOF. Assume it's not extracted, for the
|
||||
// time being. . .
|
||||
if (__n == 1)
|
||||
int_type __c = __sb->sbumpc();
|
||||
const int_type __idelim = traits_type::to_int_type(__delim);
|
||||
const int_type __eof = traits_type::eof();
|
||||
bool __testdelim = __c == __idelim;
|
||||
bool __testeof = __c == __eof;
|
||||
|
||||
while (++_M_gcount < __n && !__testeof && !__testdelim)
|
||||
{
|
||||
int_type __c = __sb->sgetc();
|
||||
__testdelim = __c == __idelim;
|
||||
*__s++ = traits_type::to_char_type(__c);
|
||||
__c = __sb->sbumpc();
|
||||
__testeof = __c == __eof;
|
||||
if (__testdelim)
|
||||
{
|
||||
++_M_gcount;
|
||||
__sb->sbumpc();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (_M_gcount < __n - 1 && !__testdelim && !__testeof)
|
||||
{
|
||||
int_type __c = __sb->sbumpc();
|
||||
__testdelim = __c == __idelim;
|
||||
__testeof = __c == __eof;
|
||||
if (__testdelim)
|
||||
++_M_gcount;
|
||||
else if (!__testeof)
|
||||
{
|
||||
*__s++ = traits_type::to_char_type(__c);
|
||||
++_M_gcount;
|
||||
}
|
||||
}
|
||||
__testdelim = __c == __idelim;
|
||||
}
|
||||
|
||||
if (__testeof)
|
||||
this->setstate(ios_base::eofbit);
|
||||
else if (!__testdelim && _M_gcount == __n - 1)
|
||||
this->setstate(ios_base::failbit);
|
||||
else if (!__testdelim)
|
||||
{
|
||||
--_M_gcount;
|
||||
__sb->sputbackc(traits_type::to_char_type(__c));
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
}
|
||||
catch(exception& __fail){
|
||||
// 27.6.1.3 paragraph 1
|
||||
|
1855
libstdc++-v3/configure
vendored
1855
libstdc++-v3/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@ GLIBCPP_CONFIGURE(.)
|
||||
AC_LIBTOOL_DLOPEN
|
||||
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.])
|
||||
AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
|
||||
fi
|
||||
AM_PROG_LIBTOOL
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
@ -187,8 +187,8 @@ fi
|
||||
|
||||
# Trying to get more people to read documentation. Possibly remove check
|
||||
# and warn all the time.
|
||||
if test ! -f .sanity_warned; then
|
||||
touch .sanity_warned
|
||||
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 ''
|
||||
|
@ -26,9 +26,12 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
# Passed down for cross compilers, canadian crosses.
|
||||
TOPLEVEL_INCLUDES = -I$(includedir)
|
||||
|
||||
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
|
||||
|
||||
CSHADOW_INCLUDES = @CSHADOWFLAGS@ @CSHADOW_INCLUDES@
|
||||
if GLIBCPP_NEED_LIBIO
|
||||
LIBIO_INCLUDES = \
|
||||
-I$(top_builddir)/libio -I$(top_srcdir)/libio
|
||||
else
|
||||
LIBIO_INCLUDES =
|
||||
endif
|
||||
|
||||
CONFIG_INCLUDES = \
|
||||
-I$(top_srcdir)/@cpu_include_dir@ \
|
||||
@ -36,7 +39,7 @@ CONFIG_INCLUDES = \
|
||||
|
||||
INCLUDES = \
|
||||
-nostdinc++ -I$(top_srcdir) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) \
|
||||
$(TOPLEVEL_INCLUDES)
|
||||
|
||||
noinst_LTLIBRARIES = libio.la
|
||||
|
@ -65,7 +65,6 @@ target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
BUILD_LIBIO_INCLUDE = @BUILD_LIBIO_INCLUDE@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CPU_FLAGS = @CPU_FLAGS@
|
||||
@ -109,10 +108,9 @@ AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
|
||||
# Passed down for cross compilers, canadian crosses.
|
||||
TOPLEVEL_INCLUDES = -I$(includedir)
|
||||
|
||||
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
|
||||
|
||||
CSHADOW_INCLUDES = @CSHADOWFLAGS@ @CSHADOW_INCLUDES@
|
||||
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_INCLUDES = @GLIBCPP_NEED_LIBIO_TRUE@\
|
||||
@GLIBCPP_NEED_LIBIO_TRUE@ -I$(top_builddir)/libio -I$(top_srcdir)/libio
|
||||
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_INCLUDES =
|
||||
|
||||
CONFIG_INCLUDES = \
|
||||
-I$(top_srcdir)/@cpu_include_dir@ \
|
||||
@ -121,7 +119,7 @@ CONFIG_INCLUDES = \
|
||||
|
||||
INCLUDES = \
|
||||
-nostdinc++ -I$(top_srcdir) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) \
|
||||
$(TOPLEVEL_INCLUDES)
|
||||
|
||||
|
||||
|
@ -65,12 +65,10 @@ target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
BUILD_LIBIO_INCLUDE = @BUILD_LIBIO_INCLUDE@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CPU_FLAGS = @CPU_FLAGS@
|
||||
CSHADOWFLAGS = @CSHADOWFLAGS@
|
||||
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
|
@ -52,7 +52,7 @@ AC_CXXFLAGS = \
|
||||
# the end of the compile line so that -O2 can be overridden as the
|
||||
# occasion call for it. (ie, --enable-debug)
|
||||
AM_CXXFLAGS = \
|
||||
-D_GNU_SOURCE -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
|
||||
-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
|
||||
-Wall -Wno-format -W -Wwrite-strings -Winline \
|
||||
$(AC_CXXFLAGS)
|
||||
|
||||
@ -60,18 +60,29 @@ AM_CXXFLAGS = \
|
||||
# Passed down for cross compilers, canadian crosses.
|
||||
TOPLEVEL_INCLUDES = -I$(includedir)
|
||||
|
||||
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
|
||||
if GLIBCPP_NEED_LIBIO
|
||||
LIBIO_INCLUDES = \
|
||||
-I$(top_builddir)/libio -I$(top_srcdir)/libio
|
||||
else
|
||||
LIBIO_INCLUDES =
|
||||
endif
|
||||
|
||||
CSHADOW_INCLUDES = @CSHADOWFLAGS@ @CSHADOW_INCLUDES@
|
||||
if GLIBCPP_USE_CSHADOW
|
||||
CSHADOW_INCLUDES =
|
||||
#CSHADOW_INCLUDES = \
|
||||
# @CSHADOWFLAGS@ -I$(top_srcdir)/shadow -I$(top_builddir)/cshadow
|
||||
else
|
||||
CSHADOW_INCLUDES =
|
||||
endif
|
||||
|
||||
CONFIG_INCLUDES = \
|
||||
-I$(top_srcdir)/@cpu_include_dir@ \
|
||||
-I$(top_srcdir)/@ctype_include_dir@
|
||||
|
||||
INCLUDES = \
|
||||
-nostdinc++ -I$(top_srcdir) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
|
||||
$(TOPLEVEL_INCLUDES)
|
||||
-D_GNU_SOURCE -nostdinc++ -I$(top_srcdir) \
|
||||
$(CSHADOW_INCLUDES) $(LIBIO_INCLUDES) \
|
||||
$(CONFIG_INCLUDES) $(TOPLEVEL_INCLUDES)
|
||||
|
||||
|
||||
# Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
|
||||
|
@ -64,7 +64,6 @@ target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
BUILD_LIBIO_INCLUDE = @BUILD_LIBIO_INCLUDE@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
CPU_FLAGS = @CPU_FLAGS@
|
||||
@ -129,17 +128,20 @@ AC_CXXFLAGS = \
|
||||
# the end of the compile line so that -O2 can be overridden as the
|
||||
# occasion call for it. (ie, --enable-debug)
|
||||
AM_CXXFLAGS = \
|
||||
-D_GNU_SOURCE -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
|
||||
-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
|
||||
-Wall -Wno-format -W -Wwrite-strings -Winline \
|
||||
$(AC_CXXFLAGS)
|
||||
|
||||
|
||||
# Passed down for cross compilers, canadian crosses.
|
||||
TOPLEVEL_INCLUDES = -I$(includedir)
|
||||
|
||||
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
|
||||
|
||||
CSHADOW_INCLUDES = @CSHADOWFLAGS@ @CSHADOW_INCLUDES@
|
||||
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_INCLUDES = @GLIBCPP_NEED_LIBIO_TRUE@\
|
||||
@GLIBCPP_NEED_LIBIO_TRUE@ -I$(top_builddir)/libio -I$(top_srcdir)/libio
|
||||
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_INCLUDES =
|
||||
#CSHADOW_INCLUDES = \
|
||||
# @CSHADOWFLAGS@ -I$(top_srcdir)/shadow -I$(top_builddir)/cshadow
|
||||
@GLIBCPP_USE_CSHADOW_TRUE@CSHADOW_INCLUDES =
|
||||
@GLIBCPP_USE_CSHADOW_FALSE@CSHADOW_INCLUDES =
|
||||
|
||||
CONFIG_INCLUDES = \
|
||||
-I$(top_srcdir)/@cpu_include_dir@ \
|
||||
@ -147,9 +149,9 @@ CONFIG_INCLUDES = \
|
||||
|
||||
|
||||
INCLUDES = \
|
||||
-nostdinc++ -I$(top_srcdir) \
|
||||
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
|
||||
$(TOPLEVEL_INCLUDES)
|
||||
-D_GNU_SOURCE -nostdinc++ -I$(top_srcdir) \
|
||||
$(CSHADOW_INCLUDES) $(LIBIO_INCLUDES) \
|
||||
$(CONFIG_INCLUDES) $(TOPLEVEL_INCLUDES)
|
||||
|
||||
|
||||
# Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
|
||||
|
@ -163,11 +163,13 @@ bool test02(void)
|
||||
// istream& getline(char* s, streamsize n)
|
||||
state1 = is_00.rdstate();
|
||||
is_00.getline(carray1, 20, '*');
|
||||
state2 = is_00.rdstate();
|
||||
test &= is_04.gcount() == 0;
|
||||
state2 = is_00.rdstate();
|
||||
// make sure failbit was set, since we couldn't extract
|
||||
// from the NULL streambuf...
|
||||
test &= state1 != state2;
|
||||
test &= bool(state2 & statefail);
|
||||
|
||||
test &= static_cast<bool>(state2 & statefail);
|
||||
|
||||
test &= is_04.gcount() == 0;
|
||||
state1 = is_04.rdstate();
|
||||
is_04.getline(carray1, 1, '\t'); // extracts, throws away
|
||||
state2 = is_04.rdstate();
|
||||
@ -351,7 +353,6 @@ void test04()
|
||||
// http://sourceware.cygnus.com/ml/libstdc++/2000-07/msg00003.html
|
||||
bool test05()
|
||||
{
|
||||
|
||||
const char* charray = "
|
||||
a
|
||||
aa
|
||||
@ -383,7 +384,7 @@ aaaaaaaaaaaaaa
|
||||
if(ifs.eof())
|
||||
{
|
||||
// Just sanity checks to make sure we've extracted the same
|
||||
// number of chars that were in the file.
|
||||
// number of chars that were in the streambuf
|
||||
VERIFY(br == blen);
|
||||
// Also, we should only set the failbit if we could
|
||||
// _extract_ no chars from the stream, i.e. the first read
|
||||
@ -392,21 +393,24 @@ aaaaaaaaaaaaaa
|
||||
}
|
||||
else if(ifs.fail())
|
||||
{
|
||||
// delimiter not read
|
||||
//
|
||||
// either
|
||||
// -> extracted no characters
|
||||
// or
|
||||
// -> n - 1 characters are stored
|
||||
VERIFY(strlen(tmp) == it - 1);
|
||||
ifs.clear(ifs.rdstate() & ~std::ios::failbit);
|
||||
VERIFY((ifs.gcount() == 0) || (strlen(tmp) == it - 1));
|
||||
VERIFY(ifs);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// delimiter was read.
|
||||
//
|
||||
// -> strlen(__s) < n - 1
|
||||
// -> delimiter was seen -> gcount() > strlen(__s)
|
||||
VERIFY(ifs.gcount() > strlen(tmp));
|
||||
VERIFY(it - 1 > strlen(tmp));
|
||||
VERIFY(ifs.gcount() == strlen(tmp) + 1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -414,6 +418,39 @@ aaaaaaaaaaaaaa
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// http://sources.redhat.com/ml/libstdc++/2000-07/msg00126.html
|
||||
bool
|
||||
test06()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
bool test = true;
|
||||
const streamsize it = 5;
|
||||
char tmp[it];
|
||||
const char* str_lit = "abcd\n";
|
||||
|
||||
stringbuf strbuf(str_lit, std::ios_base::in);
|
||||
istream istr(&strbuf);
|
||||
|
||||
istr.getline(tmp,it);
|
||||
test &= istr.gcount() == it; // extracted whole string
|
||||
test &= strlen(tmp) == 4; // stored all but '\n'
|
||||
test &= !istr.eof(); // extracted up to but not eof
|
||||
test &= !istr.fail(); // failbit not set
|
||||
|
||||
char c = 'z';
|
||||
istr.get(c);
|
||||
test &= c == 'z';
|
||||
test &= istr.eof();
|
||||
|
||||
#ifdef DEBUG_ASSERT
|
||||
assert(test);
|
||||
#endif
|
||||
return test;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
@ -421,6 +458,7 @@ int main()
|
||||
test03();
|
||||
test04();
|
||||
test05();
|
||||
test06();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -431,3 +469,4 @@ int main()
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user