Gcc 3.1.0 pre-release's C++ support bits from the FSF anoncvs repo

on 9-May-2002 15:57:15 EDT.
This commit is contained in:
David E. O'Brien 2002-05-28 16:16:03 +00:00
parent dd49f05638
commit 00db7afddd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/gcc/dist/; revision=97403
456 changed files with 144124 additions and 1856 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,147 @@
## Makefile for the toplevel directory of the GNU C++ Standard library.
##
## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
## Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
## This file is part of the GNU ISO C++ Library. This library is free
## software; you can redistribute it and/or modify it under the
## 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.
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
SUBDIRS = include libio libmath libsupc++ src po testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# These two special 'check-script' rules use the bash script 'mkcheck'
# to do testing. This script is not as portable as the dejagnu test
# harness, and is thus off by default. It does produce interesting
# output however, including various performance analysis items like
# compile time, execution time, and binary size.
check-script: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 0)
check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})
.PHONY: doxygen doxygen-maint doxygen-man
# Multilib support.
MAKEOVERRIDES=
# Multilib variables.
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
# Multilib Makefile bits.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
all-am: all-multi
install-am: install-multi
mostlyclean-am: mostlyclean-multi
clean-am: clean-multi
distclean-am: distclean-multi
maintainer-clean-am: maintainer-clean-multi
all-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
install-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
mostlyclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
# All the machinations with string instantiations messes up the
# automake-generated TAGS rule. Make a simple one here.
TAGS: tags-recursive $(LISP)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"NM=$(NM)" \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"

View file

