Commit 20427c6b by Benjamin Kosnik Committed by Benjamin Kosnik

Sync libio to glibc-2.2 current CVS.


2000-07-01  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>
	    Ulrich Drepper  <drepper@purist.soma.redhat.com>

	Sync libio to glibc-2.2 current CVS.
	* libio/_G_config.h: New file.
	* libio/wfileops.c: New file.
	* libio/wfiledoalloc.c: New file.
	* libio/wgenops.c: New file.
	* libio/iofwide.c: New file.
	* libio/Makefile.am: Tweaks.
	* libio/Makefile.in: Regenerate.
	* libio/gen-params: Remove. Generic replacement for this yet undone.
	* libio/[filedoalloc.c, fileops.c, genops.c, iolibio.h, libio.h,
	libioP.h, stdfiles.c]: Update.
	* config/c_io_libio.cc: Tweaks.
	* acinclude.m4: Complete hacks to test wide io.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* src/Makefile.am: Update.
	* src/Makefile.in: Regenerate.

	* math/cargl.c: Remove underscores.

	* bits/locale_facets.h: Tweaks. Start adding iconv details
	and notes.
	* bits/locale_facets.tcc: Tweaks.
	* bits/std_cwchar.h: Tweaks.

Co-Authored-By: Ulrich Drepper <drepper@purist.soma.redhat.com>

