Commit dd75251f by Benjamin Kosnik

acinclude.m4: Tweaks.


2000-07-18  Benjamin Kosnik  <bkoz@soma.redhat.com>

	* acinclude.m4: Tweaks.
	* config/c_io_libio.cc: Tweaks.
	* bits/sstream.tcc (stringbuf::pbackfail): Simplify.
	* libio/_G_config.h: Don't define _G_HAVE_ST_BLKSIZE.
	* libio/[iofwide.c, wfiledoalloc.c, wfiteopos.c, wgenops.c]: New files.
	* libio/iofclose.c iofopen.c, stdio.c: New files.
	* libio/Makefile.am: Add files, add flags, etc.
	* src/Makefile.am (sources): Add filebuf.cc.
	* acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT):
	(GLIBCPP_ENABLE_CSTDIO): Versioning testing, etc etc.

From-SVN: r35127
parent a0add193
2000-07-18 Benjamin Kosnik <bkoz@soma.redhat.com>
* acinclude.m4: Tweaks.
* config/c_io_libio.cc: Tweaks.
* bits/sstream.tcc (stringbuf::pbackfail): Simplify.
* libio/_G_config.h: Don't define _G_HAVE_ST_BLKSIZE.
* libio/[iofwide.c, wfiledoalloc.c, wfiteopos.c, wgenops.c]: New files.
* libio/iofclose.c iofopen.c, stdio.c: New files.
* libio/Makefile.am: Add files, add flags, etc.
* src/Makefile.am (sources): Add filebuf.cc.
* acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT):
(GLIBCPP_ENABLE_CSTDIO): Versioning testing, etc etc.
2000-07-17 Phil Edwards <pme@sourceware.cygnus.com>
* acinclude.m4: Import CHECK_GNU_MAKE from autoconf macro archive.
......
......@@ -103,6 +103,7 @@ WFMT_FLAGS = @WFMT_FLAGS@
cpu_include_dir = @cpu_include_dir@
ctype_include_dir = @ctype_include_dir@
glibcpp_basedir = @glibcpp_basedir@
ifGNUmake = @ifGNUmake@
libinst_wstring_la = @libinst_wstring_la@
AUTOMAKE_OPTIONS = 1.3 cygnus
......
......@@ -930,6 +930,10 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
dnl 2000-07-07-bkoz-hack-xxx
# ac_isoC9X_wchar_t=no
dnl 2000-07-07-bkoz-hack-xxx
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
......@@ -1165,54 +1169,72 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
dnl Check if a valid thread package
case x${enable_cstdio_flag} in
xlibio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_libio.h
CSTDIO_CC=config/c_io_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
# bkoz XXX hack hack need version checks, this is temporary
has_libio=no
if test $has_libio = "yes"; then
BUILD_LIBIO_INCLUDE=
need_libio=no
else
BUILD_LIBIO_INCLUDE='-I../libio'
need_libio=yes
fi
AC_SUBST(BUILD_LIBIO_INCLUDE)
# see if the _G_config.h header needs to be built.
# NB: This replaces the _G_CONFIG_H machinery in libio-v2
AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no)
# bkoz XXX hack need to add support for non-glibc systems here
has_gconf=no
# bkoz XXX need to add checks for this
need_wlibio=yes
;;
xwince)
CSTDIO_H=config/c_io_wince.h
CSTDIO_CC=config/c_io_wince.cc
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
exit 1
;;
xlibio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_libio.h
CSTDIO_CC=config/c_io_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
# Need to check and see what version of glibc is being used. If
# it's not glibc-2.2 or higher, then we'll need to go ahead and
# compile most of libio for linux systems.
if test x$has_libio = x"yes"; then
case "$target" in
*-*-linux*)
AC_MSG_CHECKING([for glibc version >= 2.2])
AC_EGREP_CPP([ok], [
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
ok
#endif
], glibc_satisfactory=yes, glibc_satisfactory=no)
AC_MSG_RESULT($glibc_satisfactory)
;;
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
need_wlibio=yes
fi
# 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
need_wlibio=no
fi
;;
xwince)
CSTDIO_H=config/c_io_wince.h
CSTDIO_CC=config/c_io_wince.cc
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
exit 1
;;
esac
AC_LINK_FILES($CSTDIO_H, bits/c++io.h)
AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
])
......@@ -1492,7 +1514,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: check_gnu_make.m4,v 1.1 2000/06/15 10:49:36 simons Exp $
dnl @version $Id: acinclude.m4,v 1.42 2000/07/17 18:17:33 pme Exp $
dnl
dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
......
......@@ -942,6 +942,10 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
dnl 2000-07-07-bkoz-hack-xxx
# ac_isoC9X_wchar_t=no
dnl 2000-07-07-bkoz-hack-xxx
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
......@@ -1177,54 +1181,72 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
dnl Check if a valid thread package
case x${enable_cstdio_flag} in
xlibio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_libio.h
CSTDIO_CC=config/c_io_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
# bkoz XXX hack hack need version checks, this is temporary
has_libio=no
if test $has_libio = "yes"; then
BUILD_LIBIO_INCLUDE=
need_libio=no
else
BUILD_LIBIO_INCLUDE='-I../libio'
need_libio=yes
fi
AC_SUBST(BUILD_LIBIO_INCLUDE)
# see if the _G_config.h header needs to be built.
# NB: This replaces the _G_CONFIG_H machinery in libio-v2
AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no)
# bkoz XXX hack need to add support for non-glibc systems here
has_gconf=no
# bkoz XXX need to add checks for this
need_wlibio=yes
;;
xwince)
CSTDIO_H=config/c_io_wince.h
CSTDIO_CC=config/c_io_wince.cc
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
exit 1
;;
xlibio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_libio.h
CSTDIO_CC=config/c_io_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
# Need to check and see what version of glibc is being used. If
# it's not glibc-2.2 or higher, then we'll need to go ahead and
# compile most of libio for linux systems.
if test x$has_libio = x"yes"; then
case "$target" in
*-*-linux*)
AC_MSG_CHECKING([for glibc version >= 2.2])
AC_EGREP_CPP([ok], [
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
ok
#endif
], glibc_satisfactory=yes, glibc_satisfactory=no)
AC_MSG_RESULT($glibc_satisfactory)
;;
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
need_wlibio=yes
fi
# 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
need_wlibio=no
fi
;;
xwince)
CSTDIO_H=config/c_io_wince.h
CSTDIO_CC=config/c_io_wince.cc
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
exit 1
;;
esac
AC_LINK_FILES($CSTDIO_H, bits/c++io.h)
AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
])
......@@ -1504,7 +1526,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: check_gnu_make.m4,v 1.1 2000/06/15 10:49:36 simons Exp $
dnl @version $Id: acinclude.m4,v 1.42 2000/07/17 18:17:33 pme Exp $
dnl
dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
......
......@@ -49,22 +49,25 @@ namespace std {
// Try to put back __c into input sequence in one of three ways.
// Order these tests done in is unspecified by the standard.
if (!__testeof && __testpos
&& traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1]))
if (__testpos)
{
--_M_in_cur;
__retval = __c;
}
else if (!__testeof && __testpos)
{
--_M_in_cur;
*_M_in_cur = traits_type::to_char_type(__c);
__retval = __c;
}
else if (__testeof && __testpos)
{
--_M_in_cur;
__retval = traits_type::not_eof(__c);
if (traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1])
&& !__testeof)
{
--_M_in_cur;
__retval = __c;
}
else if (!__testeof)
{
--_M_in_cur;
*_M_in_cur = traits_type::to_char_type(__c);
__retval = __c;
}
else if (__testeof)
{
--_M_in_cur;
__retval = traits_type::not_eof(__c);
}
}
return __retval;
}
......
......@@ -48,10 +48,11 @@ namespace std {
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
// Non-standard Types:
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
......@@ -69,7 +70,7 @@ namespace std {
__state_type _M_state_cur;// Current state type for codecvt.
__state_type _M_state_beg;
const __codecvt_type* _M_fcvt; // Cached value from use_facet.
__mutext_type _M_lock;
__c_lock _M_lock;
bool _M_last_overflowed; // XXX Needed?
public:
......
......@@ -39,10 +39,12 @@ namespace std {
__basic_file::__basic_file(__c_lock* __lock)
{
#ifdef _IO_MTSAFE_IO
_lock = __lock;
_IO_init(this, 0);
_IO_file_init((_IO_FILE_plus*) this);
_IO_file_attach(this, -1);
#endif
_IO_no_init(this, 0 /* ??? */, -1, 0, 0);
_IO_JUMPS(this) = &_IO_file_jumps;
_IO_file_init((_IO_FILE_plus*)this);
}
int
......@@ -50,15 +52,7 @@ namespace std {
{ return _fileno; }
__basic_file::~__basic_file()
{
if (this->is_open())
{
_IO_do_flush(this);
if (!(_flags & _IO_DELETE_DONT_CLOSE))
_IO_SYSCLOSE((_IO_FILE*)this);
}
_IO_default_finish(this, 0);
}
{ _IO_file_finish(this, 0); }
void
__basic_file::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
......@@ -116,13 +110,19 @@ namespace std {
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
_M_open_mode(__mode, __p_mode, __rw_mode);
if (__fd >= 0)
// _IO_file_attach
// sets _IO_DELETE_DONT_CLOSE
// clears _IO_NO_READS + _IO_NO_WRITES
if (_IO_file_attach(this, __fd) != NULL)
{
_fileno = __fd;
// Set flags appropriately for openmode...
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_flags = (_flags & ~__mask) | (__rw_mode & __mask);
_IO_link_in((_IO_FILE_plus*) this);
__retval = this;
_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;
}
......@@ -138,22 +138,11 @@ namespace std {
_M_open_mode(__mode, __p_mode, __rw_mode);
if (!_IO_file_is_open(this))
{
#if _G_HAVE_IO_FILE_OPEN
//#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;
// _flags &= ~_IO_DELETE_DONT_CLOSE;
__retval = __f ? this: NULL;
#else
int __fd = ::open(__name, __p_mode, __prot);
if (__fd >= 0)
{
_fileno = __fd;
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_flags = (_flags & ~__mask) | (__rw_mode & __mask);
_IO_link_in(this);
__retval = this;
}
#endif
}
return __retval;
}
......@@ -167,15 +156,18 @@ namespace std {
// NB: Unused.
int
__basic_file::overflow(int __c) { return _IO_file_overflow(this, __c); }
__basic_file::overflow(int __c)
{ return _IO_file_overflow(this, __c); }
// NB: Unused.
int
__basic_file::underflow() { return _IO_file_underflow(this); }
__basic_file::underflow()
{ return _IO_file_underflow(this); }
// NB: Unused.
int
__basic_file::uflow() { return _IO_default_uflow(this); }
__basic_file::uflow()
{ return _IO_default_uflow(this); }
// NB: Unused.
int
......@@ -188,7 +180,7 @@ namespace std {
streamsize
__basic_file::xsgetn(char* __s, streamsize __n)
{ return _IO_default_xsgetn(this, __s, __n); }
{ return _IO_file_xsgetn(this, __s, __n); }
streamoff
__basic_file::seekoff(streamoff __off, ios_base::seekdir __way,
......@@ -230,11 +222,13 @@ namespace std {
// NB: Unused.
int
__basic_file::sys_close() { return _IO_file_close(this); }
__basic_file::sys_close()
{ return _IO_file_close(this); }
// NB: Unused.
int
__basic_file::sys_stat(void* __v) { return _IO_file_stat(this, __v); }
__basic_file::sys_stat(void* __v)
{ return _IO_file_stat(this, __v); }
// NB: Unused.
int
......
2000-07-12 benjamin kosnik <bkoz@haight.constant.com>
* _G_config.h: Smoke less crack, don't define _G_HAVE_ST_BLKSIZE.
2000-04-25 Benjamin Kosnik <bkoz@haight.constant.com>
* libio.h: Change decls for seekoff/seekpos.
......
......@@ -35,13 +35,31 @@ CONFIG_INCLUDES = \
-I$(top_srcdir)/@ctype_include_dir@
INCLUDES = \
-D_GNU_SOURCE -nostdinc++ -I$(top_srcdir) \
-nostdinc++ -I$(top_srcdir) \
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
$(TOPLEVEL_INCLUDES)
noinst_LTLIBRARIES = libio.la
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set.
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
AC_CFLAGS = \
$(WERROR) @CPU_FLAGS@ @DEBUG_FLAGS@
# Need to manually set this option because AC_CXXFLAGS has to be at
# the end of the compile line so that -O2 can be overridden as the
# occasion call for it. (ie, --enable-debug)
AM_CFLAGS = \
-D_GNU_SOURCE $(AC_CFLAGS)
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) \
$(AM_CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
$(AM_CPPFLAGS) \$(CPPFLAGS) $(CFLAGS) $(AM_CFLAGS)
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
#includes =
......@@ -62,10 +80,17 @@ else
LIBIO_WSRCS =
endif
if GLIBCPP_NEED_XTRA_LIBIO
LIBIO_XTRASRCS = \
iofclose.c iofopen.c stdio.c
else
LIBIO_XTRASRCS =
endif
EXTRA_DIST = iostreamP.h
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
......@@ -102,6 +102,7 @@ WFMT_FLAGS = @WFMT_FLAGS@
cpu_include_dir = @cpu_include_dir@
ctype_include_dir = @ctype_include_dir@
glibcpp_basedir = @glibcpp_basedir@
ifGNUmake = @ifGNUmake@
libinst_wstring_la = @libinst_wstring_la@
AUTOMAKE_OPTIONS = 1.3 cygnus
......@@ -119,14 +120,36 @@ CONFIG_INCLUDES = \
INCLUDES = \
-D_GNU_SOURCE -nostdinc++ -I$(top_srcdir) \
-nostdinc++ -I$(top_srcdir) \
$(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
$(TOPLEVEL_INCLUDES)
noinst_LTLIBRARIES = libio.la
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set.
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
AC_CFLAGS = \
$(WERROR) @CPU_FLAGS@ @DEBUG_FLAGS@
# Need to manually set this option because AC_CXXFLAGS has to be at
# the end of the compile line so that -O2 can be overridden as the
# occasion call for it. (ie, --enable-debug)
AM_CFLAGS = \
-D_GNU_SOURCE $(AC_CFLAGS)
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) \
$(AM_CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
$(AM_CPPFLAGS) \$(CPPFLAGS) $(CFLAGS) $(AM_CFLAGS)
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
#includes =
......@@ -139,12 +162,15 @@ libio_headers = \
@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = @GLIBCPP_NEED_WLIBIO_TRUE@\
@GLIBCPP_NEED_WLIBIO_TRUE@ iofwide.c wfiledoalloc.c wfileops.c wgenops.c
@GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS =
@GLIBCPP_NEED_XTRA_LIBIO_TRUE@LIBIO_XTRASRCS = @GLIBCPP_NEED_XTRA_LIBIO_TRUE@\
@GLIBCPP_NEED_XTRA_LIBIO_TRUE@ iofclose.c iofopen.c stdio.c
@GLIBCPP_NEED_XTRA_LIBIO_FALSE@LIBIO_XTRASRCS =
EXTRA_DIST = iostreamP.h
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
......@@ -156,30 +182,63 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libio_la_LDFLAGS =
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@genops.lo fileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@wgenops.lo
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@wgenops.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@genops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@cleanup.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@libio_la_OBJECTS =
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wgenops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofopen.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdio.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@libio_la_OBJECTS =
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wgenops.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@cleanup.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofopen.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdio.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofopen.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdio.lo
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wgenops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofopen.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdio.lo
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@filedoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wgenops.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
DIST_COMMON = ChangeLog Makefile.am Makefile.in
......
......@@ -6,6 +6,7 @@
#ifndef _LIBC
# include <bits/c++config.h>
# define _IO_MTSAFE_IO
#endif
/* Define types for libio in terms of the standard internal type names. */
......@@ -107,7 +108,7 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
//#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
/* This is defined by <bits/stat.h> if `st_blksize' exists. */
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
/*#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)*/
#define _G_BUFSIZ 8192
......@@ -119,7 +120,8 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
#define _G_VTABLE_LABEL_PREFIX_ID __vt_
#define _G_INTERNAL_CCS "UCS4"
#define _G_HAVE_WEAK_SYMBOL 1
#define _G_STDIO_USES_LIBIO 1
#if defined __cplusplus || defined __STDC__
# define _G_ARGS(ARGLIST) ARGLIST
......
......@@ -976,11 +976,9 @@ _IO_default_pbackfail (fp, c)
new_buf = (char *) malloc (new_size);
if (new_buf == NULL)
return EOF;
memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
old_size);
memcpy (new_buf + old_size, fp->_IO_read_base, old_size);
free (fp->_IO_read_base);
_IO_setg (fp, new_buf, new_buf + (new_size - old_size),
new_buf + new_size);
_IO_setg (fp, new_buf, new_buf + old_size, new_buf + new_size);
fp->_IO_backup_base = fp->_IO_read_ptr;
}
......
/* Copyright (C) 1993, 1995, 1997-1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does
not cause the resulting executable to be covered by the GNU General
Public License. This exception does not however invalidate any
other reasons why the executable file might be covered by the GNU
General Public License. */
#include "libioP.h"
#ifdef __STDC__
#include <stdlib.h>
#endif
#if _LIBC
# include "../iconv/gconv_int.h"
# include <shlib-compat.h>
#else
# define SHLIB_COMPAT(a, b, c) 0
#endif
int
_IO_new_fclose (fp)
_IO_FILE *fp;
{
int status;
CHECK_FILE(fp, EOF);
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
/* We desperately try to help programs which are using streams in a
strange way and mix old and new functions. Detect old streams
here. */
if (fp->_vtable_offset != 0)
return _IO_old_fclose (fp);
#endif
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
status = _IO_file_close_it (fp);
else
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
_IO_FINISH (fp);
_IO_funlockfile (fp);
if (fp->_mode > 0)
{
#if _LIBC
/* This stream has a wide orientation. This means we have to free
the conversion functions. */
struct _IO_codecvt *cc = &fp->_wide_data->_codecvt;
if (cc->__cd_in.__cd.__steps->__shlib_handle != NULL)
{
--cc->__cd_in.__cd.__steps->__counter;
__gconv_close_transform (cc->__cd_in.__cd.__steps, 1);
}
if (cc->__cd_out.__cd.__steps->__shlib_handle != NULL)
{
--cc->__cd_out.__cd.__steps->__counter;
__gconv_close_transform (cc->__cd_out.__cd.__steps, 1);
}
#endif
}
_IO_cleanup_region_end (0);
if (_IO_have_backup (fp))
_IO_free_backup_area (fp);
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
{
fp->_IO_file_flags = 0;
free(fp);
}
return status;
}
#ifdef _LIBC
versioned_symbol (libc, _IO_new_fclose, _IO_fclose, GLIBC_2_1);
strong_alias (_IO_new_fclose, __new_fclose)
versioned_symbol (libc, __new_fclose, fclose, GLIBC_2_1);
#else
int fclose (_IO_FILE *) __attribute__ ((alias("_IO_new_fclose")));
#endif
/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does
not cause the resulting executable to be covered by the GNU General
Public License. This exception does not however invalidate any
other reasons why the executable file might be covered by the GNU
General Public License. */
#include "libioP.h"
#ifdef __STDC__
#include <stdlib.h>
#endif
#ifdef _LIBC
# include <shlib-compat.h>
#endif
_IO_FILE *
_IO_new_fopen (filename, mode)
const char *filename;
const char *mode;
{
struct locked_FILE
{
struct _IO_FILE_plus fp;
#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
#endif
struct _IO_wide_data wd;
} *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
#ifdef _IO_MTSAFE_IO
new_f->fp.file._lock = &new_f->lock;
#endif
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
_IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps);
#else
_IO_no_init (&new_f->fp.file, 1, 0, NULL, NULL);
#endif
_IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
_IO_file_init (&new_f->fp);
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, 1) != NULL)
return (_IO_FILE *) &new_f->fp;
_IO_un_link (&new_f->fp);
free (new_f);
return NULL;
}
#ifdef _LIBC
strong_alias (_IO_new_fopen, __new_fopen)
versioned_symbol (libc, _IO_new_fopen, _IO_fopen, GLIBC_2_1);
versioned_symbol (libc, __new_fopen, fopen, GLIBC_2_1);
#else
int fopen (const char *,const char *)
__attribute__ ((alias("_IO_new_fopen")));
#endif
......@@ -310,6 +310,9 @@ struct _IO_FILE_complete
/* Wide character stream stuff. */
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
# else
void *__pad1;
void *__pad2;
# endif
int _mode;
/* Make sure we don't get into trouble again. */
......
......@@ -31,12 +31,9 @@
hand, we don't need a C++ compiler to build this file.) */
#include "libioP.h"
#ifndef _LIBC
# include <bits/c++config.h>
#endif
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# ifdef _IO_MTSAFE_IO
#ifdef _IO_MTSAFE_IO
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
static struct _IO_wide_data _IO_wide_data_##FD \
......@@ -46,18 +43,18 @@
&_IO_file_jumps};
# else
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static struct _IO_wide_data _IO_wide_data_##FD \
= { ._wide_vtable = &_IO_wfile_jumps }; \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
&_IO_file_jumps};
# endif
#else
# ifdef _IO_MTSAFE_IO
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
static struct _IO_wide_data _IO_wide_data_##FD \
= { ._wide_vtable = &_IO_wfile_jumps }; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
&_IO_file_jumps};
# else
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
......
/* Copyright (C) 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does
not cause the resulting executable to be covered by the GNU General
Public License. This exception does not however invalidate any
other reasons why the executable file might be covered by the GNU
General Public License. */
#include "libioP.h"
#undef stdin
#undef stdout
#undef stderr
_IO_FILE *stdin = (_IO_FILE *) &_IO_2_1_stdin_;
_IO_FILE *stdout = (_IO_FILE *) &_IO_2_1_stdout_;
_IO_FILE *stderr = (_IO_FILE *) &_IO_2_1_stderr_;
#undef _IO_stdin
#undef _IO_stdout
#undef _IO_stderr
#ifdef _LIBC
strong_alias (stdin, _IO_stdin);
strong_alias (stdout, _IO_stdout);
strong_alias (stderr, _IO_stderr);
#endif
......@@ -103,6 +103,7 @@ WFMT_FLAGS = @WFMT_FLAGS@
cpu_include_dir = @cpu_include_dir@
ctype_include_dir = @ctype_include_dir@
glibcpp_basedir = @glibcpp_basedir@
ifGNUmake = @ifGNUmake@
libinst_wstring_la = @libinst_wstring_la@
AUTOMAKE_OPTIONS = 1.3 cygnus
......
......@@ -189,10 +189,11 @@ cpu_headers = \
sources = \
limitsMEMBERS.cc c++io.cc \
limitsMEMBERS.cc \
cmath.cc \
complex.cc complexf.cc complexl.cc complex_io.cc \
stdexcept.cc ios.cc stdstreams.cc strstream.cc \
stdexcept.cc \
c++io.cc ios.cc stdstreams.cc strstream.cc \
locale.cc localename.cc \
locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
......
......@@ -101,6 +101,7 @@ WFMT_FLAGS = @WFMT_FLAGS@
cpu_include_dir = @cpu_include_dir@
ctype_include_dir = @ctype_include_dir@
glibcpp_basedir = @glibcpp_basedir@
ifGNUmake = @ifGNUmake@
libinst_wstring_la = @libinst_wstring_la@
AUTOMAKE_OPTIONS = 1.3 gnits
......@@ -266,10 +267,11 @@ cpu_headers = \
sources = \
limitsMEMBERS.cc c++io.cc \
limitsMEMBERS.cc \
cmath.cc \
complex.cc complexf.cc complexl.cc complex_io.cc \
stdexcept.cc ios.cc stdstreams.cc strstream.cc \
stdexcept.cc \
c++io.cc ios.cc stdstreams.cc strstream.cc \
locale.cc localename.cc \
locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
......@@ -318,8 +320,8 @@ libinst_string_la_OBJECTS = libinst-string.la.lo
libinst_wstring_la_LDFLAGS =
libinst_wstring_la_LIBADD =
libinst_wstring_la_OBJECTS = wstring-inst.lo
libstdc___la_OBJECTS = limitsMEMBERS.lo c++io.lo cmath.lo complex.lo \
complexf.lo complexl.lo complex_io.lo stdexcept.lo ios.lo stdstreams.lo \
libstdc___la_OBJECTS = limitsMEMBERS.lo cmath.lo complex.lo complexf.lo \
complexl.lo complex_io.lo stdexcept.lo c++io.lo ios.lo stdstreams.lo \
strstream.lo locale.lo localename.lo locale-inst.lo stl-inst.lo \
misc-inst.lo valarray-inst.lo string-inst.lo
CXXFLAGS = @CXXFLAGS@
......
......@@ -272,7 +272,7 @@ 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;
// Turn off sync with C FILE* for cin, cout, cerr, clog.
if (!__sync && __retval)
{
......
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