@ -1,385 +1,553 @@
# Copyright (C) 1994, 1995 Free Software Foundation
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# This file is part of the GNU ANSI C++ 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.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# 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.
VERSION = 2.10.0
INTERFACE = 3
SHELL = @SHELL@
gxx_include_dir=${includedir}/g++
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o valarray.o
SUBLIBS = $(STAMP)-string $(STAMP)-complx
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
# C++ headers with no extension
HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
cwchar cwctype string stdexcept \
algorithm deque functional hash_map hash_set iterator list map \
memory numeric pthread_alloc queue rope set slist stack utility \
vector fstream iomanip iostream strstream iosfwd bitset valarray \
sstream
DESTDIR =
ARLIB = libstdc++.a.$(VERSION)
ARLINK = libstdc++.a
MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
SHLIB = libstdc++.so.$(VERSION)
SHARLIB = libstdc++-sh.a
SHLINK = libstdc++.so
MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
SHFLAGS =
SHDEPS =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
STAMP = bigstmp
top_builddir = .
LIBS = $(ARLIB) $(ARLINK)
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
#### package, host, target, and site dependent Makefile fragments come in here.
##
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
IO_DIR = ../libio
LIBIBERTY_DIR = ../libiberty
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
AWK = @AWK@
BASIC_FILE_H = @BASIC_FILE_H@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCODECVT_C = @CCODECVT_C@
CCODECVT_H = @CCODECVT_H@
CLOCALE_H = @CLOCALE_H@
CMESSAGES_H = @CMESSAGES_H@
CPP = @CPP@
CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DATADIRNAME = @DATADIRNAME@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIBICONV = @LIBICONV@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
glibcpp_CXX = @glibcpp_CXX@
glibcpp_MOFILES = @glibcpp_MOFILES@
glibcpp_POFILES = @glibcpp_POFILES@
glibcpp_basedir = @glibcpp_basedir@
glibcpp_builddir = @glibcpp_builddir@
glibcpp_localedir = @glibcpp_localedir@
glibcpp_prefixdir = @glibcpp_prefixdir@
glibcpp_srcdir = @glibcpp_srcdir@
glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
libio_la = @libio_la@
libtool_VERSION = @libtool_VERSION@
release_VERSION = @release_VERSION@
toplevel_srcdir = @toplevel_srcdir@
LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
tooldir = $(exec_prefix)/$(target)
# This is where the libraries will be installed; note, it will be set
# at make runtime now. See below at target install.
INSTALLDIR = $(libdir)
SUBDIRS = include libio libmath libsupc++ src po testsuite
MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
CLEAN_JUNK = $(LIBS)
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
.PHONY: libs
libs: $(LIBS)
# Multilib support.
MAKEOVERRIDES =
stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
-rm -f tlist
touch tlist
echo *.o >> tlist
for f in `cat $(IO_DIR)/iostream.list` ; do \
echo "$(IO_DIR)/$$f" >> tlist ; \
done
for f in $(LIBIBERTY_OBJS) ; do \
echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
done
mv tlist stdlist
# Multilib variables.
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
piclist: stdlist
-rm -f tlist
cp stdlist tlist
if [ x"$(enable_shared)" = xyes ]; then \
sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
mv tlist2 tlist ; \
else true ; fi
mv tlist piclist
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"NM=$(NM)" \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
$(ARLIB): stdlist
-rm -f t$(ARLIB)
$(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
mv t$(ARLIB) $(ARLIB)
$(RANLIB) $(ARLIB)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = mkcheck testsuite_flags
DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in \
mkcheck.in testsuite_flags.in
$(ARLINK):
-rm -f $(ARLINK)
$(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)
marlink:
@$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
$(SHLIB): piclist
$(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
$(SHARLIB): $(SHLIB)
-rm -f t$(SHARLIB)
$(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
mv t$(SHARLIB) $(SHARLIB)
$(RANLIB) $(SHARLIB)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(SHLINK):
-rm -f $(SHLINK)
$(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
mshlink:
@$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(IO_DIR)/iostream.list: force
cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
$(LIBIBERTY_DIR)/libiberty.a:
cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
mostlyclean-hdr:
STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
LESS LEPS LESP GESS GEPS GESP
STRIO = EXTRACT INSERT GETLINE
clean-hdr:
# These are here for SunOS VPATH.
cstringi.o: cstringi.cc
cstdlibi.o: cstdlibi.cc
cmathi.o: cmathi.cc
stdexcepti.o: stdexcepti.cc
stlinst.o: stlinst.cc
valarray.o: valarray.cc
distclean-hdr:
-rm -f config.h
# Later do wide strings, too.
stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
for name in $(STRFUNCS) $(STRIO); do \
echo c$${name}; \
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
-o pic/c$${name}.o; \
else true ; fi; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
$(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
done
touch stmp-string
maintainer-clean-hdr:
mkcheck: $(top_builddir)/config.status mkcheck.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
testsuite_flags: $(top_builddir)/config.status testsuite_flags.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
echo cstring
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DC \
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/sinst.cc -o pic/cstrmain.o; \
else true ; fi
$(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/sinst.cc -o cstrmain.o
echo cstrio
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DC \
`for N in $(STRIO); do echo " -D$${N}"; done` \
$(srcdir)/sinst.cc -o pic/cstrio.o; \
else true ; fi
$(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
$(srcdir)/sinst.cc -o cstrio.o
touch bigstmp-string
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
COMIO = EXTRACT INSERT
@SET_MAKE@
stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
${srcdir}/std/ldcomplex.h
for N in $(COMFUNCS) $(COMIO); do \
echo f$${N}; \
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
-o pic/f$${N}.o; \
else true ; fi; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
$(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
echo d$${N}; \
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
-o pic/d$${N}.o; \
else true ; fi; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
$(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
echo ld$${N}; \
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
-o pic/ld$${N}.o; \
else true ; fi; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
$(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
if [ $$? -eq 0 ]; then true; else exit 1; fi; \
done
touch stmp-complx
bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
${srcdir}/std/ldcomplex.h
echo fcomplex
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DF \
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/fcomplex.o; \
else true ; fi
$(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o fcomplex.o
echo fcomio
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DF \
`for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/fcomio.o; \
else true ; fi
$(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o fcomio.o
echo dcomplex
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DD \
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/dcomplex.o; \
else true ; fi
$(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o dcomplex.o
echo dcomio
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DD \
`for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/dcomio.o; \
else true ; fi
$(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o dcomio.o
echo ldcomplex
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DLD \
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/ldcomplex.o; \
else true ; fi
$(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o ldcomplex.o
echo ldcomio
if [ x"$(enable_shared)" = xyes ]; then \
$(COMPILE.cc) $(PICFLAG) -DLD \
`for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o pic/ldcomio.o; \
else true ; fi
$(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
$(srcdir)/cinst.cc -o ldcomio.o
touch bigstmp-complx
.PHONY: install
install:
rootme=`pwd`/ ; export rootme ; \
if [ -z "$(MULTISUBDIR)" ]; then \
cd $(srcdir); \
for FILE in $(HEADERS); do \
rm -f $(gxx_include_dir)/$$FILE ; \
if [ -f stl/$$FILE ]; then \
$(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
else \
$(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
fi ; \
chmod a-x $(gxx_include_dir)/$$FILE ; \
done ; \
for FILE in *.h std/*.h std/*.cc std/*.tcc; do \
rm -f $(gxx_include_dir)/$$FILE ; \
$(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
chmod a-x $(gxx_include_dir)/$$FILE ; \
done ; \
cd stl; \
for FILE in *.h; do \
rm -f $(gxx_include_dir)/$$FILE ; \
$(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
chmod a-x $(gxx_include_dir)/$$FILE ; \
done ; \
else true ; \
fi
rootme=`pwd`/ ; export rootme ; \
if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
INSTALLDIR=$(libdir); \
else \
INSTALLDIR=$(libsubdir); \
fi; \
INSTALLLINKDIR=$(libsubdir); \
if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
RELINSTALLDIR=; \
elif [ x$(MULTISUBDIR) = x ]; then \
if [ $(build_alias) = $(target_alias) ]; then \
RELINSTALLDIR=../../../; \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
RELINSTALLDIR=../../../../$(target_alias)/lib/; \
local_target="$$target"; \
fi; \
else \
if [ $(build_alias) = $(target_alias) ]; then \
RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
local_target="$$target"; \
fi; \
fi; \
if [ $(build_alias) != $(target_alias) ]; then \
case $$RELINSTALLDIR in \
../../../|../../../../) \
RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
esac; \
fi; \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
for FILE in $(LIBS) ; do \
rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
if [ $$FILE = $(SHLINK) ] ; then \
if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
|| cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
else \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
|| cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
fi; \
elif [ $$FILE = $(ARLINK) ] ; then \
if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
|| cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
else \
rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
|| cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
fi; \
elif [ $$FILE = mshlink ]; then \
for FILE in $(MSHLINK) ; do \
rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
|| cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
done; \
elif [ $$FILE = marlink ]; then \
for FILE in $(MARLINK) ; do \
rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
$(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
|| cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
done; \
elif [ $$FILE = $(SHLIB) ]; then \
$(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
: On the HP, shared libraries must be mode 555. ;\
chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
else \
$(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
$(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
fi ; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
@rootme=`pwd`/ ; export rootme ; \
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
.PHONY: force
force:
tags: TAGS
MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
.PHONY: stuff
stuff:
$(MAKE) stuff1
$(MAKE) stuff2
mostlyclean-tags:
stuff1:
$(MAKE) clean
$(MAKE) -C ../libio c++clean
touch ../../gcc/libgcc2.ready
clean-tags:
stuff2:
$(MAKE) -C ../../gcc/ libgcc.a
$(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
-$(MAKE) check
-$(MAKE) -C ../libio check
-$(MAKE) -C ../../gcc check-g++
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am:
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
install-info-am:
install-info: install-info-recursive
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
install-data-recursive uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-info-am \
install-info all-recursive-am install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# These two special 'check-script' rules use the bash script 'mkcheck'
# to do testing. This script is not as portable as the dejagnu test
# harness, and is thus off by default. It does produce interesting
# output however, including various performance analysis items like
# compile time, execution time, and binary size.
check-script: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 0)
check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; pwd`; \
builddir=`pwd`; \
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})
.PHONY: doxygen doxygen-maint doxygen-man
# Multilib Makefile bits.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
all-am: all-multi
install-am: install-multi
mostlyclean-am: mostlyclean-multi
clean-am: clean-multi
distclean-am: distclean-multi
maintainer-clean-am: maintainer-clean-multi
all-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
install-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
mostlyclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
# All the machinations with string instantiations messes up the
# automake-generated TAGS rule. Make a simple one here.
TAGS: tags-recursive $(LISP)
# 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:

102
contrib/libstdc++/README Normal file
View file

@ -0,0 +1,102 @@
file: libstdc++-v3/README
New users may wish to point their web browsers to the file
documentation.html in the 'docs/html' subdirectory. It contains brief
building instructions and notes on how to configure the library in
interesting ways.
Instructions for configuring and building appear in
docs/html/install.html.
This directory contains the files needed to create an ISO Standard C++
Library.
It has subdirectories:
docs
Files in HTML and text format that document usage, quirks of the
implementation, and contributor checklists.
include
All header files for the C++ library are within this directory,
modulo specific runtime-related files that are in the libsupc++
directory.
include/std
Files meant to be found by #include <name> directives in
standard-conforming user programs.
include/c
Headers intended to directly include standard C headers.
[NB: this can be enabled via --enable-cheaders=c]
include/c_std
Headers intended to include standard C headers, and put select
names into the std:: namespace.
[NB: this is the default, and is the same as --enable-cheaders=c_std]
include/c_shadow
Headers intended to shadow standard C headers provided by an
underlying OS or C library, and other headers depended on directly
by C++ headers (e.g. unistd.h). These are meant to wrap the names
defined there into the _C_legacy namespace.
[NB: this can be enabled via --enable-cheaders=c_shadow]
include/bits
Files included by standard headers and by other files in
the bits directory.
include/backward
Headers provided for backward compatibility, such as <iostream.h>.
They are not used in this library.
include/ext
Headers that define extensions to the standard library. No
standard header refers to any of them.
src
Files that are used in constructing the library, but are not
installed.
testsuites/[thread, 17_* to 27_*]
Test programs are here, and may be used to begin to exercise the
library. Support for "make check" and "make check-install" is
complete, and runs through all the subdirectories here when this
command is issued from the build directory. Please note that
"make check" requires DejaGNU 1.4 or later to be installed. Please
note that "make check-script" calls the script mkcheck, which
requires bash, and which may need the paths to bash adjusted to
work properly, as /bin/bash is assumed.
Other subdirectories contain variant versions of certain files
that are meant to be copied or linked by the configure script.
Currently these are:
config/cpu
config/os
config/io
config/locale
In addition, three subdirectories are convenience libraries:
libio
Contains the subset of the GNU libio library needed for
C++. Currently not used.
libmath
Support routines needed for C++ math. Only needed if the
underlying "C" implementation is non-existent, in particular
required or optimal long double, long long, and C99 functionality.
libsupc++
Contains the runtime library for C++, including exception
handling and memory allocation and deallocation, RTTI, terminate
handlers, etc.
Note that glibc also has a bits/ subdirectory. We will either
need to be careful not to collide with names in its bits/
directory; or rename bits to (e.g.) cppbits/.
In files throughout the system, lines marked with an "XXX" indicate
a bug or incompletely-implemented feature. Lines marked "XXX MT"
indicate a place that may require attention for multi-thread safety.

View file

@ -0,0 +1,430 @@
// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
// Defines libstdc++ version.
#undef PACKAGE
#undef VERSION
// Needed for gettext.
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
#undef HAVE_STPCPY
// Define if GCC supports weak symbols.
#undef _GLIBCPP_SUPPORTS_WEAK
// Define if gthr-default.h exists (meaning that threading support is enabled).
#undef HAVE_GTHR_DEFAULT
// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCPP_USE_C99
// Include support for 'long double'.
#undef _GLIBCPP_USE_LONG_DOUBLE
// Include support for shadow headers, ie --enable-cshadow-headers.
#undef _GLIBCPP_USE_SHADOW_HEADERS
// Define if code specialized for wchar_t should be used.
#undef _GLIBCPP_USE_WCHAR_T
// Define if using setrlimit to limit memory usage during 'make check'.
#undef _GLIBCPP_MEM_LIMITS
// Define to use concept checking code from the boost libraries.
#undef _GLIBCPP_CONCEPT_CHECKS
// Define if you have the atan2f function.
#undef _GLIBCPP_HAVE_ATAN2F
// Define if you have the atan2l function.
#undef _GLIBCPP_HAVE_ATAN2L
// Define if you have the copysignf function.
#undef _GLIBCPP_HAVE_COPYSIGNF
// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
// Define if you have the modff function.
#undef HAVE_MODFF
// Define if you have the modfl function.
#undef HAVE_MODFL
// Define if you have the expf function.
#undef HAVE_EXPF
// Define if you have the expl function.
#undef HAVE_EXPL
// Define if you have the hypotf function.
#undef HAVE_HYPOTF
// Define if you have the hypotl function.
#undef HAVE_HYPOTL
// Define if the compiler/host combination has __builtin_abs
#undef HAVE___BUILTIN_ABS
// Define if the compiler/host combination has __builtin_labs
#undef HAVE___BUILTIN_LABS
// Define if the compiler/host combination has __builtin_cos
#undef HAVE___BUILTIN_COS
// Define if the compiler/host combination has __builtin_cosf
#undef HAVE___BUILTIN_COSF
// Define if the compiler/host combination has __builtin_cosl
#undef HAVE___BUILTIN_COSL
// Define if the compiler/host combination has __builtin_fabs
#undef HAVE___BUILTIN_FABS
// Define if the compiler/host combination has __builtin_fabsf
#undef HAVE___BUILTIN_FABSF
// Define if the compiler/host combination has __builtin_fabsl
#undef HAVE___BUILTIN_FABSL
// Define if the compiler/host combination has __builtin_sin
#undef HAVE___BUILTIN_SIN
// Define if the compiler/host combination has __builtin_sinf
#undef HAVE___BUILTIN_SINF
// Define if the compiler/host combination has __builtin_sinl
#undef HAVE___BUILTIN_SINL
// Define if the compiler/host combination has __builtin_sqrt
#undef HAVE___BUILTIN_SQRT
// Define if the compiler/host combination has __builtin_sqrtf
#undef HAVE___BUILTIN_SQRTF
// Define if the compiler/host combination has __builtin_sqrtl
#undef HAVE___BUILTIN_SQRTL
// Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES
// Define if <float.h> exists.
#undef HAVE_FLOAT_H
// Define if modf is present in <math.h>
#undef HAVE_MODF
// @BOTTOM@
//
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
//
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
# define HAVE_ISNAN 1
# define isnan _isnan
#endif
#if defined (HAVE__ISNANF) && ! defined (HAVE_ISNANF)
# define HAVE_ISNANF 1
# define isnanf _isnanf
#endif
#if defined (HAVE__ISNANL) && ! defined (HAVE_ISNANL)
# define HAVE_ISNANL 1
# define isnanl _isnanl
#endif
#if defined (HAVE__ISINF) && ! defined (HAVE_ISINF)
# define HAVE_ISINF 1
# define isinf _isinf
#endif
#if defined (HAVE__ISINFF) && ! defined (HAVE_ISINFF)
# define HAVE_ISINFF 1
# define isinff _isinff
#endif
#if defined (HAVE__ISINFL) && ! defined (HAVE_ISINFL)
# define HAVE_ISINFL 1
# define isinfl _isinfl
#endif
#if defined (HAVE__COPYSIGN) && ! defined (HAVE_COPYSIGN)
# define HAVE_COPYSIGN 1
# define copysign _copysign
#endif
#if defined (HAVE__COPYSIGNL) && ! defined (HAVE_COPYSIGNL)
# define HAVE_COPYSIGNL 1
# define copysignl _copysignl
#endif
#if defined (HAVE__COSF) && ! defined (HAVE_COSF)
# define HAVE_COSF 1
# define cosf _cosf
#endif
#if defined (HAVE__ACOSF) && ! defined (HAVE_ACOSF)
# define HAVE_ACOSF 1
# define acosf _acosf
#endif
#if defined (HAVE__ACOSL) && ! defined (HAVE_ACOSL)
# define HAVE_ACOSL 1
# define acosl _acosl
#endif
#if defined (HAVE__ASINF) && ! defined (HAVE_ASINF)
# define HAVE_ASINF 1
# define asinf _asinf
#endif
#if defined (HAVE__ASINL) && ! defined (HAVE_ASINL)
# define HAVE_ASINL 1
# define asinl _asinl
#endif
#if defined (HAVE__ATANF) && ! defined (HAVE_ATANF)
# define HAVE_ATANF 1
# define atanf _atanf
#endif
#if defined (HAVE__ATANL) && ! defined (HAVE_ATANL)
# define HAVE_ATANL 1
# define atanl _atanl
#endif
#if defined (HAVE__CEILF) && ! defined (HAVE_CEILF)
# define HAVE_CEILF 1
# define aceil _ceilf
#endif
#if defined (HAVE__CEILL) && ! defined (HAVE_CEILL)
# define HAVE_CEILL 1
# define aceil _ceill
#endif
#if defined (HAVE__COSHF) && ! defined (HAVE_COSHF)
# define HAVE_COSHF 1
# define coshf _coshf
#endif
#if defined (HAVE__COSL) && ! defined (HAVE_COSL)
# define HAVE_COSL 1
# define cosl _cosl
#endif
#if defined (HAVE__LOGF) && ! defined (HAVE_LOGF)
# define HAVE_LOGF 1
# define logf _logf
#endif
#if defined (HAVE__COSHL) && ! defined (HAVE_COSHL)
# define HAVE_COSHL 1
# define coshl _coshl
#endif
#if defined (HAVE__EXPF) && ! defined (HAVE_EXPF)
# define HAVE_EXPF 1
# define expf _expf
#endif
#if defined (HAVE__EXPL) && ! defined (HAVE_EXPL)
# define HAVE_EXPL 1
# define expl _expl
#endif
#if defined (HAVE__FABSF) && ! defined (HAVE_FABSF)
# define HAVE_FABSF 1
# define fabsf _fabsf
#endif
#if defined (HAVE__FABSL) && ! defined (HAVE_FABSL)
# define HAVE_FABSL 1
# define fabsl _fabsl
#endif
#if defined (HAVE__FLOORF) && ! defined (HAVE_FLOORF)
# define HAVE_FLOORF 1
# define floorf _floorf
#endif
#if defined (HAVE__FLOORL) && ! defined (HAVE_FLOORL)
# define HAVE_FLOORL 1
# define floorl _floorl
#endif
#if defined (HAVE__FMODF) && ! defined (HAVE_FMODF)
# define HAVE_FMODF 1
# define fmodf _fmodf
#endif
#if defined (HAVE__FMODL) && ! defined (HAVE_FMODL)
# define HAVE_FMODL 1
# define fmodl _fmodl
#endif
#if defined (HAVE__FREXPF) && ! defined (HAVE_FREXPF)
# define HAVE_FREXPF 1
# define frexpf _frexpf
#endif
#if defined (HAVE__FREXPL) && ! defined (HAVE_FREXPL)
# define HAVE_FREXPL 1
# define frexpl _frexpl
#endif
#if defined (HAVE__LDEXPF) && ! defined (HAVE_LDEXPF)
# define HAVE_LDEXPF 1
# define ldexpf _ldexpf
#endif
#if defined (HAVE__LDEXPL) && ! defined (HAVE_LDEXPL)
# define HAVE_LDEXPL 1
# define ldexpl _ldexpl
#endif
#if defined (HAVE__LOG10F) && ! defined (HAVE_LOG10F)
# define HAVE_LOG10F 1
# define log10f _log10f
#endif
#if defined (HAVE__LOGL) && ! defined (HAVE_LOGL)
# define HAVE_LOGL 1
# define logl _logl
#endif
#if defined (HAVE__POWF) && ! defined (HAVE_POWF)
# define HAVE_POWF 1
# define powf _powf
#endif
#if defined (HAVE__LOG10L) && ! defined (HAVE_LOG10L)
# define HAVE_LOG10L 1
# define log10l _log10l
#endif
#if defined (HAVE__MODF) && ! defined (HAVE_MODF)
# define HAVE_MODF 1
# define modf _modf
#endif
#if defined (HAVE__MODL) && ! defined (HAVE_MODL)
# define HAVE_MODL 1
# define modl _modl
#endif
#if defined (HAVE__SINF) && ! defined (HAVE_SINF)
# define HAVE_SINF 1
# define sinf _sinf
#endif
#if defined (HAVE__POWL) && ! defined (HAVE_POWL)
# define HAVE_POWL 1
# define powl _powl
#endif
#if defined (HAVE__SINHF) && ! defined (HAVE_SINHF)
# define HAVE_SINHF 1
# define sinhf _sinhf
#endif
#if defined (HAVE__SINL) && ! defined (HAVE_SINL)
# define HAVE_SINL 1
# define sinl _sinl
#endif
#if defined (HAVE__SQRTF) && ! defined (HAVE_SQRTF)
# define HAVE_SQRTF 1
# define sqrtf _sqrtf
#endif
#if defined (HAVE__SINHL) && ! defined (HAVE_SINHL)
# define HAVE_SINHL 1
# define sinhl _sinhl
#endif
#if defined (HAVE__TANF) && ! defined (HAVE_TANF)
# define HAVE_TANF 1
# define tanf _tanf
#endif
#if defined (HAVE__SQRTL) && ! defined (HAVE_SQRTL)
# define HAVE_SQRTL 1
# define sqrtl _sqrtl
#endif
#if defined (HAVE__TANHF) && ! defined (HAVE_TANHF)
# define HAVE_TANHF 1
# define tanhf _tanhf
#endif
#if defined (HAVE__TANL) && ! defined (HAVE_TANL)
# define HAVE_TANF 1
# define tanf _tanf
#endif
#if defined (HAVE__STRTOF) && ! defined (HAVE_STRTOF)
# define HAVE_STRTOF 1
# define strtof _strtof
#endif
#if defined (HAVE__TANHL) && ! defined (HAVE_TANHL)
# define HAVE_TANHL 1
# define tanhl _tanhl
#endif
#if defined (HAVE__STRTOLD) && ! defined (HAVE_STRTOLD)
# define HAVE_STRTOLD 1
# define strtold _strtold
#endif
#if defined (HAVE__SINCOS) && ! defined (HAVE_SINCOS)
# define HAVE_SINCOS 1
# define sincos _sincos
#endif
#if defined (HAVE__SINCOSF) && ! defined (HAVE_SINCOSF)
# define HAVE_SINCOSF 1
# define sincosf _sincosf
#endif
#if defined (HAVE__SINCOSL) && ! defined (HAVE_SINCOSL)
# define HAVE_SINCOSL 1
# define sincosl _sincosl
#endif
#if defined (HAVE__FINITE) && ! defined (HAVE_FINITE)
# define HAVE_FINITE 1
# define finite _finite
#endif
#if defined (HAVE__FINITEF) && ! defined (HAVE_FINITEF)
# define HAVE_FINITEF 1
# define finitef _finitef
#endif
#if defined (HAVE__FINITEL) && ! defined (HAVE_FINITEL)
# define HAVE_FINITEL 1
# define finitel _finitel
#endif
#if defined (HAVE__QFINITE) && ! defined (HAVE_QFINITE)
# define HAVE_QFINITE 1
# define qfinite _qfinite
#endif
#if defined (HAVE__FPCLASS) && ! defined (HAVE_FPCLASS)
# define HAVE_FPCLASS 1
# define fpclass _fpclass
#endif
#if defined (HAVE__QFPCLASS) && ! defined (HAVE_QFPCLASS)
# define HAVE_QFPCLASS 1
# define qfpclass _qfpclass
#endif

File diff suppressed because it is too large Load diff

2898
contrib/libstdc++/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,76 @@
// Low-level functions for atomic operations: Alpha version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
/* @@@ With gas we can play nice .subsection games to get the
non-predicted branch pointing forward. But Digital assemblers
don't understand those directives. This isn't a terribly
important issue, so just ignore it. */
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
register int __result, __tmp;
__asm__ __volatile__ (
"\n$Lxadd_%=:\n\t"
"ldl_l %0,%3\n\t"
"addl %0,%4,%1\n\t"
"stl_c %1,%2\n\t"
"beq %1,$Lxadd_%=\n\t"
"mb"
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
: "m" (*__mem), "r"(__val));
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ (
"\n$Ladd_%=:\n\t"
"ldl_l %0,%2\n\t"
"addl %0,%3,%0\n\t"
"stl_c %0,%1\n\t"
"beq %0,$Ladd_%=\n\t"
"mb"
: "=&r"(__result), "=m"(*__mem)
: "m" (*__mem), "r"(__val));
}
#endif /* atomicity.h */

View file

@ -0,0 +1,38 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_bits 64
#define __glibcpp_long_double_bits 64
#endif

View file

@ -0,0 +1,221 @@
// Low-level functions for atomic operations: ARM version -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp, __tmp2, __result;
#ifdef __thumb__
/* Since this function is inlined, we can't be sure of the alignment. */
__asm__ __volatile__ (
"ldr %0, 4f \n\t"
"bx %0 \n\t"
".align 0 \n"
"4:\t"
".word 0f \n\t"
".code 32 \n"
"0:\t"
"ldr %0, [%3] \n\t"
"add %1, %0, %4 \n\t"
"swp %2, %1, [%3] \n\t"
"cmp %0, %2 \n\t"
"swpne %1, %2, [%3] \n\t"
"bne 0b \n\t"
"ldr %1, 1f \n\t"
"bx %1 \n"
"1:\t"
".word 2f \n\t"
".code 16 \n"
"2:\n"
: "=&l"(__result), "=&r"(__tmp), "=&r"(__tmp2)
: "r" (__mem), "r"(__val)
: "cc", "memory");
#else
__asm__ __volatile__ (
"\n"
"0:\t"
"ldr %0, [%3] \n\t"
"add %1, %0, %4 \n\t"
"swp %2, %1, [%3] \n\t"
"cmp %0, %2 \n\t"
"swpne %1, %2, [%3] \n\t"
"bne 0b \n\t"
""
: "=&r"(__result), "=&r"(__tmp), "=&r"(__tmp2)
: "r" (__mem), "r"(__val)
: "cc", "memory");
#endif
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp, __tmp2, __tmp3;
#ifdef __thumb__
/* Since this function is inlined, we can't be sure of the alignment. */
__asm__ __volatile__ (
"ldr %0, 4f \n\t"
"bx %0 \n\t"
".align 0\n"
"4:\t"
".word 0f \n\t"
".code 32 \n"
"0:\t"
"ldr %0, [%3] \n\t"
"add %1, %0, %4 \n\t"
"swp %2, %1, [%3] \n\t"
"cmp %0, %2 \n\t"
"swpne %1, %2,[%3] \n\t"
"bne 0b \n\t"
"ldr %1, 1f \n\t"
"bx %1 \n"
"1:\t"
".word 2f \n\t"
".code 16 \n"
"2:\n"
: "=&l"(__tmp), "=&r"(__tmp2), "=&r"(__tmp3)
: "r" (__mem), "r"(__val)
: "cc", "memory");
#else
__asm__ __volatile__ (
"\n"
"0:\t"
"ldr %0, [%3] \n\t"
"add %1, %0, %4 \n\t"
"swp %2, %1, [%3] \n\t"
"cmp %0, %2 \n\t"
"swpne %1, %2, [%3] \n\t"
"bne 0b \n\t"
""
: "=&r"(__tmp), "=&r"(__tmp2), "=&r"(__tmp3)
: "r" (__mem), "r"(__val)
: "cc", "memory");
#endif
}
static inline long
__attribute__ ((__unused__))
__always_swap (volatile long *__p, long __newval)
{
long __result;
#ifdef __thumb__
long __tmp;
/* Since this function is inlined, we can't be sure of the alignment. */
__asm__ __volatile__ (
"ldr %0, 4f \n\t"
"bx %0 \n\t"
".align 0 \n"
"4:\t"
".word 0f \n\t"
".code 32\n"
"0:\t"
"swp %0, %3, [%2] \n\t"
"ldr %1, 1f \n\t"
"bx %1 \n"
"1:\t"
".word 2f \n\t"
".code 16 \n"
"2:\n"
: "=&l"(__result), "=&r"(__tmp)
: "r"(__p), "r"(__newval)
: "memory");
#else
__asm__ __volatile__ (
"\n\t"
"swp %0, %2, [%1] \n\t"
""
: "=&r"(__result)
: "r"(__p), "r"(__newval)
: "memory");
#endif
return __result;
}
static inline int
__attribute__ ((__unused__))
__test_and_set (volatile long *__p, long __newval)
{
int __result;
long __tmp;
#ifdef __thumb__
/* Since this function is inlined, we can't be sure of the alignment. */
__asm__ __volatile__ (
"ldr %0, 4f \n\t"
"bx %0 \n\t"
".align 0 \n"
"4:\t"
".word 0f \n\t"
".code 32 \n"
"0:\t"
"ldr %0, [%2] \n\t"
"cmp %0, #0 \n\t"
"bne 1f \n\t"
"swp %1, %3, [%2] \n\t"
"cmp %0, %1 \n\t"
"swpne %0, %1, [%2]\n\t"
"bne 0b \n"
"1:\t"
"ldr %1, 2f \n\t"
"bx %1 \n"
"2:\t"
".word 3f \n\t"
".code 16 \n"
"3:"
: "=&l"(__result), "=r" (__tmp)
: "r"(__p), "r"(__newval)
: "cc", "memory");
#else
__asm__ __volatile__ (
"\n"
"0:\t"
"ldr %0, [%2] \n\t"
"cmp %0, #0 \n\t"
"bne 1f \n\t"
"swp %1, %3, [%2] \n\t"
"cmp %0, %1 \n\t"
"swpne %0, %1, [%2] \n\t"
"bne 0b \n"
"1:\n\t"
""
: "=&r"(__result), "=r" (__tmp)
: "r"(__p), "r"(__newval)
: "cc", "memory");
#endif
return __result;
}
#endif /* atomicity.h */

View file

@ -0,0 +1,79 @@
// Low-level functions for atomic operations: CRIS version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
// This entity must not cross a page boundary.
typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (_Atomic_word* __mem, int __val)
{
int __tmp;
_Atomic_word __result;
#if (__CRIS_arch_version >= 10)
__asm__ __volatile__ (" clearf \n"
"0: \n"
" move.d %4,%2 \n"
" move.d [%3],%0 \n"
" add.d %0,%2 \n"
" ax \n"
" move.d %2,[%3] \n"
" bwf 0b \n"
" clearf \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
: "memory");
#else
__asm__ __volatile__ (" move $ccr,$r9 \n"
" di \n"
" move.d %4,%2 \n"
" move.d [%3],%0 \n"
" add.d %0,%2 \n"
" move.d %2,[%3] \n"
" move $r9,$ccr \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
: "memory", "r9");
#endif
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (_Atomic_word* __mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,33 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_double_bits 64
#endif

View file

@ -0,0 +1,51 @@
// Low-level functions for atomic operations: Generic version -*- C++ -*-
// Copyright (C) 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (_Atomic_word* __mem, int __val)
{
_Atomic_word __result = *__mem;
*__mem += __val;
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (_Atomic_word* __mem, int __val)
{
*__mem += __val;
}
#endif /* atomicity.h */

View file

@ -0,0 +1,41 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
// Nothing is defined in the generic file. In that way, we fall back
// on the defaults in std_limits.h.
// If you need to override these defaults, you can either use a
// CPU-specific version (in which case you must modify
// configure.target) or you must add the overrides to your
// os_defines.h. In general, if all systems for your CPU use the
// same values, it is best to use a cpu-specific configuration file.
#endif

View file

@ -0,0 +1,40 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
// Nothing is defined in the generic file. In that way, we fall back
// on the defaults in std_limits.h.
// If you need to override these defaults, you can either use a
// CPU-specific version (in which case you must modify
// configure.target) or you must add the overrides to your
// os_defines.h. In general, if all systems for your CPU use the
// same values, it is best to use a cpu-specific configuration file.
#endif

View file

@ -0,0 +1,59 @@
// Low-level functions for atomic operations: x86, x < 4 version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ ("lock; xaddl %0,%2"
: "=r" (__result)
: "0" (__val), "m" (*__mem)
: "memory");
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__asm__ __volatile__ ("lock; addl %0,%1"
: : "ir" (__val), "m" (*__mem) : "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,33 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_double_bits 80
#endif

View file

@ -0,0 +1,57 @@
// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ ("lock; xaddl %0,%2"
: "=r" (__result)
: "0" (__val), "m" (*__mem)
: "memory");
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__asm__ __volatile__ ("lock; addl %0,%1"
: : "ir" (__val), "m" (*__mem) : "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,51 @@
// Low-level functions for atomic operations: IA64 version -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#include <ia64intrin.h>
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
return __sync_fetch_and_add (__mem, __val);
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__sync_fetch_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,36 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_bits 64
// While sizeof(long double) == 16, the format is the same as the x86.
#define __glibcpp_long_double_bits 80
#endif

View file

@ -0,0 +1,158 @@
// Low-level functions for atomic operations: m68k version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
#if defined(__mc68020__) || defined(__mc68030__) \
|| defined(__mc68040__) || defined(__mc68060__)
// These variants support compare-and-swap.
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result = *__mem;
register _Atomic_word __temp;
__asm__ __volatile__ ("1: move%.l %0,%1\n\t"
"add%.l %2,%1\n\t"
"cas%.l %0,%1,%3\n\t"
"jbne 1b"
: "=d" (__result), "=&d" (__temp)
: "d" (__val), "m" (*__mem), "0" (__result)
: "memory");
return __result;
}
#elif defined(__rtems__)
/*
* TAS/JBNE is unsafe on systems with strict priority-based scheduling.
* Disable interrupts, which we can do only from supervisor mode.
*/
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
short __level, __tmpsr;
__asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
: "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
__result = *__mem;
*__mem = __result + __val;
__asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
return __result;
}
#elif !defined(__mcf5200__) && !defined(__mcf5300__)
// 68000, 68010, cpu32 and 5400 support test-and-set.
template <int __inst>
struct __Atomicity_lock
{
static volatile unsigned char _S_atomicity_lock;
};
template <int __inst>
volatile unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template volatile unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
__asm__ __volatile__("1: tas %0\n\tjbne 1b"
: "=m"(__Atomicity_lock<0>::_S_atomicity_lock)
: "m"(__Atomicity_lock<0>::_S_atomicity_lock));
__result = *__mem;
*__mem = __result + __val;
__Atomicity_lock<0>::_S_atomicity_lock = 0;
return __result;
}
#elif defined(__vxWorks__) || defined(__embedded__)
// The best we can hope for is to disable interrupts, which we
// can only do from supervisor mode.
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
short __level, __tmpsr;
__asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
: "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
__result = *__mem;
*__mem = __result + __val;
__asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
return __result;
}
#else
// These variants do not support any atomic operations at all.
#warning "__exchange_and_add is not atomic for this target"
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
__result = *__mem;
*__mem = __result + __val;
return __result;
}
#endif /* CAS / IRQ / TAS */
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
// Careful: using add.l with a memory destination is not
// architecturally guaranteed to be atomic.
(void) __exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,35 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_double_bits 96
#endif

View file

@ -0,0 +1,78 @@
// Low-level functions for atomic operations. MIPS II version.
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
// #include <sgidefs.h>
// #ifdef (_MIPS_ISA_MIPS2)
typedef int _Atomic_word;
static inline int
__attribute__ ((unused))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
int __result, __tmp;
__asm__ __volatile__
("/* Inline exchange & add */\n\t"
"1:\n\t"
"ll %0,%3\n\t"
"addu %1,%4,%0\n\t"
"sc %1,%2\n\t"
"beqz %1,1b\n\t"
"/* End exchange & add */"
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
: "m" (*__mem), "r"(__val)
: "memory");
return __result;
}
static inline void
__attribute__ ((unused))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
int __result;
__asm__ __volatile__
("/* Inline atomic add */\n\t"
"1:\n\t"
"ll %0,%2\n\t"
"addu %0,%3,%0\n\t"
"sc %0,%1\n\t"
"beqz %0,1b\n\t"
"/* End atomic add */"
: "=&r"(__result), "=m"(*__mem)
: "m" (*__mem), "r"(__val)
: "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,34 @@
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_bits 64
#define __glibcpp_long_double_bits 64
#endif

View file

@ -0,0 +1,112 @@
// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp, __res;
__asm__ __volatile__ (
"/* Inline exchange & add */\n"
"0:\t"
"lwarx %0,0,%2 \n\t"
"add%I3 %1,%0,%3 \n\t"
"stwcx. %1,0,%2 \n\t"
"bne- 0b \n\t"
"/* End exchange & add */"
: "=&b"(__res), "=&r"(__tmp)
: "r" (__mem), "Ir"(__val)
: "cr0", "memory");
return __res;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp;
__asm__ __volatile__ (
"/* Inline atomic add */\n"
"0:\t"
"lwarx %0,0,%1 \n\t"
"add%I2 %0,%0,%2 \n\t"
"stwcx. %0,0,%1 \n\t"
"bne- 0b \n\t"
"/* End atomic add */"
: "=&b"(__tmp)
: "r" (__mem), "Ir"(__val)
: "cr0", "memory");
}
static inline long
__attribute__ ((__unused__))
__always_swap (volatile long *__p, long int __newval)
{
long __res;
__asm__ __volatile__ (
"/* Inline always swap */\n"
"0:\t"
"lwarx %0,0,%1 \n\t"
"stwcx. %2,0,%1 \n\t"
"bne- 0b \n\t"
"/* End always swap */"
: "=&r"(__res)
: "r"(__p), "r"(__newval)
: "cr0", "memory");
return __res;
}
static inline int
__attribute__ ((__unused__))
__test_and_set (volatile long *__p, long int __newval)
{
int __res;
__asm__ __volatile__ (
"/* Inline test & set */\n"
"0:\t"
"lwarx %0,0,%1 \n\t"
"cmpwi %0,0 \n\t"
"bne- 1f \n\t"
"stwcx. %2,0,%1 \n\t"
"bne- 0b \n"
"1:\n\t"
"/* End test & set */"
: "=&r"(__res)
: "r"(__p), "r"(__newval)
: "cr0", "memory");
return __res;
}
#endif /* atomicity.h */

View file

@ -0,0 +1,38 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#ifndef __LONG_DOUBLE_128__
#define __glibcpp_long_double_bits 64
#endif
#endif

View file

@ -0,0 +1,60 @@
// Low-level functions for atomic operations: S/390 version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __old_val, __new_val;
__asm__ __volatile__ (" l %0,0(%2)\n"
"0: lr %1,%0\n"
" ar %1,%3\n"
" cs %0,%1,0(%2)\n"
" jl 0b"
: "=&d" (__old_val), "=&d" (__new_val)
: "a" (__mem), "d" (__val) : "cc", "memory" );
return __old_val;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,33 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_double_bits 64
#endif

View file

@ -0,0 +1,88 @@
// Low-level functions for atomic operations: Sparc32 version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
template <int __inst>
struct __Atomicity_lock
{
static unsigned char _S_atomicity_lock;
};
template <int __inst>
unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
static int
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __result, __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
" cmp %0, 0\n\t"
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
__result = *__mem;
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
return __result;
}
static void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
" cmp %0, 0\n\t"
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
: "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,70 @@
// Low-level functions for atomic operations: Sparc64 version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef long _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
: "r" (__mem), "r" (__val)
: "memory");
return __tmp2;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
: "r" (__mem), "r" (__val)
: "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,55 @@
// Low-level functions for atomic operations: AMD x86-64, -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ ("lock; xaddl %0,%2"
: "=r" (__result)
: "0" (__val), "m" (*__mem)
: "memory");
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
__asm__ __volatile__ ("lock; addl %0,%1"
: : "ir" (__val), "m" (*__mem) : "memory");
}
#endif /* atomicity.h */

View file

@ -0,0 +1,35 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#define __glibcpp_long_bits 64
#define __glibcpp_long_double_bits 80
#endif

View file

@ -0,0 +1,194 @@
// Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 27.8 File-based streams
//
#include <bits/basic_file.h>
namespace std
{
// __basic_file<char> definitions
__basic_file<char>::__basic_file(__c_lock* __lock)
{
#ifdef _IO_MTSAFE_IO
_lock = __lock;
#endif
// Don't set the orientation of the stream when initializing.
#ifdef _GLIBCPP_USE_WCHAR_T
_IO_no_init(this, 0, 0, &_M_wfile, 0);
#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
_IO_no_init(this, 0, 0, NULL, 0);
#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
_IO_JUMPS((_IO_FILE_plus *) this) = &_IO_file_jumps;
_IO_file_init((_IO_FILE_plus*)this);
}
// NB: Unused.
int
__basic_file<char>::overflow(int __c)
{ return _IO_file_overflow(this, __c); }
// NB: Unused.
int
__basic_file<char>::underflow()
{ return _IO_file_underflow(this); }
// NB: Unused.
int
__basic_file<char>::uflow()
{ return _IO_default_uflow(this); }
// NB: Unused.
int
__basic_file<char>::pbackfail(int __c)
{ return _IO_default_pbackfail(this, __c); }
streamsize
__basic_file<char>::xsputn(const char* __s, streamsize __n)
{ return _IO_file_xsputn(this, __s, __n); }
streamoff
__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<char>::seekpos(streamoff __pos, ios_base::openmode __mode)
{ return _IO_file_seekoff(this, __pos, ios_base::beg, __mode); }
// NB: Unused.
streambuf*
__basic_file<char>::setbuf(char* __b, int __len)
{ return (streambuf*) _IO_file_setbuf(this,__b, __len); }
int
__basic_file<char>::sync()
{ return _IO_file_sync(this); }
// NB: Unused.
int
__basic_file<char>::doallocate()
{ return _IO_file_doallocate(this); }
// __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
// Don't set the orientation of the stream when initializing.
_IO_no_init(this, 0, 0, &_M_wfile, &_IO_wfile_jumps);
_IO_JUMPS((_IO_FILE_plus *) this) = &_IO_wfile_jumps;
_IO_file_init((_IO_FILE_plus*)this);
// In addition, need to allocate the buffer...
_IO_wdoallocbuf(this);
// Setup initial positions for this buffer...
// if (!(_flags & _IO_NO_READS))
_IO_wsetg(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base,
_wide_data->_IO_buf_base);
// if (!(_flags & _IO_NO_WRITES))
_IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base);
// Setup codecvt bits...
_codecvt = &__c_libio_codecvt;
// Do the same for narrow bits...
if (_IO_write_base == NULL)
{
_IO_doallocbuf(this);
// if (!(_flags & _IO_NO_READS))
_IO_setg(this, _IO_buf_base, _IO_buf_base, _IO_buf_base);
// if (!(_flags & _IO_NO_WRITES))
_IO_setp(this, _IO_buf_base, _IO_buf_base);
}
}
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); }
// NB: Unused.
int
__basic_file<wchar_t>::uflow()
{ return _IO_wdefault_uflow(this); }
// NB: Unused.
int
__basic_file<wchar_t>::pbackfail(int __c)
{ return _IO_wdefault_pbackfail(this, __c); }
streamsize
__basic_file<wchar_t>::xsputn(const wchar_t* __s, streamsize __n)
{ return _IO_wfile_xsputn(this, __s, __n); }
streamoff
__basic_file<wchar_t>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode)
{ return _IO_wfile_seekoff(this, __off, __way, __mode); }
streamoff
__basic_file<wchar_t>::seekpos(streamoff __pos, ios_base::openmode __mode)
{ return _IO_wfile_seekoff(this, __pos, ios_base::beg, __mode); }
streambuf*
__basic_file<wchar_t>::setbuf(wchar_t* __b, int __len)
{ return (streambuf*) _IO_wfile_setbuf(this,__b, __len); }
int
__basic_file<wchar_t>::sync()
{ return _IO_wfile_sync(this); }
int
__basic_file<wchar_t>::doallocate()
{ return _IO_wfile_doallocate(this); }
#endif
// Need to instantiate base class here for type-info bits, etc
template struct __basic_file_base<char>;
template class __basic_file<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template struct __basic_file_base<wchar_t>;
template class __basic_file<wchar_t>;
#endif
} // namespace std