From-SVN: r34822
parent dee4095a
2000-07-01 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
Ulrich Drepper <drepper@purist.soma.redhat.com>
Sync libio to glibc-2.2 current CVS.
* libio/_G_config.h: New file.
* libio/wfileops.c: New file.
* libio/wfiledoalloc.c: New file.
* libio/wgenops.c: New file.
* libio/iofwide.c: New file.
* libio/Makefile.am: Tweaks.
* libio/Makefile.in: Regenerate.
* libio/gen-params: Remove. Generic replacement for this yet undone.
* libio/[filedoalloc.c, fileops.c, genops.c, iolibio.h, libio.h,
libioP.h, stdfiles.c]: Update.
* config/c_io_libio.cc: Tweaks.
* acinclude.m4: Complete hacks to test wide io.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* src/Makefile.am: Update.
* src/Makefile.in: Regenerate.
* math/cargl.c: Remove underscores.
* bits/locale_facets.h: Tweaks. Start adding iconv details
and notes.
* bits/locale_facets.tcc: Tweaks.
* bits/std_cwchar.h: Tweaks.
2000-06-29 scott snyder <snyder@fnal.gov>
* bits/concept_checks.h
......@@ -18,7 +46,7 @@
function, uglify to __eos. Return char_type().
* bits/std_ostream.h: Change.
* testsuite/27_io/ostream_seeks.cc (test01): New file.
* testsuite/27_io/ostream_seeks.cc: New file.
* testsuite/27_io/ostream_seeks-1.tst: New file.
* testsuite/27_io/istream_unformatted.cc (main): Move test04 and
test05 to...
......
......@@ -1173,6 +1173,10 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
# 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
......@@ -1186,6 +1190,11 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
# 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=c_io_wince.h
......@@ -1204,6 +1213,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
AC_SUBST(CSTDIO_H)
AC_SUBST(CSTDIO_CC)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
])
......
......@@ -1185,6 +1185,10 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
# 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
......@@ -1198,6 +1202,11 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
# 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=c_io_wince.h
......@@ -1216,6 +1225,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
AC_SUBST(CSTDIO_H)
AC_SUBST(CSTDIO_CC)
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
])
......
......@@ -39,6 +39,10 @@
#include <bits/std_ctime.h> // For struct tm
#include <bits/std_typeinfo.h> // For bad_cast, which shouldn't be here.
#include <bits/std_ios.h> // For ios_base
#ifdef _GLIBCPP_USE_WCHAR_T
// XXX should break this out??
#include <iconv.h> // For iconv, iconv_t
#endif
namespace std
{
......@@ -76,6 +80,60 @@ namespace std
_Use_facet_failure_handler(const locale&)
{ throw _Bad_use_facet(); }
#ifdef _GLIBCPP_USE_WCHAR_T
// Extensions to use icov for dealing with character encodings,
// including conversions and comparisons between various character
// sets. This object encapsulates data that codecvt and possibly
// ctype will use.
template<typename _IntT, typename _ExtT>
class __enc_traits
{
public:
// Types:
typedef iconv_t __conv_type;
typedef _IntT __intc_type;
typedef _ExtT __extc_type;
// max size of charset encoding name
static const int __max_size = 32;
// name of internal character set encoding.
char __intc_enc[__max_size];
// name of external character set encoding.
char __extc_enc[__max_size];
const char*
_M_get_intc_enc(void)
{ return __intc_enc; }
void
_M_set_intc_enc(const char* __c)
{ strcpy(__intc_enc, __c); }
const char*
_M_get_extc_enc(void)
{ return __extc_enc; }
void
_M_set_extc_enc(const char* __c)
{ strcpy(__extc_enc, __c); }
__enc_traits(const char* __int, const char* __ext)
{
// __intc_end = whatever we are using internally, which is
// almost alwyas UCS4 (linux) or UCS2 (microsoft, aix,
// whatever...)
// __extc_end = nl_langinfo(CODESET)
strcpy(__intc_enc, __int);
strcpy(__extc_enc, __ext);
}
protected:
__enc_traits();
__enc_traits(const __enc_traits&);
};
#endif //_GLIBCPP_USE_WCHAR_T
// 22.2.1 The ctype category
// Include host-specific ctype enums for ctype_base.
#include <bits/ctype_base.h>
......@@ -86,10 +144,10 @@ namespace std
template<typename _CharT>
class _Ctype_nois : public locale::facet, public ctype_base
{
public:
// Types:
typedef _CharT char_type;
public:
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
......@@ -162,7 +220,6 @@ namespace std
class _Ctype : public _Ctype_nois<_CharT>
{
public:
// Types:
typedef _CharT char_type;
typedef typename _Ctype_nois<_CharT>::mask mask;
......@@ -644,8 +701,8 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
class codecvt<wchar_t,char,mbstate_t>
: public _Codecvt<wchar_t,char,mbstate_t>
class codecvt<wchar_t, char, mbstate_t>
: public _Codecvt<wchar_t, char, mbstate_t>
{
public:
// Types:
......@@ -687,7 +744,7 @@ namespace std
// 22.2.1.6 Template class codecvt_byname
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt_byname : public codecvt<_InternT,_ExternT,_StateT>
class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
{
public:
explicit
......@@ -699,8 +756,8 @@ namespace std
};
template<>
class codecvt_byname<char,char,mbstate_t>
: public codecvt<char,char,mbstate_t>
class codecvt_byname<char, char, mbstate_t>
: public codecvt<char, char, mbstate_t>
{
public:
explicit
......@@ -713,8 +770,8 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
class codecvt_byname<wchar_t,char,mbstate_t>
: public codecvt<wchar_t,char,mbstate_t>
class codecvt_byname<wchar_t, char, mbstate_t>
: public codecvt<wchar_t, char, mbstate_t>
{
public:
explicit
......
......@@ -606,7 +606,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
char __xtrc[32] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
......
......@@ -42,13 +42,15 @@
# pragma system_header
# include_next <wchar.h>
#else
# ifdef _GLIBCPP_NEED_MBSTATE_T
# ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
int __fill[6];
} mbstate_t;
# ifdef __cplusplus
}
# endif
#endif //_GLIBCPP_USE_WCHAR_T
......
......@@ -41,7 +41,7 @@ namespace std {
{
_lock = __lock;
_IO_init(this, 0);
_IO_file_init(this);
_IO_file_init((_IO_FILE_plus*) this);
_IO_file_attach(this, -1);
}
......@@ -55,7 +55,7 @@ namespace std {
{
_IO_do_flush(this);
if (!(_flags & _IO_DELETE_DONT_CLOSE))
_IO_SYSCLOSE(this);
_IO_SYSCLOSE((_IO_FILE*)this);
}
_IO_default_finish(this, 0);
}
......@@ -92,7 +92,7 @@ namespace std {
_fileno = __fd;
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_flags = (_flags & ~__mask) | (__rw_mode & __mask);
_IO_link_in(this);
_IO_link_in((_IO_FILE_plus*) this);
__retval = this;
}
return __retval;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,11 +23,27 @@
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@
CONFIG_INCLUDES = \
-I$(top_srcdir)/@cpu_include_dir@ \
-I$(top_srcdir)/@ctype_include_dir@
INCLUDES = \
-D_GNU_SOURCE -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 $@
includes =
#includes =
libio_headers = \
libio.h libioP.h iolibio.h
......@@ -39,35 +55,17 @@ else
LIBIO_SRCS =
endif
EXTRA_DIST = iostreamP.h
libio_la_LIBADD = $(LIBIO_SRCS)
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
libio_la_SOURCES = $(LIBIO_SRCS)
if GLIBCPP_NEED_LIBIO_CONFIG_H
LIBIO_CONFIG_H = _G_config.h
if GLIBCPP_NEED_WLIBIO
LIBIO_WSRCS = \
iofwide.c wfiledoalloc.c wfileops.c wgenops.c
else
LIBIO_CONFIG_H =
LIBIO_WSRCS =
endif
# Specify that *.o depend on this one header
$(libio_la_OBJECTS): $(LIBIO_CONFIG_H)
# Generate this file.
_G_config.h: $(srcdir)/gen-params
rootme=`pwd`/ ; export rootme; \
CC="$(CC) $(CINCLUDES)"; export CC; \
CXX="$(CXX) $(CXXINCLUDES) $(NOSTDINC) $(CXXFLAGS)"; export CXX; \
CONFIG_NM="$(NM)"; export CONFIG_NM; \
$(SHELL) $(srcdir)/gen-params LIB_VERSION=$(VERSION) $(G_CONFIG_ARGS) >tmp-params.h
mv tmp-params.h _G_config.h
EXTRA_DIST = iostreamP.h
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS)
......@@ -70,7 +70,6 @@ CC = @CC@
CPP = @CPP@
CPU_FLAGS = @CPU_FLAGS@
CSHADOWFLAGS = @CSHADOWFLAGS@
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
CSTDIO_CC = @CSTDIO_CC@
CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
......@@ -109,11 +108,29 @@ libinst_wstring_la = @libinst_wstring_la@
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@
CONFIG_INCLUDES = \
-I$(top_srcdir)/@cpu_include_dir@ \
-I$(top_srcdir)/@ctype_include_dir@
INCLUDES = \
-D_GNU_SOURCE -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 $@
includes =
#includes =
libio_headers = \
libio.h libioP.h iolibio.h
......@@ -121,14 +138,15 @@ libio_headers = \
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_TRUE@\
@GLIBCPP_NEED_LIBIO_TRUE@ filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS =
@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 =
EXTRA_DIST = iostreamP.h
libio_la_LIBADD = $(LIBIO_SRCS)
libio_la_LIBADD = $(LIBIO_SRCS) $(LIBIO_WSRCS)
libio_la_DEPENDENCIES = $(libio_la_LIBADD)
libio_la_SOURCES = $(LIBIO_SRCS)
@GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@LIBIO_CONFIG_H = @GLIBCPP_NEED_LIBIO_CONFIG_H_TRUE@_G_config.h
@GLIBCPP_NEED_LIBIO_CONFIG_H_FALSE@LIBIO_CONFIG_H =
libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
......@@ -140,9 +158,27 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libio_la_LDFLAGS =
@GLIBCPP_NEED_LIBIO_TRUE@libio_la_OBJECTS = filedoalloc.lo genops.lo \
@GLIBCPP_NEED_LIBIO_TRUE@fileops.lo stdfiles.lo cleanup.lo
@GLIBCPP_NEED_LIBIO_FALSE@libio_la_OBJECTS =
@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 =
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)
......@@ -339,18 +375,6 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Specify that *.o depend on this one header
$(libio_la_OBJECTS): $(LIBIO_CONFIG_H)
# Generate this file.
_G_config.h: $(srcdir)/gen-params
rootme=`pwd`/ ; export rootme; \
CC="$(CC) $(CINCLUDES)"; export CC; \
CXX="$(CXX) $(CXXINCLUDES) $(NOSTDINC) $(CXXFLAGS)"; export CXX; \
CONFIG_NM="$(NM)"; export CONFIG_NM; \
$(SHELL) $(srcdir)/gen-params LIB_VERSION=$(VERSION) $(G_CONFIG_ARGS) >tmp-params.h
mv tmp-params.h _G_config.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
/* This file is needed by libio to define various configuration parameters.
These are always the same in the GNU C library. */
#ifndef _G_config_h
#define _G_config_h 1
#ifndef _LIBC
# include <bits/c++config.h>
#endif
/* Define types for libio in terms of the standard internal type names. */
#include <sys/types.h>
#define __need_size_t
#define __need_wchar_t
#define __need_wint_t
#define __need_NULL
#include <bits/std_cstddef.h>
/* For use as part of glibc (native) or as part of libstdc++ (maybe
not glibc) */
#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1)
# ifdef _GLIBCPP_USE_WCHAR_T
# include <bits/std_cwchar.h>
typedef mbstate_t __mbstate_t;
# endif
#endif
#ifndef _WINT_T
/* Integral type unchanged by default argument promotions that can
hold any value corresponding to members of the extended character
set, as well as at least one value that does not correspond to any
member of the extended character set. */
# define _WINT_T
typedef unsigned int wint_t;
#endif
#define __need_mbstate_t
#include <bits/std_cwchar.h>
#define _G_size_t size_t
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
#else
typedef __off_t _G_fpos_t;
typedef __off64_t _G_fpos64_t;
#endif
#define _G_ssize_t __ssize_t
#define _G_off_t __off_t
#define _G_off64_t __off64_t
#define _G_pid_t __pid_t
#define _G_uid_t __uid_t
#define _G_wchar_t wchar_t
#define _G_wint_t wint_t
#define _G_stat64 stat64
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <iconv.h>
typedef iconv_t _G_iconv_t;
# if 0
/* XXX Commented out because outside glibc we have to use iconv()
and not gconv(). */
typedef union
{
struct __gconv_info __cd;
struct
{
struct __gconv_info __cd;
struct __gconv_step_data __data;
} __combined;
} _G_iconv_t;
# endif
#endif
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
#define _G_HAVE_BOOL 1
/* These library features are always available in the GNU C library. */
#define _G_HAVE_ATEXIT 1
#define _G_HAVE_SYS_CDEFS 1
#define _G_HAVE_SYS_WAIT 1
#define _G_NEED_STDARG_H 1
#define _G_va_list __gnuc_va_list
#define _G_HAVE_PRINTF_FP 1
#define _G_HAVE_MMAP 1
#define _G_HAVE_LONG_DOUBLE_IO 1
#define _G_HAVE_IO_FILE_OPEN 1
#define _G_HAVE_IO_GETLINE_INFO 1
#define _G_IO_IO_FILE_VERSION 0x20001
//#define _G_OPEN64 __open64
//#define _G_LSEEK64 __lseek64
//#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_BUFSIZ 8192
/* These are the vtbl details for ELF. */
#define _G_NAMES_HAVE_UNDERSCORE 0
#define _G_VTABLE_LABEL_HAS_LENGTH 1
#define _G_USING_THUNKS 1
#define _G_VTABLE_LABEL_PREFIX "__vt_"
#define _G_VTABLE_LABEL_PREFIX_ID __vt_
#define _G_INTERNAL_CCS "UCS4"
#if defined __cplusplus || defined __STDC__
# define _G_ARGS(ARGLIST) ARGLIST
#else
# define _G_ARGS(ARGLIST) ()
#endif
#endif /* _G_config.h */
......@@ -27,34 +27,24 @@
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. [rescinded 22 July 1999]
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* Modified for GNU iostream by Per Bothner 1991, 1992. */
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#endif
#include "libioP.h"
#include <sys/types.h>
#include <sys/stat.h>
......@@ -83,9 +73,9 @@ _IO_file_doallocate (fp)
_IO_size_t size;
int couldbetty;
char *p;
struct stat st;
struct _G_stat64 st;
#if !defined(_LIBC) && !defined(__linux__)
#ifndef _LIBC
/* If _IO_cleanup_registration_needed is non-zero, we should call the
function it points to. This is to make sure _IO_cleanup gets called
on exit. We call it from _IO_file_doallocate, since that is likely
......
......@@ -8,14 +8,23 @@ extern "C" {
#endif
extern int _IO_fclose __P((_IO_FILE*));
extern int _IO_new_fclose __P((_IO_FILE*));
extern int _IO_old_fclose __P((_IO_FILE*));
extern _IO_FILE *_IO_fdopen __P((int, const char*));
extern _IO_FILE *_IO_old_fdopen __P((int, const char*));
extern _IO_FILE *_IO_new_fdopen __P((int, const char*));
extern int _IO_fflush __P((_IO_FILE*));
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
extern char* _IO_fgets __P((char*, int, _IO_FILE*));
extern _IO_FILE *_IO_fopen __P((const char*, const char*));
extern _IO_FILE *_IO_old_fopen __P((const char*, const char*));
extern _IO_FILE *_IO_new_fopen __P((const char*, const char*));
extern _IO_FILE *_IO_fopen64 __P((const char*, const char*));
extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
extern int _IO_fputs __P((const char*, _IO_FILE*));
extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
extern int _IO_fsetpos64 __P((_IO_FILE*, const _IO_fpos64_t *));
extern long int _IO_ftell __P((_IO_FILE*));
extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
extern _IO_size_t _IO_fwrite __P((const void*,
......@@ -32,32 +41,40 @@ extern int _IO_sprintf __P((char *, const char*, ...));
extern int _IO_ungetc __P((int, _IO_FILE*));
extern int _IO_vsscanf __P((const char *, const char *, _IO_va_list));
extern int _IO_vsprintf __P((char*, const char*, _IO_va_list));
extern int _IO_vswprintf __P((wchar_t*, _IO_size_t, const wchar_t*,
_IO_va_list));
struct obstack;
extern int _IO_obstack_vprintf __P ((struct obstack *, const char *,
_IO_va_list));
extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...));
#ifndef _IO_pos_BAD
#define _IO_pos_BAD ((_IO_fpos_t)(-1))
#define _IO_pos_BAD ((_IO_off64_t)(-1))
#endif
#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
#define _IO_fseek(__fp, __offset, __whence) \
(_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
#define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
#define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
#if _G_IO_IO_FILE_VERSION == 0x20001
#define _IO_freopen(FILENAME, MODE, FP) \
(_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
#else
#define _IO_freopen(FILENAME, MODE, FP) \
(_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE))
#endif
#define _IO_old_freopen(FILENAME, MODE, FP) \
(_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
#define _IO_freopen64(FILENAME, MODE, FP) \
(_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 1))
#define _IO_fileno(FP) ((FP)->_fileno)
extern _IO_FILE* _IO_popen __P((const char*, const char*));
extern _IO_FILE* _IO_new_popen __P((const char*, const char*));
extern _IO_FILE* _IO_old_popen __P((const char*, const char*));
extern int __new_pclose __P((_IO_FILE *));
extern int __old_pclose __P((_IO_FILE *));
#define _IO_pclose _IO_fclose
#define _IO_setbuf(_FP, _BUF) _IO_setbuffer(_FP, _BUF, _IO_BUFSIZ)
#define _IO_setlinebuf(_FP) _IO_setvbuf(_FP, NULL, 1, 0)
_IO_FILE *__new_freopen __P ((const char *, const char *, _IO_FILE *));
_IO_FILE *__old_freopen __P ((const char *, const char *, _IO_FILE *));
#ifdef __cplusplus
}
#endif
/* Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1993, 1994, 1996, 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
......@@ -31,21 +31,44 @@
hand, we don't need a C++ compiler to build this file.) */
#include "libioP.h"
#ifndef _LIBC
# include <bits/c++config.h>
#endif
#ifdef _IO_MTSAFE_IO
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# ifdef _IO_MTSAFE_IO
# 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, &_IO_wide_data_##FD), \
&_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 }; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
&_IO_file_jumps};
# endif
#else
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
# ifdef _IO_MTSAFE_IO
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
&_IO_file_jumps};
# else
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
&_IO_file_jumps};
# endif
#endif
DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
_IO_NO_READS+_IO_UNBUFFERED);
DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);
DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_, _IO_NO_READS);
DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
_IO_FILE *_IO_list_all = &_IO_stderr_.file;
struct _IO_FILE_plus *_IO_list_all = &_IO_2_1_stderr_;
/* Copyright (C) 1993, 1997, 1999 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. */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* Modified for GNU iostream by Per Bothner 1991, 1992. */
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#endif
#include "libioP.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __STDC__
#include <stdlib.h>
#include <unistd.h>
#endif
#ifdef _LIBC
# undef isatty
# define isatty(Fd) __isatty (Fd)
#endif
/*
* Allocate a file buffer, or switch to unbuffered I/O.
* Per the ANSI C standard, ALL tty devices default to line buffered.
*
* As a side effect, we set __SOPT or __SNPT (en/dis-able fseek
* optimisation) right after the _fstat() that finds the buffer size.
*/
int
_IO_wfile_doallocate (fp)
_IO_FILE *fp;
{
_IO_size_t size;
int couldbetty;
wchar_t *p;
struct _G_stat64 st;
/* Allocate room for the external buffer. */
_IO_file_doallocate (fp);
if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
{
couldbetty = 0;
size = _IO_BUFSIZ * sizeof (wchar_t);
#if 0
/* do not try to optimise fseek() */
fp->_flags |= __SNPT;
#endif
}
else
{
couldbetty = S_ISCHR (st.st_mode);
#if _IO_HAVE_ST_BLKSIZE
size = ((st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize)
* sizeof (wchar_t));
#else
size = _IO_BUFSIZ * sizeof (wchar_t);
#endif
}
ALLOC_WBUF (p, size, EOF);
_IO_wsetb (fp, p, p + size, 1);
if (couldbetty && isatty (fp->_fileno))
fp->_flags |= _IO_LINE_BUF;
return 1;
}
......@@ -34,5 +34,5 @@
long double
cargl (__complex__ long double x)
{
return __atan2l (__imag__ x, __real__ x);
return atan2l (__imag__ x, __real__ x);
}
......@@ -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 = \
-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
-D_GNU_SOURCE -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
-Wall -Wno-format -W -Wwrite-strings -Winline \
$(AC_CXXFLAGS)
......
......@@ -130,7 +130,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 = \
-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
-D_GNU_SOURCE -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
-Wall -Wno-format -W -Wwrite-strings -Winline \
$(AC_CXXFLAGS)
......
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