View file

@ -0,0 +1,498 @@
// Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 27.8 File-based streams
//
/** @file basic_file.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _CPP_BASIC_FILE
#define _CPP_BASIC_FILE 1
#pragma GCC system_header
#include <bits/c++config.h>
#include <ios>
#include <libioP.h>
namespace std
{
// Ulrich is going to make some detailed comment here, explaining
// all this unpleasantness, providing detailed performance analysis
// as to why we have to do all this lame vtable hacking instead of a
// sane, function-based approach. This verbiage will provide a clear
// and detailed description of the whole object-layout,
// vtable-swapping, sordid history of this hack.
template<typename _CharT>
struct __basic_file_base: public __c_file_type
{
virtual
~__basic_file_base() { };
virtual int
overflow(int __c = EOF) = 0;
virtual int
underflow() = 0;
virtual int
uflow() = 0;
virtual int
pbackfail(int __c) = 0;
virtual streamsize
xsputn(const _CharT* __s, streamsize __n) = 0;
virtual streamsize
xsgetn(_CharT* __s, streamsize __n) = 0;
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
virtual streambuf*
setbuf(_CharT* __b, int __len) = 0;
virtual int
sync() = 0;
virtual int
doallocate() = 0;
virtual streamsize
sys_read(_CharT* __s, streamsize __n) = 0;
virtual streamsize
sys_write(const _CharT* __s, streamsize __n) = 0;
virtual streamoff
sys_seek(streamoff __off, ios_base::seekdir __way) = 0;
virtual int
sys_close() = 0;
virtual int
sys_stat(void* __v) = 0;
virtual int
showmanyc() = 0;
virtual void
imbue(void* __v) = 0;
};
// 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>
class __basic_file: public __basic_file_base<_CharT>
{
# ifdef _GLIBCPP_USE_WCHAR_T
__c_wfile_type _M_wfile;
# endif
public:
__basic_file(__c_lock* __lock = 0);
void
_M_open_mode(ios_base::openmode __mode, int& __p_mode, int& __rw_mode,
char* __c_mode);
// Equivalent to the normal fopen function.
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
// Used for opening the standard streams, cin, cout, cerr, clog,
// and their wide-stream equivalents. Instead of calling open, it
// just sets
// - for libio: __c_file_type->_fileno and the respective _flags bits
// - for stdio: _M_cfile = __file and some internal flags
// and returns.
__basic_file*
sys_open(__c_file_type* __file, ios_base::openmode __mode);
_CharT
sys_getc();
_CharT
sys_ungetc(_CharT);
__basic_file*
close();
bool
is_open();
int
fd();
// 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
overflow(int __c = EOF);
virtual int
underflow();
virtual int
uflow();
virtual int
pbackfail(int __c);
// A complex "write" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsputn(const _CharT* __s, streamsize __n);
// A complex "read" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsgetn(_CharT* __s, streamsize __n);
// A complex "seekoff" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// 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 "seekpos" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
virtual streambuf*
setbuf(_CharT* __b, int __len);
virtual int
sync();
virtual int
doallocate();
// 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(_CharT* __s, streamsize __n);
// 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 _CharT* __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);
virtual int
sys_close();
virtual int
sys_stat(void* __v);
virtual int
showmanyc();
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<>
int
__basic_file<char>::uflow();
template<>
int
__basic_file<char>::pbackfail(int __c);
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<>
int
__basic_file<wchar_t>::uflow();
template<>
int
__basic_file<wchar_t>::pbackfail(int __c);
template<>
streamsize
__basic_file<wchar_t>::xsputn(const wchar_t* __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
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,
char* /*__c_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(__c_file_type* __f,
ios_base::openmode __mode)
{
__basic_file* __ret = NULL;
int __fd = fileno(__f);
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
char __c_mode[4];
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!_IO_file_is_open(this))
{
_fileno = __fd;
_flags &= ~(_IO_NO_READS + _IO_NO_WRITES);
_flags |= _IO_DELETE_DONT_CLOSE;
_offset = _IO_pos_BAD;
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
_IO_mask_flags(this, __rw_mode, __mask);
}
return __ret;
}
template<typename _CharT>
__basic_file<_CharT>*
__basic_file<_CharT>::open(const char* __name, ios_base::openmode __mode,
int __prot)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
char __c_mode[4];
_M_open_mode(__mode, __p_mode, __rw_mode, __c_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;
}
template<typename _CharT>
streamsize
__basic_file<_CharT>::xsgetn(_CharT* __s, streamsize __n)
{ return _IO_file_xsgetn(this, __s, __n); }
// NB: Unused.
template<typename _CharT>
streamsize
__basic_file<_CharT>::sys_read(_CharT* __s, streamsize __n)
{ return _IO_file_read(this, __s, __n); }
// NB: Unused.
template<typename _CharT>
streamsize
__basic_file<_CharT>::sys_write(const _CharT* __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*/) { }
} // namespace std
#endif // _CPP_BASIC_FILE

View file

@ -0,0 +1,187 @@
// Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 27.8 File-based streams
//
#include <bits/basic_file.h>
namespace std
{
// Definitions for __basic_file<char>.
__basic_file<char>::__basic_file(__c_lock* /*__lock*/)
: _M_cfile(NULL), _M_cfile_created(false) { }
__basic_file<char>::~__basic_file()
{ this->close(); }
void
__basic_file<char>::_M_open_mode(ios_base::openmode __mode, int&, int&,
char* __c_mode)
{
bool __testb = __mode & ios_base::binary;
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)
strcpy(__c_mode, "w");
if (!__testi && __testo && !__testt && __testa)
strcpy(__c_mode, "a");
if (!__testi && __testo && __testt && !__testa)
strcpy(__c_mode, "w");
if (__testi && !__testo && !__testt && !__testa)
strcpy(__c_mode, "r");
if (__testi && __testo && !__testt && !__testa)
strcpy(__c_mode, "r+");
if (__testi && __testo && __testt && !__testa)
strcpy(__c_mode, "w+");
if (__testb)
strcat(__c_mode, "b");
}
__basic_file<char>*
__basic_file<char>::sys_open(__c_file* __file, ios_base::openmode)
{
__basic_file* __ret = NULL;
if (!this->is_open() && __file)
{
_M_cfile = __file;
_M_cfile_created = false;
__ret = this;
}
return __ret;
}
__basic_file<char>*
__basic_file<char>::sys_open(int __fd, ios_base::openmode __mode,
bool __del)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
int __rw_mode = 0;
char __c_mode[4];
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
{
// Iff __del is true, then close will fclose the fd.
_M_cfile_created = __del;
if (__fd == 0)
setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
__ret = this;
}
return __ret;
}
int
__basic_file<char>::sys_getc()
{ return getc(_M_cfile); }
int
__basic_file<char>::sys_ungetc(int __c)
{ return ungetc(__c, _M_cfile); }
__basic_file<char>*
__basic_file<char>::open(const char* __name, ios_base::openmode __mode,
int /*__prot*/)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
int __rw_mode = 0;
char __c_mode[4];
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!this->is_open())
{
if ((_M_cfile = fopen(__name, __c_mode)))
{
_M_cfile_created = true;
__ret = this;
}
}
return __ret;
}
bool
__basic_file<char>::is_open() const
{ return _M_cfile != 0; }
int
__basic_file<char>::fd()
{ return fileno(_M_cfile) ; }
__basic_file<char>*
__basic_file<char>::close()
{
__basic_file* __retval = static_cast<__basic_file*>(NULL);
if (this->is_open())
{
fflush(_M_cfile);
if ((_M_cfile_created && fclose(_M_cfile) == 0) || !_M_cfile_created)
{
_M_cfile = 0;
__retval = this;
}
}
return __retval;
}
streamsize
__basic_file<char>::xsgetn(char* __s, streamsize __n)
{ return fread(__s, 1, __n, _M_cfile); }
streamsize
__basic_file<char>::xsputn(const char* __s, streamsize __n)
{ return fwrite(__s, 1, __n, _M_cfile); }
streamoff
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode /*__mode*/)
{
fseek(_M_cfile, __off, __way);
return ftell(_M_cfile);
}
streamoff
__basic_file<char>::seekpos(streamoff __pos, ios_base::openmode /*__mode*/)
{
fseek(_M_cfile, __pos, ios_base::beg);
return ftell(_M_cfile);
}
int
__basic_file<char>::sync()
{ return fflush(_M_cfile); }
} // namespace std

View file

@ -0,0 +1,114 @@
// Wrapper of C-language FILE struct -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 27.8 File-based streams
//
/** @file basic_file.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _CPP_BASIC_FILE
#define _CPP_BASIC_FILE 1
#pragma GCC system_header
#include <bits/c++config.h>
#include <ios>
namespace std
{
// Generic declaration.
template<typename _CharT>
class __basic_file;
// Specialization.
template<>
class __basic_file<char>
{
// Underlying data source/sink.
__c_file* _M_cfile;
// True iff we opened _M_cfile, and thus must close it ourselves.
bool _M_cfile_created;
public:
__basic_file(__c_lock* __lock = 0);
void
_M_open_mode(ios_base::openmode __mode, int& __p_mode, int& __rw_mode,
char* __c_mode);
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
__basic_file*
sys_open(__c_file* __file, ios_base::openmode);
__basic_file*
sys_open(int __fd, ios_base::openmode __mode, bool __del);
int
sys_getc();
int
sys_ungetc(int);
__basic_file*
close();
bool
is_open() const;
int
fd();
~__basic_file();
streamsize
xsputn(const char* __s, streamsize __n);
streamsize
xsgetn(char* __s, streamsize __n);
streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
int
sync();
};
} // namespace std
#endif // _CPP_BASIC_FILE

View file

@ -0,0 +1,113 @@
// underlying io library -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
// c_io_libio.h - Defines for using the GNU libio
#ifndef _CPP_IO_LIBIO_H
#define _CPP_IO_LIBIO_H 1
#include <libio.h>
namespace std
{
// from fpos.h
typedef _IO_ssize_t streamsize; // Signed integral type
typedef _IO_ssize_t wstreamsize;
#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
typedef _IO_off64_t streamoff;
typedef _IO_fpos64_t __c_streampos;
#else
typedef _IO_off_t streamoff;
typedef _IO_fpos_t __c_streampos;
#endif
#ifdef _GLIBCPP_USE_THREADS
typedef _IO_lock_t __c_lock;
#else
typedef int __c_lock;
#endif
// from basic_file.h
typedef _IO_FILE __c_file_type;
typedef _IO_wide_data __c_wfile_type;
#ifdef _GLIBCPP_USE_WCHAR_T
extern "C" _IO_codecvt __c_libio_codecvt;
#endif
// from ios_base.h
struct __ios_flags
{
typedef short __int_type;
static const __int_type _S_boolalpha = _IO_BAD_SEEN;
static const __int_type _S_dec = _IO_DEC;
static const __int_type _S_fixed = _IO_FIXED;
static const __int_type _S_hex = _IO_HEX;
static const __int_type _S_internal = _IO_INTERNAL;
static const __int_type _S_left = _IO_LEFT;
static const __int_type _S_oct = _IO_OCT;
static const __int_type _S_right = _IO_RIGHT;
static const __int_type _S_scientific = _IO_SCIENTIFIC;
static const __int_type _S_showbase = _IO_SHOWBASE;
static const __int_type _S_showpoint = _IO_SHOWPOINT;
static const __int_type _S_showpos = _IO_SHOWPOS;
static const __int_type _S_skipws = _IO_SKIPWS;
static const __int_type _S_unitbuf = _IO_UNITBUF;
static const __int_type _S_uppercase = _IO_UPPERCASE;
static const __int_type _S_adjustfield = _IO_LEFT | _IO_RIGHT
| _IO_INTERNAL;
static const __int_type _S_basefield = _IO_DEC | _IO_OCT | _IO_HEX;
static const __int_type _S_floatfield = _IO_SCIENTIFIC | _IO_FIXED;
// 27.4.2.1.3 Type ios_base::iostate
static const __int_type _S_badbit = _IO_BAD_SEEN;
static const __int_type _S_eofbit = _IO_EOF_SEEN;
static const __int_type _S_failbit = _IO_ERR_SEEN;
// 27.4.2.1.4 Type openmode
static const __int_type _S_app = _IOS_APPEND;
static const __int_type _S_ate = _IOS_ATEND;
static const __int_type _S_bin = _IOS_BIN;
static const __int_type _S_in = _IOS_INPUT;
static const __int_type _S_out = _IOS_OUTPUT;
static const __int_type _S_trunc = _IOS_TRUNC;
};
}
#endif // _CPP_IO_LIBIO_H

View file

@ -0,0 +1,153 @@
/* Copyright (C) 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. */
/* Slightly modified from glibc/libio/iofwide.c */
#include <libio.h>
#ifdef _GLIBCPP_USE_WCHAR_T
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop);
static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep, char *to_start,
char *to_end, char **to_stop);
static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop);
static int
do_encoding(struct _IO_codecvt *codecvt);
static int
do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max);
static int
do_max_length(struct _IO_codecvt *codecvt);
static int
do_always_noconv(struct _IO_codecvt *codecvt);
/* The functions used in `codecvt' for libio are always the same. */
struct _IO_codecvt __c_libio_codecvt =
{
.__codecvt_destr = NULL, /* Destructor, never used. */
.__codecvt_do_out = do_out,
.__codecvt_do_unshift = do_unshift,
.__codecvt_do_in = do_in,
.__codecvt_do_encoding = do_encoding,
.__codecvt_do_always_noconv = do_always_noconv,
.__codecvt_do_length = do_length,
.__codecvt_do_max_length = do_max_length
};
static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop)
{
enum __codecvt_result res = __codecvt_ok;
while (from_start < from_end)
{
if (to_start >= to_end)
{
res = __codecvt_partial;
break;
}
*to_start++ = (char) *from_start++;
}
*from_stop = from_start;
*to_stop = to_start;
return res;
}
static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
char *to_start, char *to_end, char **to_stop)
{
*to_stop = to_start;
return __codecvt_ok;
}
static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop)
{
enum __codecvt_result res = __codecvt_ok;
while (from_start < from_end)
{
if (to_start >= to_end)
{
res = __codecvt_partial;
break;
}
*to_start++ = (wchar_t) *from_start++;
}
*from_stop = from_start;
*to_stop = to_start;
return res;
}
static int
do_encoding(struct _IO_codecvt *codecvt)
{ return 1; }
static int
do_always_noconv(struct _IO_codecvt *codecvt)
{ return 0; }
static int
do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max)
{ return from_end - from_start; }
static int
do_max_length(struct _IO_codecvt *codecvt)
{ return 1; }
#endif /* _GLIBCPP_USE_WCHAR_T */

View file

@ -0,0 +1,93 @@
// underlying io library -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
// c_io_stdio.h - Defines for using "C" stdio.h
#ifndef _CPP_IO_STDIO_H
#define _CPP_IO_STDIO_H 1
#include <cstdio>
#include <cstddef>
#include <bits/gthr.h>
namespace std
{
// for fpos.h
typedef long streamoff;
typedef ptrdiff_t streamsize; // Signed integral type
#if _GLIBCPP_USE_WCHAR_T
typedef ptrdiff_t wstreamsize;
#endif
typedef fpos_t __c_streampos;
typedef __gthread_mutex_t __c_lock;
// for basic_file.h
typedef FILE __c_file;
// for ios_base.h
struct __ios_flags
{
typedef short __int_type;
static const __int_type _S_boolalpha = 0x0001;
static const __int_type _S_dec = 0x0002;
static const __int_type _S_fixed = 0x0004;
static const __int_type _S_hex = 0x0008;
static const __int_type _S_internal = 0x0010;
static const __int_type _S_left = 0x0020;
static const __int_type _S_oct = 0x0040;
static const __int_type _S_right = 0x0080;
static const __int_type _S_scientific = 0x0100;
static const __int_type _S_showbase = 0x0200;
static const __int_type _S_showpoint = 0x0400;
static const __int_type _S_showpos = 0x0800;
static const __int_type _S_skipws = 0x1000;
static const __int_type _S_unitbuf = 0x2000;
static const __int_type _S_uppercase = 0x4000;
static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010;
static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008;
static const __int_type _S_floatfield = 0x0100 | 0x0004;
// 27.4.2.1.3 Type ios_base::iostate
static const __int_type _S_badbit = 0x01;
static const __int_type _S_eofbit = 0x02;
static const __int_type _S_failbit = 0x04;
// 27.4.2.1.4 Type openmode
static const __int_type _S_app = 0x01;
static const __int_type _S_ate = 0x02;
static const __int_type _S_bin = 0x04;
static const __int_type _S_in = 0x08;
static const __int_type _S_out = 0x10;
static const __int_type _S_trunc = 0x20;
};
}
#endif // _CPP_IO_STDIO_H

View file

@ -0,0 +1,7 @@
#
# This is a placeholder file. It does nothing and is not used.
#
# If you are seeing this file as your linker script (named linker.map), then
# either 1) the configuration process determined that symbol versioning should
# not be done, or 2) you specifically turned it off.
#

View file

@ -0,0 +1,113 @@
## Linker script for GNU ld 2.11.94+ only.
##
## Copyright (C) 2002 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
##
## This file is part of the GNU ISO C++ Library. This library is free
## software; you can redistribute it and/or modify it under the
## 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.
GLIBCPP_3.1 {
global:
# Names inside the 'extern' block are demangled names.
# All but the last are terminated with a semicolon.
extern "C++"
{
std::[A-Za-z]*;
std::__throw_*;
std::__basic_file*;
std::__num_base*;
std::__timepunct*;
std::__numeric_limits_base*;
std::_S_bit_count;
std::_S_first_one;
std::__default_alloc_template*;
std::__malloc_alloc_template*
};
# Names not in an 'extern' block are mangled names.
_ZSt9has_facet*;
# operator new(unsigned)
_Znwj;
# operator new(unsigned, std::nothrow_t const&)
_ZnwjRKSt9nothrow_t;
# operator new(unsigned long)
_Znwm;
# operator new(unsigned long, std::nothrow_t const&)
_ZnwmRKSt9nothrow_t;
# operator delete(void*)
_ZdlPv;
# operator delete(void*, std::nothrow_t const&)
_ZdlPvRKSt9nothrow_t;
# operator new[](unsigned)
_Znaj;
# operator new[](unsigned, std::nothrow_t const&)
_ZnajRKSt9nothrow_t;
# operator new[](unsigned long)
_Znam;
# operator new[](unsigned long, std::nothrow_t const&)
_ZnamRKSt9nothrow_t;
# operator delete[](void*)
_ZdaPv;
# operator delete[](void*, std::nothrow_t const&)
_ZdaPvRKSt9nothrow_t;
# vtable
_ZTV*;
_ZTT*;
# typeinfo
_ZTI*;
_ZTS*;
# function-scope static objects requires a guard variable.
_ZGV*;
# virtual function thunks
_ZTh*;
_ZTv*;
_ZTc*;
# std::__convert_to_v
_ZSt14__convert_to_v*;
local:
*;
};
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1 {
global:
__cxa_*;
__gxx_personality_v0;
__gxx_personality_sj0;
__dynamic_cast;
# __gnu_cxx::_verbose_terminate_handler()
_ZN9__gnu_cxx27__verbose_terminate_handlerEv;
local:
*;
};

View file

@ -0,0 +1,220 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#ifdef _GLIBCPP_HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
namespace std
{
// Specializations for all types used in num_get.
template<>
void
__convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
const __c_locale&, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long __l = strtol(__s, &__sanity, __base);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __l;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, unsigned long& __v,
ios_base::iostate& __err, const __c_locale&, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
unsigned long __ul = strtoul(__s, &__sanity, __base);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ul;
else
__err |= ios_base::failbit;
}
}
#ifdef _GLIBCPP_USE_LONG_LONG
template<>
void
__convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
const __c_locale&, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long long __ll = strtoll(__s, &__sanity, __base);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ll;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, unsigned long long& __v,
ios_base::iostate& __err, const __c_locale&, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
unsigned long long __ull = strtoull(__s, &__sanity, __base);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ull;
else
__err |= ios_base::failbit;
}
}
#endif
template<>
void
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
const __c_locale&, int)
{
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
char* __sanity;
errno = 0;
#if defined(_GLIBCPP_USE_C99)
float __f = strtof(__s, &__sanity);
#else
double __d = strtod(__s, &__sanity);
float __f = static_cast<float>(__d);
#ifdef _GLIBCPP_HAVE_FINITEF
if (!finitef (__f))
errno = ERANGE;
#elif defined (_GLIBCPP_HAVE_FINITE)
if (!finite (static_cast<double> (__f)))
errno = ERANGE;
#elif defined (_GLIBCPP_HAVE_ISINF)
if (isinf (static_cast<double> (__f)))
errno = ERANGE;
#else
if (fabs(__d) > numeric_limits<float>::max())
errno = ERANGE;
#endif
#endif
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __f;
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
}
}
template<>
void
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
const __c_locale&, int)
{
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
char* __sanity;
errno = 0;
double __d = strtod(__s, &__sanity);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __d;
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
}
}
template<>
void
__convert_to_v(const char* __s, long double& __v,
ios_base::iostate& __err, const __c_locale&, int)
{
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
#if defined(_GLIBCPP_USE_C99)
char* __sanity;
errno = 0;
long double __ld = strtold(__s, &__sanity);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ld;
#else
typedef char_traits<char>::int_type int_type;
long double __ld;
errno = 0;
int __p = sscanf(__s, "%Lf", &__ld);
if (errno == ERANGE)
__p = 0;
#ifdef _GLIBCPP_HAVE_FINITEL
if ((__p == 1) && !finitel (__ld))
__p = 0;
#endif
if (__p && static_cast<int_type>(__p) != char_traits<char>::eof())
__v = __ld;
#endif
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
}
}
void
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char*,
__c_locale)
{ __cloc = NULL; }
void
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
{ __cloc = NULL; }
__c_locale
locale::facet::_S_clone_c_locale(__c_locale&)
{ return __c_locale(); }
} // namespace std

View file

@ -0,0 +1,41 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <clocale>
namespace std
{
typedef int* __c_locale;
}

View file

@ -0,0 +1,38 @@
// Locale support (codecvt) -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.1.5 Template class codecvt
//
// Warning: this file is not meant for user inclusion. Use <locale>.
// Written by Benjamin Kosnik <bkoz@cygnus.com>
// XXX dummy file

View file

@ -0,0 +1,72 @@
// std::collate implementation details, generic version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// These are basically extensions to char_traits, and perhaps should
// be put there instead of here.
template<>
int
collate<char>::_M_compare(const char* __one, const char* __two) const
{
int __cmp = strcoll(__one, __two);
return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
}
template<>
size_t
collate<char>::_M_transform(char* __to, const char* __from,
size_t __n) const
{ return strxfrm(__to, __from, __n); }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
int
collate<wchar_t>::_M_compare(const wchar_t* __one,
const wchar_t* __two) const
{
int __cmp = wcscoll(__one, __two);
return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
}
template<>
size_t
collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
size_t __n) const
{ return wcsxfrm(__to, __from, __n); }
#endif
}

View file

@ -0,0 +1,195 @@
// std::ctype implementation details, generic version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// NB: The other ctype<char> specializations are in src/locale.cc and
// various /config/os/* files.
template<>
ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
: ctype<char>(0, false, __refs)
{
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
}
#ifdef _GLIBCPP_USE_WCHAR_T
ctype<wchar_t>::__wmask_type
ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
{
__wmask_type __ret;
switch (__m)
{
case space:
__ret = wctype("space");
break;
case print:
__ret = wctype("print");
break;
case cntrl:
__ret = wctype("cntrl");
break;
case upper:
__ret = wctype("upper");
break;
case lower:
__ret = wctype("lower");
break;
case alpha:
__ret = wctype("alpha");
break;
case digit:
__ret = wctype("digit");
break;
case punct:
__ret = wctype("punct");
break;
case xdigit:
__ret = wctype("xdigit");
break;
case alnum:
__ret = wctype("alnum");
break;
case graph:
__ret = wctype("graph");
break;
default:
__ret = 0;
}
return __ret;
};
wchar_t
ctype<wchar_t>::do_toupper(wchar_t __c) const
{ return towupper(__c); }
const wchar_t*
ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi)
{
*__lo = towupper(*__lo);
++__lo;
}
return __hi;
}
wchar_t
ctype<wchar_t>::do_tolower(wchar_t __c) const
{ return towlower(__c); }
const wchar_t*
ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi)
{
*__lo = towlower(*__lo);
++__lo;
}
return __hi;
}
bool
ctype<wchar_t>::
do_is(mask __m, char_type __c) const
{ return static_cast<bool>(iswctype(__c, _M_convert_to_wmask(__m))); }
const wchar_t*
ctype<wchar_t>::
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __m) const
{
while (__lo < __hi && !this->do_is(*__m, *__lo))
++__lo;
return __lo;
}
const wchar_t*
ctype<wchar_t>::
do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi && !this->do_is(__m, *__lo))
++__lo;
return __lo;
}
const wchar_t*
ctype<wchar_t>::
do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{
while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++__lo;
return __lo;
}
wchar_t
ctype<wchar_t>::
do_widen(char __c) const
{ return btowc(__c); }
const char*
ctype<wchar_t>::
do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
return __hi;
}
char
ctype<wchar_t>::
do_narrow(wchar_t __wc, char __dfault) const
{
int __c = wctob(__wc);
return (__c == EOF ? __dfault : static_cast<char>(__c));
}
const wchar_t*
ctype<wchar_t>::
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __len = __hi - __lo;
size_t __conv = wcsrtombs(__dest, &__lo, __len, &__state);
if (__conv == __len)
*__dest = __dfault;
return __hi;
}
#endif // _GLIBCPP_USE_WCHAR_T
}

View file

@ -0,0 +1,45 @@
// std::messages implementation details, generic version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// Specializations
template<>
string
messages<char>::do_get(catalog, int, int, const string& __dfault) const
{ return __dfault; }
}

View file

@ -0,0 +1,58 @@
// std::messages implementation details, generic version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
// Non-virtual member functions.
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char*) const
{ return this->do_open(__s, __loc); }
// Virtual member functions.
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
{ return 0; }
template<typename _CharT>
typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog, int, int,
const string_type& __dfault) const
{ return __dfault; }
template<typename _CharT>
void
messages<_CharT>::do_close(catalog) const
{ }

View file

@ -0,0 +1,127 @@
// std::moneypunct implementation details, generic version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
money_base::pattern
money_base::_S_construct_pattern(char, char, char)
{ return _S_default_pattern; }
template<>
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_curr_symbol = "";
_M_positive_sign = "";
_M_negative_sign = "";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_curr_symbol = "";
_M_positive_sign = "";
_M_negative_sign = "";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
template<>
moneypunct<char, true>::~moneypunct()
{ }
template<>
moneypunct<char, false>::~moneypunct()
{ }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_curr_symbol = L"";
_M_positive_sign = L"";
_M_negative_sign = L"";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_curr_symbol = L"";
_M_positive_sign = L"";
_M_negative_sign = L"";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
template<>
moneypunct<wchar_t, true>::~moneypunct()
{ }
template<>
moneypunct<wchar_t, false>::~moneypunct()
{ }
#endif
}

View file

@ -0,0 +1,73 @@
// std::numpunct implementation details, generic version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
template<>
void
numpunct<char>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_truename = "true";
_M_falsename = "false";
}
template<>
numpunct<char>::~numpunct()
{ }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_truename = L"true";
_M_falsename = L"false";
}
template<>
numpunct<wchar_t>::~numpunct()
{ }
#endif
}

View file

@ -0,0 +1,202 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
template<>
__timepunct<char>::~__timepunct()
{
if (_M_c_locale_timepunct != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_timepunct);
}
template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
const tm* __tm) const
{
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
strftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
}
template<>
void
__timepunct<char>::_M_initialize_timepunct(__c_locale)
{
// "C" locale
_M_date_format = "%m/%d/%Y";
_M_date_era_format = "%m/%d/%Y";
_M_time_format = "%H:%M:%S";
_M_time_era_format = "%H:%M:%S";
_M_date_time_format = "";
_M_date_time_era_format = "";
_M_am = "AM";
_M_pm = "PM";
_M_am_pm_format = "";
// Day names, starting with "C"'s Sunday.
_M_day1 = "Sunday";
_M_day2 = "Monday";
_M_day3 = "Tuesday";
_M_day4 = "Wednesday";
_M_day5 = "Thursday";
_M_day6 = "Friday";
_M_day7 = "Saturday";
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = "Sun";
_M_day_a2 = "Mon";
_M_day_a3 = "Tue";
_M_day_a4 = "Wed";
_M_day_a5 = "Thu";
_M_day_a6 = "Fri";
_M_day_a7 = "Sat";
// Month names, starting with "C"'s January.
_M_month01 = "January";
_M_month02 = "February";
_M_month03 = "March";
_M_month04 = "April";
_M_month05 = "May";
_M_month06 = "June";
_M_month07 = "July";
_M_month08 = "August";
_M_month09 = "September";
_M_month10 = "October";
_M_month11 = "November";
_M_month12 = "December";
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = "Jan";
_M_month_a02 = "Feb";
_M_month_a03 = "Mar";
_M_month_a04 = "Apr";
_M_month_a05 = "May";
_M_month_a06 = "Jun";
_M_month_a07 = "July";
_M_month_a08 = "Aug";
_M_month_a09 = "Sep";
_M_month_a10 = "Oct";
_M_month_a11 = "Nov";
_M_month_a12 = "Dec";
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
__timepunct<wchar_t>::~__timepunct()
{
if (_M_c_locale_timepunct != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_timepunct);
}
template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
const tm* __tm) const
{
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
wcsftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
}
template<>
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale)
{
// "C" locale
_M_date_format = L"%m/%d/%y";
_M_date_era_format = L"%m/%d/%y";
_M_time_format = L"%H:%M:%S";
_M_time_era_format = L"%H:%M:%S";
_M_date_time_format = L"";
_M_date_time_era_format = L"";
_M_am = L"AM";
_M_pm = L"PM";
_M_am_pm_format = L"";
// Day names, starting with "C"'s Sunday.
_M_day1 = L"Sunday";
_M_day2 = L"Monday";
_M_day3 = L"Tuesday";
_M_day4 = L"Wednesday";
_M_day5 = L"Thursday";
_M_day6 = L"Friday";
_M_day7 = L"Saturday";
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = L"Sun";
_M_day_a2 = L"Mon";
_M_day_a3 = L"Tue";
_M_day_a4 = L"Wed";
_M_day_a5 = L"Thu";
_M_day_a6 = L"Fri";
_M_day_a7 = L"Sat";
// Month names, starting with "C"'s January.
_M_month01 = L"January";
_M_month02 = L"February";
_M_month03 = L"March";
_M_month04 = L"April";
_M_month05 = L"May";
_M_month06 = L"June";
_M_month07 = L"July";
_M_month08 = L"August";
_M_month09 = L"September";
_M_month10 = L"October";
_M_month11 = L"November";
_M_month12 = L"December";
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = L"Jan";
_M_month_a02 = L"Feb";
_M_month_a03 = L"Mar";
_M_month_a04 = L"Apr";
_M_month_a05 = L"May";
_M_month_a06 = L"Jun";
_M_month_a07 = L"July";
_M_month_a08 = L"Aug";
_M_month_a09 = L"Sep";
_M_month_a10 = L"Oct";
_M_month_a11 = L"Nov";
_M_month_a12 = L"Dec";
}
#endif
}

View file

@ -0,0 +1,185 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include <stdexcept>
#include <langinfo.h>
namespace std
{
template<>
void
__convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
const __c_locale& __cloc, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long __l = __strtol_l(__s, &__sanity, __base, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __l;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, unsigned long& __v,
ios_base::iostate& __err, const __c_locale& __cloc,
int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ul;
else
__err |= ios_base::failbit;
}
}
#ifdef _GLIBCPP_USE_LONG_LONG
template<>
void
__convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
const __c_locale& __cloc, int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ll;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, unsigned long long& __v,
ios_base::iostate& __err, const __c_locale& __cloc,
int __base)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
__cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ull;
else
__err |= ios_base::failbit;
}
}
#endif
template<>
void
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
const __c_locale& __cloc, int)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
float __f = __strtof_l(__s, &__sanity, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __f;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
const __c_locale& __cloc, int)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
double __d = __strtod_l(__s, &__sanity, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __d;
else
__err |= ios_base::failbit;
}
}
template<>
void
__convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
const __c_locale& __cloc, int)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long double __ld = __strtold_l(__s, &__sanity, __cloc);
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
__v = __ld;
else
__err |= ios_base::failbit;
}
}
void
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
__c_locale __old)
{
__cloc = __newlocale(1 << LC_ALL, __s, __old);
if (!__cloc)
{
// This named locale is not supported by the underlying OS.
__throw_runtime_error("attempt to create locale from unknown name");
}
}
void
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
{ __freelocale(__cloc); }
__c_locale
locale::facet::_S_clone_c_locale(__c_locale& __cloc)
{ return __duplocale(__cloc); }
} // namespace std

View file

@ -0,0 +1,46 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <clocale>
#include <langinfo.h> // For codecvt
#include <iconv.h> // For codecvt using iconv, iconv_t
#include <libintl.h> // For messages
#define _GLIBCPP_C_LOCALE_GNU 1
namespace std
{
typedef __locale_t __c_locale;
}

View file

@ -0,0 +1,72 @@
// std::collate implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// These are basically extensions to char_traits, and perhaps should
// be put there instead of here.
template<>
int
collate<char>::_M_compare(const char* __one, const char* __two) const
{
int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
}
template<>
size_t
collate<char>::_M_transform(char* __to, const char* __from,
size_t __n) const
{ return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
int
collate<wchar_t>::_M_compare(const wchar_t* __one,
const wchar_t* __two) const
{
int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
}
template<>
size_t
collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
size_t __n) const
{ return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
#endif
}

View file

@ -0,0 +1,202 @@
// std::ctype implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// NB: The other ctype<char> specializations are in src/locale.cc and
// various /config/os/* files.
template<>
ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
: ctype<char>(0, false, __refs)
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = _M_c_locale_ctype->__ctype_b;
}
#ifdef _GLIBCPP_USE_WCHAR_T
ctype<wchar_t>::__wmask_type
ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
{
__wmask_type __ret;
switch (__m)
{
case space:
__ret = __wctype_l("space", _M_c_locale_ctype);
break;
case print:
__ret = __wctype_l("print", _M_c_locale_ctype);
break;
case cntrl:
__ret = __wctype_l("cntrl", _M_c_locale_ctype);
break;
case upper:
__ret = __wctype_l("upper", _M_c_locale_ctype);
break;
case lower:
__ret = __wctype_l("lower", _M_c_locale_ctype);
break;
case alpha:
__ret = __wctype_l("alpha", _M_c_locale_ctype);
break;
case digit:
__ret = __wctype_l("digit", _M_c_locale_ctype);
break;
case punct:
__ret = __wctype_l("punct", _M_c_locale_ctype);
break;
case xdigit:
__ret = __wctype_l("xdigit", _M_c_locale_ctype);
break;
case alnum:
__ret = __wctype_l("alnum", _M_c_locale_ctype);
break;
case graph:
__ret = __wctype_l("graph", _M_c_locale_ctype);
break;
default:
__ret = 0;
}
return __ret;
};
wchar_t
ctype<wchar_t>::do_toupper(wchar_t __c) const
{ return __towupper_l(__c, _M_c_locale_ctype); }
const wchar_t*
ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi)
{
*__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++__lo;
}
return __hi;
}
wchar_t
ctype<wchar_t>::do_tolower(wchar_t __c) const
{ return __towlower_l(__c, _M_c_locale_ctype); }
const wchar_t*
ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi)
{
*__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++__lo;
}
return __hi;
}
bool
ctype<wchar_t>::
do_is(mask __m, char_type __c) const
{
return static_cast<bool>(__iswctype_l(__c, _M_convert_to_wmask(__m),
_M_c_locale_ctype));
}
const wchar_t*
ctype<wchar_t>::
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __m) const
{
while (__lo < __hi && !this->do_is(*__m, *__lo))
++__lo;
return __lo;
}
const wchar_t*
ctype<wchar_t>::
do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
{
while (__lo < __hi && !this->do_is(__m, *__lo))
++__lo;
return __lo;
}
const wchar_t*
ctype<wchar_t>::
do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{
while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++__lo;
return __lo;
}
wchar_t
ctype<wchar_t>::
do_widen(char __c) const
{ return btowc(__c); }
const char*
ctype<wchar_t>::
do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
return __hi;
}
char
ctype<wchar_t>::
do_narrow(wchar_t __wc, char __dfault) const
{
int __c = wctob(__wc);
return (__c == EOF ? __dfault : static_cast<char>(__c));
}
const wchar_t*
ctype<wchar_t>::
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __len = __hi - __lo;
size_t __conv = wcsrtombs(__dest, &__lo, __len, &__state);
if (__conv == __len)
*__dest = __dfault;
return __hi;
}
#endif // _GLIBCPP_USE_WCHAR_T
}

View file

@ -0,0 +1,57 @@
// std::messages implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// Specializations.
template<>
string
messages<char>::do_get(catalog, int, int, const string& __dfault) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_messages);
const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
__uselocale(__old);
return string(__msg);
#else
const char* __old = setlocale(LC_ALL, _M_name_messages);
const char* __msg = gettext(__dfault.c_str());
setlocale(LC_ALL, __old);
return string(__msg);
#endif
}
}

View file

@ -0,0 +1,78 @@
// std::messages implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
// Non-virtual member functions.
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char* __dir) const
{
bindtextdomain(__s.c_str(), __dir);
return this->do_open(__s, __loc);
}
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __s,
const locale&) const
{
// No error checking is done, assume the catalog exists and can
// be used.
textdomain(__s.c_str());
return 0;
}
template<typename _CharT>
typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog, int, int,
const string_type& __dfault) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
__uselocale(__old);
return _M_convert_from_char(__msg);
#else
const char* __old = setlocale(LC_ALL, _M_name_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
setlocale(LC_ALL, __old);
return _M_convert_from_char(__msg);
#endif
}
template<typename _CharT>
void
messages<_CharT>::do_close(catalog) const
{ }

View file

@ -0,0 +1,501 @@
// std::moneypunct implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
money_base::pattern
money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
{
pattern __ret;
// This insanely complicated routine attempts to construct a valid
// pattern for use with monyepunct. A couple of invariants:
// if (__precedes) symbol -> value
// else value -> symbol
// if (__space) space
// else none
// none == never first
// space never first or last
// Any elegant implementations of this are welcome.
switch (__posn)
{
case 0:
case 1:
// 1 The sign precedes the value and symbol.
if (__space)
{
// Pattern starts with sign.
if (__precedes)
{
__ret.field[1] = symbol;
__ret.field[2] = space;
__ret.field[3] = value;
}
else
{
__ret.field[1] = value;
__ret.field[2] = space;
__ret.field[3] = symbol;
}
__ret.field[0] = sign;
}
else
{
// Pattern starts with sign and ends with none.
if (__precedes)
{
__ret.field[1] = symbol;
__ret.field[2] = value;
}
else
{
__ret.field[1] = value;
__ret.field[2] = symbol;
}
__ret.field[0] = sign;
__ret.field[3] = none;
}
break;
case 2:
// 2 The sign follows the value and symbol.
if (__space)
{
// Pattern either ends with sign.
if (__precedes)
{
__ret.field[0] = symbol;
__ret.field[1] = space;
__ret.field[2] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = space;
__ret.field[2] = symbol;
}
__ret.field[3] = sign;
}
else
{
// Pattern ends with sign then none.
if (__precedes)
{
__ret.field[0] = symbol;
__ret.field[1] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = symbol;
}
__ret.field[2] = sign;
__ret.field[3] = none;
}
break;
case 3:
// 3 The sign immediately precedes the symbol.
if (__space)
{
// Have space.
if (__precedes)
{
__ret.field[0] = sign;
__ret.field[1] = symbol;
__ret.field[2] = space;
__ret.field[3] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = space;
__ret.field[2] = sign;
__ret.field[3] = symbol;
}
}
else
{
// Have none.
if (__precedes)
{
__ret.field[0] = sign;
__ret.field[1] = symbol;
__ret.field[2] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = sign;
__ret.field[2] = symbol;
}
__ret.field[3] = none;
}
break;
case 4:
// 4 The sign immediately follows the symbol.
if (__space)
{
// Have space.
if (__precedes)
{
__ret.field[0] = symbol;
__ret.field[1] = sign;
__ret.field[2] = space;
__ret.field[3] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = space;
__ret.field[2] = symbol;
__ret.field[3] = sign;
}
}
else
{
// Have none.
if (__precedes)
{
__ret.field[0] = symbol;
__ret.field[1] = sign;
__ret.field[2] = value;
}
else
{
__ret.field[0] = value;
__ret.field[1] = symbol;
__ret.field[2] = sign;
}
__ret.field[3] = none;
}
break;
default:
;
}
return __ret;
}
template<>
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_curr_symbol = "";
_M_positive_sign = "";
_M_negative_sign = "";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
if (!__nposn)
_M_negative_sign = "()";
else
_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
// _Intl == true
_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
}
}
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_curr_symbol = "";
_M_positive_sign = "";
_M_negative_sign = "";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
if (!__nposn)
_M_negative_sign = "()";
else
_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
// _Intl == false
_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
}
}
template<>
moneypunct<char, true>::~moneypunct()
{ }
template<>
moneypunct<char, false>::~moneypunct()
{ }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_curr_symbol = L"";
_M_positive_sign = L"";
_M_negative_sign = L"";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
_M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
mbstate_t __state;
size_t __len;
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
// NB: Should swich to __cloc's ctype info first.
__len = strlen(__cpossign);
if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
_M_positive_sign = __wcs;
}
else
_M_positive_sign = L"";
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
__len = strlen(__cnegsign);
if (!__nposn)
_M_negative_sign = L"()";
else if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
_M_negative_sign = __wcs;
}
else
_M_negative_sign = L"";
// _Intl == true.
__len = strlen(__ccurr);
if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__ccurr, __len, &__state);
_M_curr_symbol = __wcs;
}
else
_M_curr_symbol = L"";
_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
}
}
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_curr_symbol = L"";
_M_positive_sign = L"";
_M_negative_sign = L"";
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
_M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
mbstate_t __state;
size_t __len;
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
// NB: Should swich to __cloc's ctype info first.
__len = strlen(__cpossign);
if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
_M_positive_sign = __wcs;
}
else
_M_positive_sign = L"";
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
__len = strlen(__cnegsign);
if (!__nposn)
_M_negative_sign = L"()";
else if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
_M_negative_sign = __wcs;
}
else
_M_negative_sign = L"";
// _Intl == true.
__len = strlen(__ccurr);
if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__ccurr, __len, &__state);
_M_curr_symbol = __wcs;
}
else
_M_curr_symbol = L"";
_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
}
}
template<>
moneypunct<wchar_t, true>::~moneypunct()
{
if (wcslen(_M_positive_sign))
delete [] _M_positive_sign;
if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
delete [] _M_negative_sign;
if (wcslen(_M_curr_symbol))
delete [] _M_curr_symbol;
}
template<>
moneypunct<wchar_t, false>::~moneypunct()
{
if (wcslen(_M_positive_sign))
delete [] _M_positive_sign;
if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
delete [] _M_negative_sign;
if (wcslen(_M_curr_symbol))
delete [] _M_curr_symbol;
}
#endif
}

View file

@ -0,0 +1,106 @@
// std::numpunct implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
template<>
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
}
else
{
// Named locale.
_M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
_M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
// Check for NUL, which implies no grouping.
if (_M_thousands_sep == '\0')
_M_grouping = "";
else
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
_M_truename = "true";
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
_M_falsename = "false";
}
template<>
numpunct<char>::~numpunct()
{ }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
}
else
{
// Named locale.
_M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
if (_M_thousands_sep == L'\0')
_M_grouping = "";
else
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
_M_truename = L"true";
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
_M_falsename = L"false";
}
template<>
numpunct<wchar_t>::~numpunct()
{ }
#endif
}

View file

@ -0,0 +1,336 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
template<>
__timepunct<char>::~__timepunct()
{
if (_M_c_locale_timepunct != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_timepunct);
}
template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
const tm* __tm) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__strftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
#else
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
strftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
#endif
}
template<>
void
__timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_date_format = "%m/%d/%y";
_M_date_era_format = "%m/%d/%y";
_M_time_format = "%H:%M:%S";
_M_time_era_format = "%H:%M:%S";
_M_date_time_format = "";
_M_date_time_era_format = "";
_M_am = "AM";
_M_pm = "PM";
_M_am_pm_format = "";
// Day names, starting with "C"'s Sunday.
_M_day1 = "Sunday";
_M_day2 = "Monday";
_M_day3 = "Tuesday";
_M_day4 = "Wednesday";
_M_day5 = "Thursday";
_M_day6 = "Friday";
_M_day7 = "Saturday";
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = "Sun";
_M_day_a2 = "Mon";
_M_day_a3 = "Tue";
_M_day_a4 = "Wed";
_M_day_a5 = "Thu";
_M_day_a6 = "Fri";
_M_day_a7 = "Sat";
// Month names, starting with "C"'s January.
_M_month01 = "January";
_M_month02 = "February";
_M_month03 = "March";
_M_month04 = "April";
_M_month05 = "May";
_M_month06 = "June";
_M_month07 = "July";
_M_month08 = "August";
_M_month09 = "September";
_M_month10 = "October";
_M_month11 = "November";
_M_month12 = "December";
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = "Jan";
_M_month_a02 = "Feb";
_M_month_a03 = "Mar";
_M_month_a04 = "Apr";
_M_month_a05 = "May";
_M_month_a06 = "Jun";
_M_month_a07 = "July";
_M_month_a08 = "Aug";
_M_month_a09 = "Sep";
_M_month_a10 = "Oct";
_M_month_a11 = "Nov";
_M_month_a12 = "Dec";
}
else
{
_M_c_locale_timepunct = _S_clone_c_locale(__cloc);
_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
_M_am = __nl_langinfo_l(AM_STR, __cloc);
_M_pm = __nl_langinfo_l(PM_STR, __cloc);
_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
// Day names, starting with "C"'s Sunday.
_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
_M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
_M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
_M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
_M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
_M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
_M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
// Month names, starting with "C"'s January.
_M_month01 = __nl_langinfo_l(MON_1, __cloc);
_M_month02 = __nl_langinfo_l(MON_2, __cloc);
_M_month03 = __nl_langinfo_l(MON_3, __cloc);
_M_month04 = __nl_langinfo_l(MON_4, __cloc);
_M_month05 = __nl_langinfo_l(MON_5, __cloc);
_M_month06 = __nl_langinfo_l(MON_6, __cloc);
_M_month07 = __nl_langinfo_l(MON_7, __cloc);
_M_month08 = __nl_langinfo_l(MON_8, __cloc);
_M_month09 = __nl_langinfo_l(MON_9, __cloc);
_M_month10 = __nl_langinfo_l(MON_10, __cloc);
_M_month11 = __nl_langinfo_l(MON_11, __cloc);
_M_month12 = __nl_langinfo_l(MON_12, __cloc);
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
_M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
_M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
_M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
_M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
_M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
_M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
_M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
_M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
_M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
_M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
_M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
}
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
__timepunct<wchar_t>::~__timepunct()
{
if (_M_c_locale_timepunct != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_timepunct);
}
template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
const tm* __tm) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__wcsftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
#else
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
wcsftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
#endif
}
template<>
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
{
if (__cloc == _S_c_locale)
{
// "C" locale
_M_date_format = L"%m/%d/%y";
_M_date_era_format = L"%m/%d/%y";
_M_time_format = L"%H:%M:%S";
_M_time_era_format = L"%H:%M:%S";
_M_date_time_format = L"";
_M_date_time_era_format = L"";
_M_am = L"AM";
_M_pm = L"PM";
_M_am_pm_format = L"";
// Day names, starting with "C"'s Sunday.
_M_day1 = L"Sunday";
_M_day2 = L"Monday";
_M_day3 = L"Tuesday";
_M_day4 = L"Wednesday";
_M_day5 = L"Thursday";
_M_day6 = L"Friday";
_M_day7 = L"Saturday";
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = L"Sun";
_M_day_a2 = L"Mon";
_M_day_a3 = L"Tue";
_M_day_a4 = L"Wed";
_M_day_a5 = L"Thu";
_M_day_a6 = L"Fri";
_M_day_a7 = L"Sat";
// Month names, starting with "C"'s January.
_M_month01 = L"January";
_M_month02 = L"February";
_M_month03 = L"March";
_M_month04 = L"April";
_M_month05 = L"May";
_M_month06 = L"June";
_M_month07 = L"July";
_M_month08 = L"August";
_M_month09 = L"September";
_M_month10 = L"October";
_M_month11 = L"November";
_M_month12 = L"December";
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = L"Jan";
_M_month_a02 = L"Feb";
_M_month_a03 = L"Mar";
_M_month_a04 = L"Apr";
_M_month_a05 = L"May";
_M_month_a06 = L"Jun";
_M_month_a07 = L"July";
_M_month_a08 = L"Aug";
_M_month_a09 = L"Sep";
_M_month_a10 = L"Oct";
_M_month_a11 = L"Nov";
_M_month_a12 = L"Dec";
}
else
{
_M_c_locale_timepunct = _S_clone_c_locale(__cloc);
_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
// Day names, starting with "C"'s Sunday.
_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
// Abbreviated day names, starting with "C"'s Sun.
_M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
_M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
_M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
_M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
_M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
_M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
_M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
// Month names, starting with "C"'s January.
_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
// Abbreviated month names, starting with "C"'s Jan.
_M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
_M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
_M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
_M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
_M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
_M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
_M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
_M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
_M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
_M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
_M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
_M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
}
}
#endif
}

View file

@ -0,0 +1,112 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
void
locale::facet::_S_create_c_locale(__c_locale&, const char*, __c_locale*)
{ }
void
locale::facet::_S_destroy_c_locale(__c_locale&)
{ }
__c_locale
locale::facet::_S_clone_c_locale(__c_locale&)
{ return __c_locale(); }
template<>
void
numpunct<char>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_truename = "true";
_M_falsename = "false";
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_truename = L"true";
_M_falsename = L"false";
}
#endif
template<>
void
moneypunct<char>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = '.';
_M_thousands_sep = ',';
_M_grouping = "";
_M_curr_symbol = string_type();
_M_positive_sign = string_type();
_M_negative_sign = string_type();
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t>::_M_initialize_moneypunct(__c_locale)
{
// "C" locale
_M_decimal_point = L'.';
_M_thousands_sep = L',';
_M_grouping = "";
_M_curr_symbol = string_type();
_M_positive_sign = string_type();
_M_negative_sign = string_type();
_M_frac_digits = 0;
_M_pos_format = money_base::_S_default_pattern;
_M_neg_format = money_base::_S_default_pattern;
}
#endif
} // namespace std

View file

@ -0,0 +1,44 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.8 Standard locale categories.
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <clocale>
#include <langinfo.h> // For codecvt
#include <iconv.h> // For codecvt using iconv, iconv_t
#include <nl_types.h> // For messages
namespace std
{
typedef int* __c_locale;
}

View file

@ -0,0 +1,460 @@
// Locale support (codecvt) -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.1.5 Template class codecvt
//
// Warning: this file is not meant for user inclusion. Use <locale>.
// Written by Benjamin Kosnik <bkoz@cygnus.com>
// XXX
// Define this here to codecvt.cc can have _S_max_size definition.
#define _GLIBCPP_USE___ENC_TRAITS 1
// Extension to use icov for dealing with character encodings,
// including conversions and comparisons between various character
// sets. This object encapsulates data that may need to be shared between
// char_traits, codecvt and ctype.
class __enc_traits
{
public:
// Types:
// NB: A conversion descriptor subsumes and enhances the
// functionality of a simple state type such as mbstate_t.
typedef iconv_t __desc_type;
protected:
// Data Members:
// Max size of charset encoding name
static const int _S_max_size = 32;
// Name of internal character set encoding.
char _M_int_enc[_S_max_size];
// Name of external character set encoding.
char _M_ext_enc[_S_max_size];
// Conversion descriptor between external encoding to internal encoding.
__desc_type _M_in_desc;
// Conversion descriptor between internal encoding to external encoding.
__desc_type _M_out_desc;
// Details the byte-order marker for the external encoding, if necessary.
int _M_ext_bom;
// Details the byte-order marker for the internal encoding, if necessary.
int _M_int_bom;
public:
explicit __enc_traits()
: _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
{
memset(_M_int_enc, 0, _S_max_size);
memset(_M_ext_enc, 0, _S_max_size);
}
explicit __enc_traits(const char* __int, const char* __ext,
int __ibom = 0, int __ebom = 0)
: _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
{
strncpy(_M_int_enc, __int, _S_max_size);
strncpy(_M_ext_enc, __ext, _S_max_size);
}
// 21.1.2 traits typedefs
// p4
// typedef STATE_T state_type
// requires: state_type shall meet the requirements of
// CopyConstructible types (20.1.3)
__enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
{
strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
_M_ext_bom = __obj._M_ext_bom;
_M_int_bom = __obj._M_int_bom;
}
// Need assignment operator as well.
__enc_traits&
operator=(const __enc_traits& __obj)
{
strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
_M_in_desc = 0;
_M_out_desc = 0;
_M_ext_bom = __obj._M_ext_bom;
_M_int_bom = __obj._M_int_bom;
}
~__enc_traits()
{
__desc_type __err = reinterpret_cast<iconv_t>(-1);
if (_M_in_desc && _M_in_desc != __err)
iconv_close(_M_in_desc);
if (_M_out_desc && _M_out_desc != __err)
iconv_close(_M_out_desc);
}
void
_M_init()
{
const __desc_type __err = reinterpret_cast<iconv_t>(-1);
if (!_M_in_desc)
{
_M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
if (_M_in_desc == __err)
__throw_runtime_error("creating iconv input descriptor failed.");
}
if (!_M_out_desc)
{
_M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
if (_M_out_desc == __err)
__throw_runtime_error("creating iconv output descriptor failed.");
}
}
bool
_M_good()
{
const __desc_type __err = reinterpret_cast<iconv_t>(-1);
bool __test = _M_in_desc && _M_in_desc != __err;
__test &= _M_out_desc && _M_out_desc != __err;
return __test;
}
const __desc_type*
_M_get_in_descriptor()
{ return &_M_in_desc; }
const __desc_type*
_M_get_out_descriptor()
{ return &_M_out_desc; }
int
_M_get_external_bom()
{ return _M_ext_bom; }
int
_M_get_internal_bom()
{ return _M_int_bom; }
const char*
_M_get_internal_enc()
{ return _M_int_enc; }
const char*
_M_get_external_enc()
{ return _M_ext_enc; }
};
// Partial specialization
// This specialization takes advantage of iconv to provide code
// conversions between a large number of character encodings.
template<typename _InternT, typename _ExternT>
class codecvt<_InternT, _ExternT, __enc_traits>
: public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
{
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef __enc_traits state_type;
typedef __enc_traits::__desc_type __desc_type;
typedef __enc_traits __enc_type;
// Data Members:
static locale::id id;
explicit
codecvt(size_t __refs = 0)
: __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
{ }
explicit
codecvt(__enc_type* __enc, size_t __refs = 0)
: __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
{ }
protected:
virtual
~codecvt() { }
virtual result
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
virtual result
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const;
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
virtual int
do_encoding() const throw();
virtual bool
do_always_noconv() const throw();
virtual int
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
virtual int
do_max_length() const throw();
};
template<typename _InternT, typename _ExternT>
locale::id
codecvt<_InternT, _ExternT, __enc_traits>::id;
// This adaptor works around the signature problems of the second
// argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
// uses 'char**', which matches the POSIX 1003.1-2001 standard.
// Using this adaptor, g++ will do the work for us.
template<typename _T>
inline size_t
__iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
iconv_t __cd, char** __inbuf, size_t* __inbytes,
char** __outbuf, size_t* __outbytes)
{ return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_out_descriptor();
const size_t __fmultiple = sizeof(intern_type);
size_t __fbytes = __fmultiple * (__from_end - __from);
const size_t __tmultiple = sizeof(extern_type);
size_t __tbytes = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item
// in the byte stream, to designate endian-ness. The default
// value for the byte order marker is NULL, so if this is
// the case, it's not necessary and we can just go on our
// merry way.
int __int_bom = __state._M_get_internal_bom();
if (__int_bom)
{
size_t __size = __from_end - __from;
intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
__cfixed[0] = static_cast<intern_type>(__int_bom);
char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__fbytes, &__cto, &__tbytes);
}
else
{
intern_type* __cfixed = const_cast<intern_type*>(__from);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
&__cto, &__tbytes);
}
if (__conv != size_t(-1))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = ok;
}
else
{
if (__fbytes < __fmultiple * (__from_end - __from))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = partial;
}
else
__ret = error;
}
}
return __ret;
}
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_in_descriptor();
const size_t __tmultiple = sizeof(intern_type);
size_t __tlen = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
&__cto, &__tlen);
if (__conv != size_t(-1))
{
__to_next = reinterpret_cast<extern_type*>(__cto);
if (__tlen == __tmultiple * (__to_end - __to))
__ret = noconv;
else if (__tlen == 0)
__ret = ok;
else
__ret = partial;
}
else
__ret = error;
}
return __ret;
}
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_in_descriptor();
const size_t __fmultiple = sizeof(extern_type);
size_t __flen = __fmultiple * (__from_end - __from);
const size_t __tmultiple = sizeof(intern_type);
size_t __tlen = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item
// in the byte stream, to designate endian-ness. The default
// value for the byte order marker is NULL, so if this is
// the case, it's not necessary and we can just go on our
// merry way.
int __ext_bom = __state._M_get_external_bom();
if (__ext_bom)
{
size_t __size = __from_end - __from;
extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
__cfixed[0] = static_cast<extern_type>(__ext_bom);
char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
else
{
extern_type* __cfixed = const_cast<extern_type*>(__from);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
if (__conv != size_t(-1))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = ok;
}
else
{
if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = partial;
}
else
__ret = error;
}
}
return __ret;
}
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_encoding() const throw()
{
int __ret = 0;
if (sizeof(_ExternT) <= sizeof(_InternT))
__ret = sizeof(_InternT)/sizeof(_ExternT);
return __ret;
}
template<typename _InternT, typename _ExternT>
bool
codecvt<_InternT, _ExternT, __enc_traits>::
do_always_noconv() const throw()
{ return false; }
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return min(__max, static_cast<size_t>(__end - __from)); }
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 74. Garbled text for codecvt::do_max_length
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_max_length() const throw()
{ return 1; }
#endif

View file

@ -0,0 +1,49 @@
// std::messages implementation details, IEEE 1003.1-200x version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
namespace std
{
// Specializations
template<>
string
messages<char>::do_get(catalog __c, int __setid, int __msgid,
const string& __dfault) const
{
nl_catd __nlc = reinterpret_cast<nl_catd>(__c);
return string(catgets(__nlc, __setid, __msgid, __dfault.c_str()));
}
}

View file

@ -0,0 +1,70 @@
// std::messages implementation details, IEEE 1003.1-200x version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
// Non-virtual member functions.
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char*) const
{ return this->do_open(__s, __loc); }
// Virtual member functions.
template<typename _CharT>
messages<_CharT>::~messages()
{ }
template<typename _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __s,
const locale&) const
{ return reinterpret_cast<catalog>(catopen(__s.c_str(), NL_CAT_LOCALE)); }
template<typename _CharT>
typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog __c, int __setid, int __msgid,
const string_type& __dfault) const
{
nl_catd __nlc = reinterpret_cast<nl_catd>(__c);
char* __msg = catgets(__nlc, __setid, __msgid,
_M_convert_to_char(__dfault));
return _M_convert_from_char(__msg);
}
template<typename _CharT>
void
messages<_CharT>::do_close(catalog __c) const
{ catclose(reinterpret_cast<nl_catd>(__c)); }

View file

@ -0,0 +1,59 @@
// Low-level functions for atomic operations: AIX version -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
/* We cannot use the cpu/powerpc/bits/atomicity.h inline assembly
definitions for these operations since they depend on operations
that are not available on the original POWER architecture. AIX
still runs on the POWER architecture, so it would be incorrect to
assume the existence of these instructions. */
/* This should match the type pointed to by atomic_p in
<sys/atomic_op.h>. */
typedef int _Atomic_word;
#include <sys/atomic_op.h>
static inline int
__attribute__ ((unused))
__exchange_and_add (atomic_p __mem, int __val)
{
return fetch_and_add (__mem, __val);
}
static inline void
__attribute__ ((unused))
__atomic_add (atomic_p __mem, int __val)
{
(void) fetch_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned int mask;
static const mask upper = _ISUPPER;
static const mask lower = _ISLOWER;
static const mask alpha = _ISALPHA;
static const mask digit = _ISDIGIT;
static const mask xdigit = _ISXDIGIT;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
static const mask graph = _ISGRAPH;
static const mask cntrl = _ISCNTRL;
static const mask punct = _ISPUNCT;
static const mask alnum = _ISALNUM;
};

View file

@ -0,0 +1,76 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return _toupper(__c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_toupper(*__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return _tolower(__c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = this->do_tolower(*__low);
++__low;
}
return __high;
}

View file

@ -0,0 +1,67 @@
// Specific definitions for AIX -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#undef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
// off64_t
#ifndef _LARGE_FILE_API
#define _LARGE_FILE_API
#endif
// atomic types
#ifndef _ALL_SOURCE
#define _ALL_SOURCE
#endif
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
#undef _G_USING_THUNKS
#define _G_USING_THUNKS 0
#if !defined(_AIX51) || !defined(__64BIT__)
#define __glibcpp_wchar_t_bits 16
#define __glibcpp_wchar_t_is_signed false
#endif
#ifdef __64BIT__
#define __glibcpp_long_bits 64
#endif
#endif

View file

@ -0,0 +1,76 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h on FreeBSD 3.4,
// 4.0 and all versions of the CVS managed file at:
// :pserver:anoncvs@anoncvs.freebsd.org:/home/ncvs/src/include/ctype.h
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned long mask;
#ifdef _CTYPE_S
// FreeBSD 4.0 uses this style of define.
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
static const mask alpha = _CTYPE_A;
static const mask digit = _CTYPE_D;
static const mask xdigit = _CTYPE_X;
static const mask space = _CTYPE_S;
static const mask print = _CTYPE_R;
static const mask graph = _CTYPE_G;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
static const mask alnum = _CTYPE_A | _CTYPE_D;
#else
// Older versions, including Free BSD 3.4, use this style of define.
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _A;
static const mask digit = _D;
static const mask xdigit = _X;
static const mask space = _S;
static const mask print = _R;
static const mask graph = _G;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _A | _D;
#endif
};

View file

@ -0,0 +1,94 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{
return __istype(__c, __m);
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
for (;__low < __high; ++__vec, ++__low)
{
#if defined (_CTYPE_S) || defined (__istype)
*__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit
| space | print | graph | cntrl | punct | alnum);
#else
mask __m = 0;
if (this->is(upper, *__low)) __m |= upper;
if (this->is(lower, *__low)) __m |= lower;
if (this->is(alpha, *__low)) __m |= alpha;
if (this->is(digit, *__low)) __m |= digit;
if (this->is(xdigit, *__low)) __m |= xdigit;
if (this->is(space, *__low)) __m |= space;
if (this->is(print, *__low)) __m |= print;
if (this->is(graph, *__low)) __m |= graph;
if (this->is(cntrl, *__low)) __m |= cntrl;
if (this->is(punct, *__low)) __m |= punct;
// Do not include explicit line for alnum mask since it is a
// pure composite of masks on FreeBSD.
*__vec = __m;
#endif
}
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View file

@ -0,0 +1,39 @@
// Specific definitions for BSD -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define __glibcpp_long_double_bits __glibcpp_double_bits
#endif

View file

@ -0,0 +1,58 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h on NetBSD.
// Full details can be found from the CVS files at:
// anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h
// See www.netbsd.org for details of access.
struct ctype_base
{
// Non-standard typedefs.
typedef const unsigned char* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _N | _X;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
};

View file

@ -0,0 +1,73 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[(unsigned char)(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[*__low++];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,79 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View file

@ -0,0 +1,38 @@
// Specific definitions for NetBSD -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define __ssize_t ssize_t
#endif

View file

@ -0,0 +1,57 @@
// Locale support -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
struct ctype_base
{
typedef unsigned short mask;
// Non-standard typedefs.
typedef unsigned char * __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
static const mask space = __dj_ISSPACE; // Whitespace
static const mask print = __dj_ISPRINT; // Printing
static const mask cntrl = __dj_ISCNTRL; // Control character
static const mask upper = __dj_ISUPPER; // UPPERCASE
static const mask lower = __dj_ISLOWER; // lowercase
static const mask alpha = __dj_ISALPHA; // Alphabetic
static const mask digit = __dj_ISDIGIT; // Numeric
static const mask punct = __dj_ISPUNCT; // Punctuation
static const mask xdigit = __dj_ISXDIGIT; // Hexadecimal numeric
static const mask alnum = __dj_ISALPHA; // Alphanumeric
static const mask graph = __dj_ISGRAPH; // Graphical
};

View file

@ -0,0 +1,67 @@
// Locale support -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[static_cast<unsigned char>(__c + 1)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,81 @@
// Locale support -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from DJGPP <ctype.h>
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return _M_toupper[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper(static_cast<int> (*__low));
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return _M_tolower[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower(static_cast<int> (*__low));
++__low;
}
return __high;
}

View file

@ -0,0 +1,45 @@
// Specific definitions for DJGPP -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
// FIXME: should there be '#undef POSIX_SOURCE'?
#endif

View file

@ -0,0 +1,58 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Default information, may not be appropriate for specific host.
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned int mask;
static const mask upper = 1 << 0;
static const mask lower = 1 << 1;
static const mask alpha = 1 << 2;
static const mask digit = 1 << 3;
static const mask xdigit = 1 << 4;
static const mask space = 1 << 5;
static const mask print = 1 << 6;
static const mask graph = 1 << 7;
static const mask cntrl = 1 << 8;
static const mask punct = 1 << 9;
static const mask alnum = 1 << 10;
};

View file

@ -0,0 +1,125 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
// The following definitions are portable, but insanely slow. If one
// cares at all about performance, then specialized ctype
// functionality should be added for the native os in question: see
// the config/os/bits/ctype_*.h files.
bool
ctype<char>::
is(mask __m, char __c) const
{
bool __ret;
switch (__m)
{
case space:
__ret = isspace(__c);
break;
case print:
__ret = isprint(__c);
break;
case cntrl:
__ret = iscntrl(__c);
break;
case upper:
__ret = isupper(__c);
break;
case lower:
__ret = islower(__c);
break;
case alpha:
__ret = isalpha(__c);
break;
case digit:
__ret = isdigit(__c);
break;
case punct:
__ret = ispunct(__c);
break;
case xdigit:
__ret = isxdigit(__c);
break;
case alnum:
__ret = isalnum(__c);
break;
case graph:
__ret = isgraph(__c);
break;
default:
__ret = false;
break;
}
return __ret;
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10
for (;__low < __high; ++__vec, ++__low)
{
mask __m = 0;
int __i = 0; // Lowest bitmask in ctype_base == 0
for (;__i < __bitmasksize; ++__i)
{
mask __bit = static_cast<mask>(1 << __i);
if (this->is(__bit, *__low))
__m |= __bit;
}
*__vec = __m;
}
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,82 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View file

@ -0,0 +1,37 @@
// Specific definitions for generic platforms -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#endif

View file

@ -0,0 +1,69 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
#if _GLIBCPP_USE_SHADOW_HEADERS
using _C_legacy::_ISspace;
using _C_legacy::_ISprint;
using _C_legacy::_IScntrl;
using _C_legacy::_ISupper;
using _C_legacy::_ISlower;
using _C_legacy::_ISalpha;
using _C_legacy::_ISdigit;
using _C_legacy::_ISpunct;
using _C_legacy::_ISxdigit;
using _C_legacy::_ISalnum;
using _C_legacy::_ISgraph;
#endif
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned short mask;
static const mask upper = _ISupper;
static const mask lower = _ISlower;
static const mask alpha = _ISalpha;
static const mask digit = _ISdigit;
static const mask xdigit = _ISxdigit;
static const mask space = _ISspace;
static const mask print = _ISprint;
static const mask graph = _ISgraph;
static const mask cntrl = _IScntrl;
static const mask punct = _ISpunct;
static const mask alnum = _ISalnum;
};

View file

@ -0,0 +1,69 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,100 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
#if _GLIBCPP_USE_SHADOW_HEADERS
using _C_legacy::__ctype_toupper;
using _C_legacy::__ctype_tolower;
using _C_legacy::__ctype_b;
#endif
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return __ctype_b; }
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
_M_c_locale_ctype = _S_clone_c_locale(__cloc);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
}
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = _S_c_locale; }
#endif
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = _S_c_locale; }
char
ctype<char>::do_toupper(char __c) const
{ return _M_toupper[static_cast<unsigned char>(__c)]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = _M_toupper[static_cast<unsigned char>(*__low)];
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return _M_tolower[static_cast<unsigned char>(__c)]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = _M_tolower[static_cast<unsigned char>(*__low)];
++__low;
}
return __high;
}

View file

@ -0,0 +1,76 @@
// Specific definitions for GNU/Linux -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
// This keeps isanum, et al from being propagated as macros.
#define __NO_CTYPE 1
#include <features.h>
#if !defined (__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__+ 0 == 0)
// The types __off_t and __off64_t are not defined through <sys/types.h>
// as _G_config assumes. For libc5 and glibc 2.0 instead use
// <gnu/types.h> and the old name for __off64_t.
#include <gnu/types.h>
typedef __loff_t __off64_t;
// These systems have declarations mismatching those in libio.h by
// omitting throw qualifiers. Cleanest way out is to not provide
// throw-qualifiers at all. Defining it as empty here will make libio.h
// not define it.
#undef __THROW
#define __THROW
// Tell Glibc not to try to provide its own inline versions of
// some math functions. Those cause assembly-time clashes with
// our definitions.
#define __NO_MATH_INLINES
#endif
#if defined __GLIBC__ && __GLIBC__ >= 2
// We must not see the optimized string functions GNU libc defines.
#define __NO_STRING_INLINES
#endif
#if defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__))
#define __glibcpp_long_bits 64
#endif
#if defined(__sparc__) && !defined(__arch64__)
#define __glibcpp_long_double_bits 64
#endif
#endif

View file

@ -0,0 +1,35 @@
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_CPU_LIMITS
#define _GLIBCPP_CPU_LIMITS 1
#ifdef __LP64__
#define __glibcpp_long_bits 64
#endif
#endif

View file

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Default information, may not be appropriate for specific host.
struct ctype_base
{
// Non-standard typedefs.
typedef const int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned int mask;
static const mask upper = _ISUPPER;
static const mask lower = _ISLOWER;
static const mask alpha = _ISALPHA;
static const mask digit = _ISDIGIT;
static const mask xdigit = _ISXDIGIT;
static const mask space = _ISSPACE;
static const mask print = _ISPRINT;
static const mask graph = _ISGRAPH;
static const mask cntrl = _ISCNTRL;
static const mask punct = _ISPUNCT;
static const mask alnum = _ISALNUM;
};

View file

@ -0,0 +1,79 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[(unsigned char)(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10
for (;__low < __high; ++__vec, ++__low)
{
mask __m = _M_table[*__low];
int __i = 0; // Lowest bitmask in ctype_base == 0
while (__i < __bitmasksize && !(__m & static_cast<mask>(1 << __i)))
++__i;
*__vec = static_cast<mask>(1 << __i);
}
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View file

@ -0,0 +1,82 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View file

@ -0,0 +1,79 @@
// Specific definitions for generic platforms -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#define __off_t off_t
#define __off64_t off64_t
#define __ssize_t ssize_t
#define __glibcpp_wchar_t_is_signed false
// Use macro form of ctype functions to ensure __SB_masks is defined.
#define _SB_CTYPE_MACROS 1
/* HP-UX, for reasons unknown choose to use a different name for
the string to [unsigned] long long conversion routines.
Furthermore, instead of having the prototypes in stdlib.h like
everyone else, they put them into a non-standard header
<inttypes.h>. Ugh.
<inttypes.h> defines a variety of things, some of which we
probably do not want. So we don't want to include it here.
Luckily we can just declare strtoll and strtoull with the
__asm extension which effectively renames calls at the
source level without namespace pollution.
Also note that the compiler defines _INCLUDE_LONGLONG for C++
unconditionally, which makes intmax_t and uintmax_t long long
types.
We also force _GLIBCPP_USE_LONG_LONG here so that we don't have
to bastardize configure to deal with this sillyness. */
namespace std {
#ifndef __LP64__
__extension__ extern "C" long long strtoll (const char *, char **, int)
__asm ("__strtoll");
__extension__ extern "C" unsigned long long strtoull (const char *, char **, int)
__asm ("__strtoull");
#else
__extension__ extern "C" long long strtoll (const char *, char **, int)
__asm ("strtol");
__extension__ extern "C" unsigned long long strtoull (const char *, char **, int)
__asm ("strtoul");
#endif
}
#define _GLIBCPP_USE_LONG_LONG 1
#endif

View file

@ -0,0 +1,50 @@
// Low-level functions for atomic operations: IRIX version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#include <mutex.h>
typedef long _Atomic_word;
static inline _Atomic_word
__exchange_and_add (_Atomic_word* __mem, int __val)
{
return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
}
static inline void
__atomic_add (_Atomic_word* __mem, int __val)
{
__exchange_and_add (__mem, __val);
}
#endif /* atomicity.h */

View file

@ -0,0 +1,55 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// 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, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself 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.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h on irix 5.2
struct ctype_base
{
// Non-standard typedefs.
typedef unsigned int* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _X;
static const mask space = _S;
static const mask print = _U | _L | _N | _P | _B;
static const mask graph = _U | _L | _N | _P;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
};

Some files were not shown because too many files have changed in this diff Show more