Gcc 3.4.2 20040728 C++ support bits.
This commit is contained in:
parent
9a63ad9273
commit
ffeaf689a2
File diff suppressed because it is too large
Load Diff
5590
contrib/libstdc++/ChangeLog-2002
Normal file
5590
contrib/libstdc++/ChangeLog-2002
Normal file
File diff suppressed because it is too large
Load Diff
8619
contrib/libstdc++/ChangeLog-2003
Normal file
8619
contrib/libstdc++/ChangeLog-2003
Normal file
File diff suppressed because it is too large
Load Diff
@ -22,51 +22,40 @@
|
||||
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
## USA.
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
MAINT_CHARSET = latin1
|
||||
include $(top_srcdir)/fragment.am
|
||||
|
||||
SUBDIRS = include libio libmath libsupc++ src po testsuite
|
||||
|
||||
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
|
||||
|
||||
PWD_COMMAND = $${PWDCMD-pwd}
|
||||
|
||||
# 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)
|
||||
if GLIBCXX_HOSTED
|
||||
# Possibly libmath as well...
|
||||
hosted_source = src po
|
||||
endif
|
||||
## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
|
||||
SUBDIRS = include libmath libsupc++ $(hosted_source) testsuite
|
||||
|
||||
# These rules are messy, but are hella worth it.
|
||||
doxygen:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=user $${srcdir} $${builddir})
|
||||
|
||||
doxygen-maint:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=maint $${srcdir} $${builddir})
|
||||
|
||||
doxygen-man:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=man $${srcdir} $${builddir})
|
||||
|
||||
.PHONY: doxygen doxygen-maint doxygen-man
|
||||
|
||||
# Handy forwarding targets.
|
||||
check-%:
|
||||
cd testsuite && $(MAKE) $@
|
||||
|
||||
# Multilib support.
|
||||
MAKEOVERRIDES=
|
||||
|
||||
@ -147,7 +136,7 @@ AM_MAKEFLAGS = \
|
||||
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
|
||||
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
|
||||
"DESTDIR=$(DESTDIR)" \
|
||||
"WERROR=$(WERROR)"
|
||||
"WERROR=$(WERROR)"
|
||||
|
||||
# Subdir rules rely on $(FLAGS_TO_PASS)
|
||||
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
|
||||
|
@ -1,6 +1,8 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# 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.
|
||||
@ -10,71 +12,52 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
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
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
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@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCATOR_H = @ALLOCATOR_H@
|
||||
ALLOCATOR_NAME = @ALLOCATOR_NAME@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
|
||||
ATOMICITY_SRCDIR = @ATOMICITY_SRCDIR@
|
||||
ATOMIC_WORD_SRCDIR = @ATOMIC_WORD_SRCDIR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASIC_FILE_CC = @BASIC_FILE_CC@
|
||||
BASIC_FILE_H = @BASIC_FILE_H@
|
||||
CC = @CC@
|
||||
CCODECVT_C = @CCODECVT_C@
|
||||
CCODECVT_CC = @CCODECVT_CC@
|
||||
CCODECVT_H = @CCODECVT_H@
|
||||
CCOLLATE_CC = @CCOLLATE_CC@
|
||||
CCTYPE_CC = @CCTYPE_CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
CLOCALE_CC = @CLOCALE_CC@
|
||||
CLOCALE_H = @CLOCALE_H@
|
||||
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
|
||||
@ -83,39 +66,73 @@ CMESSAGES_H = @CMESSAGES_H@
|
||||
CMONEY_CC = @CMONEY_CC@
|
||||
CNUMERIC_CC = @CNUMERIC_CC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSTDIO_H = @CSTDIO_H@
|
||||
CTIME_CC = @CTIME_CC@
|
||||
CTIME_H = @CTIME_H@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
C_INCLUDE_DIR = @C_INCLUDE_DIR@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DEFS = @DEFS@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
|
||||
GCJ = @GCJ@
|
||||
GCJFLAGS = @GCJFLAGS@
|
||||
GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
|
||||
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
|
||||
LIBIO_INCLUDES = @LIBIO_INCLUDES@
|
||||
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
|
||||
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
|
||||
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
|
||||
GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
|
||||
GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
|
||||
GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
|
||||
GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
|
||||
GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
|
||||
GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
|
||||
GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
|
||||
GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
|
||||
GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
|
||||
GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
|
||||
GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
|
||||
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
|
||||
GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
|
||||
GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
|
||||
GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
|
||||
GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LIBMATHOBJS = @LIBMATHOBJS@
|
||||
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
|
||||
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
|
||||
OPT_LDFLAGS = @OPT_LDFLAGS@
|
||||
OS_INC_SRCDIR = @OS_INC_SRCDIR@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SECTION_FLAGS = @SECTION_FLAGS@
|
||||
SECTION_LDFLAGS = @SECTION_LDFLAGS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
SYMVER_MAP = @SYMVER_MAP@
|
||||
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
|
||||
@ -123,35 +140,86 @@ USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARN_FLAGS = @WARN_FLAGS@
|
||||
WERROR = @WERROR@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_AS = @ac_ct_AS@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
baseline_dir = @baseline_dir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
check_msgfmt = @check_msgfmt@
|
||||
datadir = @datadir@
|
||||
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@
|
||||
exec_prefix = @exec_prefix@
|
||||
glibcxx_MOFILES = @glibcxx_MOFILES@
|
||||
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
|
||||
glibcxx_POFILES = @glibcxx_POFILES@
|
||||
glibcxx_builddir = @glibcxx_builddir@
|
||||
glibcxx_localedir = @glibcxx_localedir@
|
||||
glibcxx_prefixdir = @glibcxx_prefixdir@
|
||||
glibcxx_srcdir = @glibcxx_srcdir@
|
||||
glibcxx_thread_h = @glibcxx_thread_h@
|
||||
glibcxx_toolexecdir = @glibcxx_toolexecdir@
|
||||
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
|
||||
gxx_include_dir = @gxx_include_dir@
|
||||
ifGNUmake = @ifGNUmake@
|
||||
libio_la = @libio_la@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libtool_VERSION = @libtool_VERSION@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
multi_basedir = @multi_basedir@
|
||||
oldincludedir = @oldincludedir@
|
||||
port_specific_symbol_files = @port_specific_symbol_files@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
toplevel_srcdir = @toplevel_srcdir@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 cygnus
|
||||
MAINT_CHARSET = latin1
|
||||
|
||||
SUBDIRS = include libio libmath libsupc++ src po testsuite
|
||||
|
||||
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
|
||||
|
||||
PWD_COMMAND = $${PWDCMD-pwd}
|
||||
STAMP = echo timestamp >
|
||||
|
||||
toolexecdir = $(glibcxx_toolexecdir)
|
||||
toolexeclibdir = $(glibcxx_toolexeclibdir)
|
||||
|
||||
# These bits are all figured out from configure. Look in acinclude.m4
|
||||
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
|
||||
CONFIG_CXXFLAGS = \
|
||||
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
|
||||
|
||||
WARN_CXXFLAGS = \
|
||||
$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
|
||||
|
||||
|
||||
# -I/-D flags to pass when compiling.
|
||||
AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
|
||||
@GLIBCXX_HOSTED_TRUE@hosted_source = src po
|
||||
SUBDIRS = include libmath libsupc++ $(hosted_source) testsuite
|
||||
|
||||
# Multilib support.
|
||||
MAKEOVERRIDES =
|
||||
@ -205,71 +273,84 @@ AM_MAKEFLAGS = \
|
||||
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
|
||||
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
|
||||
"DESTDIR=$(DESTDIR)" \
|
||||
"WERROR=$(WERROR)"
|
||||
"WERROR=$(WERROR)"
|
||||
|
||||
|
||||
# Subdir rules rely on $(FLAGS_TO_PASS)
|
||||
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
|
||||
subdir = .
|
||||
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
|
||||
CONFIG_CLEAN_FILES = scripts/check_survey scripts/testsuite_flags
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
ps-recursive install-info-recursive uninstall-info-recursive \
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure \
|
||||
$(top_srcdir)/fragment.am ../ABOUT-NLS ../COPYING \
|
||||
../COPYING.LIB ../ChangeLog ../README ../config.guess \
|
||||
../config.rpath ../config.sub ../configure ../configure.in \
|
||||
../install-sh ../ltcf-c.sh ../ltcf-cxx.sh ../ltcf-gcj.sh \
|
||||
../ltconfig ../ltmain.sh ../missing ../mkinstalldirs ../ylwrap \
|
||||
ChangeLog Makefile.am acconfig.h acinclude.m4 aclocal.m4 \
|
||||
config.h.in configure configure.ac
|
||||
DIST_SUBDIRS = include libmath libsupc++ src po testsuite
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
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
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
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
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
touch $(srcdir)/config.h.in
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
-rm -f config.h stamp-h1
|
||||
scripts/check_survey: $(top_builddir)/config.status $(top_srcdir)/scripts/check_survey.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
scripts/testsuite_flags: $(top_builddir)/config.status $(top_srcdir)/scripts/testsuite_flags.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
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
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
@ -277,12 +358,7 @@ testsuite_flags: $(top_builddir)/config.status testsuite_flags.in
|
||||
# (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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
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:
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
@ -305,11 +381,16 @@ 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; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
@ -325,198 +406,303 @@ tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
mkid -fID $$unique
|
||||
|
||||
mostlyclean-tags:
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
clean-tags:
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkinstalldirs) $(distdir)/.. $(distdir)/scripts
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_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 \
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(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:
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-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
|
||||
all-am: Makefile all-multi config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
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 "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-multi clean-recursive
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
.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
|
||||
distclean: distclean-multi distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-multi
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-multi maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-multi mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-multi check \
|
||||
check-am clean clean-generic clean-libtool clean-multi \
|
||||
clean-recursive ctags ctags-recursive dist dist-all dist-gzip \
|
||||
distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-multi distclean-recursive \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am dvi-recursive info info-am info-recursive install \
|
||||
install-am install-data install-data-am install-data-recursive \
|
||||
install-exec install-exec-am install-exec-recursive \
|
||||
install-info install-info-am install-info-recursive install-man \
|
||||
install-multi install-recursive install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am \
|
||||
installdirs-recursive maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-multi maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-multi \
|
||||
mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
|
||||
ps-recursive tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-info-recursive uninstall-recursive
|
||||
|
||||
|
||||
# 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)
|
||||
@GLIBCXX_HOSTED_TRUE@ # Possibly libmath as well...
|
||||
|
||||
# These rules are messy, but are hella worth it.
|
||||
doxygen:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=user $${srcdir} $${builddir})
|
||||
|
||||
doxygen-maint:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=maint $${srcdir} $${builddir})
|
||||
|
||||
doxygen-man:
|
||||
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
|
||||
builddir=`${PWD_COMMAND}`; \
|
||||
/bin/sh ${srcdir}/docs/doxygen/run_doxygen \
|
||||
${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
|
||||
--mode=man $${srcdir} $${builddir})
|
||||
|
||||
.PHONY: doxygen doxygen-maint doxygen-man
|
||||
|
||||
# Handy forwarding targets.
|
||||
check-%:
|
||||
cd testsuite && $(MAKE) $@
|
||||
|
||||
# Multilib support.
|
||||
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
|
||||
maintainer-clean-multi
|
||||
@ -544,7 +730,6 @@ maintainer-clean-multi:
|
||||
# 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:
|
||||
|
@ -54,11 +54,15 @@ It has subdirectories:
|
||||
Headers that define extensions to the standard library. No
|
||||
standard header refers to any of them.
|
||||
|
||||
scripts
|
||||
Scripts that are used during the configure, build, make, or test
|
||||
process.
|
||||
|
||||
src
|
||||
Files that are used in constructing the library, but are not
|
||||
installed.
|
||||
|
||||
testsuites/[thread, 17_* to 27_*]
|
||||
testsuites/[backward, demangle, ext, performance, 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
|
||||
@ -72,16 +76,13 @@ Other subdirectories contain variant versions of certain files
|
||||
that are meant to be copied or linked by the configure script.
|
||||
Currently these are:
|
||||
|
||||
config/abi
|
||||
config/cpu
|
||||
config/os
|
||||
config/io
|
||||
config/locale
|
||||
config/os
|
||||
|
||||
In addition, three subdirectories are convenience libraries:
|
||||
|
||||
libio
|
||||
Contains the subset of the GNU libio library needed for
|
||||
C++. Currently not used.
|
||||
In addition, two subdirectories are convenience libraries:
|
||||
|
||||
libmath
|
||||
Support routines needed for C++ math. Only needed if the
|
||||
|
@ -10,58 +10,61 @@
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
// Define if GCC supports weak symbols.
|
||||
#undef _GLIBCPP_SUPPORTS_WEAK
|
||||
|
||||
// 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
|
||||
#undef _GLIBCXX_USE_LONG_LONG
|
||||
|
||||
// Include support for 'long double'.
|
||||
#undef _GLIBCPP_USE_LONG_DOUBLE
|
||||
#undef _GLIBCXX_USE_LONG_DOUBLE
|
||||
|
||||
// Include support for shadow headers, ie --enable-cshadow-headers.
|
||||
#undef _GLIBCPP_USE_SHADOW_HEADERS
|
||||
// Define if C99 math functions (like fpclassify) should be exposed.
|
||||
#undef _GLIBCXX_USE_C99_MATH
|
||||
|
||||
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
|
||||
#undef _GLIBCXX_USE_C99
|
||||
|
||||
// Define if code specialized for wchar_t should be used.
|
||||
#undef _GLIBCPP_USE_WCHAR_T
|
||||
#undef _GLIBCXX_USE_WCHAR_T
|
||||
|
||||
// Define if using setrlimit to limit memory usage during 'make check'.
|
||||
#undef _GLIBCPP_MEM_LIMITS
|
||||
// Define if using setrlimit to set resource limits during 'make check'.
|
||||
#undef _GLIBCXX_RES_LIMITS
|
||||
|
||||
// Define to use concept checking code from the boost libraries.
|
||||
#undef _GLIBCPP_CONCEPT_CHECKS
|
||||
|
||||
// Define if the atan2f function exists.
|
||||
#undef _GLIBCPP_HAVE_ATAN2F
|
||||
|
||||
// Define if the atan2l function exists.
|
||||
#undef _GLIBCPP_HAVE_ATAN2L
|
||||
|
||||
// Define if the copysignf function exists.
|
||||
#undef _GLIBCPP_HAVE_COPYSIGNF
|
||||
#undef _GLIBCXX_CONCEPT_CHECKS
|
||||
|
||||
// Define to use symbol versioning in the shared library.
|
||||
#undef _GLIBCPP_SYMVER
|
||||
#undef _GLIBCXX_SYMVER
|
||||
|
||||
// Define symbol versioning in assember directives. If symbol
|
||||
// versioning is beigng used, and the assembler supports this kind of
|
||||
// thing, then use it.
|
||||
// NB: _GLIBCPP_AT_AT is a hack to work around quoting issues in m4.
|
||||
#if _GLIBCPP_SYMVER
|
||||
#define _GLIBCPP_ASM_SYMVER(cur, old, version) \
|
||||
asm (".symver " #cur "," #old _GLIBCPP_AT_AT #version);
|
||||
// NB: _GLIBCXX_AT_AT is a hack to work around quoting issues in m4.
|
||||
#if _GLIBCXX_SYMVER
|
||||
#define _GLIBCXX_ASM_SYMVER(cur, old, version) \
|
||||
asm (".symver " #cur "," #old _GLIBCXX_AT_AT #version);
|
||||
#else
|
||||
#define _GLIBCPP_ASM_SYMVER(cur, old, version)
|
||||
#define _GLIBCXX_ASM_SYMVER(cur, old, version)
|
||||
#endif
|
||||
|
||||
// Define if LFS support is available.
|
||||
#undef _GLIBCXX_USE_LFS
|
||||
|
||||
// Define if NLS translations are to be used.
|
||||
#undef _GLIBCXX_USE_NLS
|
||||
|
||||
// Define if gthr-default.h exists (meaning that threading support is enabled).
|
||||
#undef HAVE_GTHR_DEFAULT
|
||||
|
||||
// Define if drand48 exists.
|
||||
#undef HAVE_DRAND48
|
||||
// Define if the atan2f function exists.
|
||||
#undef HAVE_ATAN2F
|
||||
|
||||
// Define if the atan2l function exists.
|
||||
#undef HAVE_ATAN2L
|
||||
|
||||
// Define if the tanl function exists.
|
||||
#undef HAVE_TANL
|
||||
|
||||
// Define if the copysignf function exists.
|
||||
#undef HAVE_COPYSIGNF
|
||||
|
||||
// Define if getpagesize exists.
|
||||
#undef HAVE_GETPAGESIZE
|
||||
@ -87,6 +90,9 @@
|
||||
// Define if you have the expl function.
|
||||
#undef HAVE_EXPL
|
||||
|
||||
// Define if you have the hypot function.
|
||||
#undef HAVE_HYPOT
|
||||
|
||||
// Define if you have the hypotf function.
|
||||
#undef HAVE_HYPOTF
|
||||
|
||||
@ -144,6 +150,12 @@
|
||||
// Define if S_IFREG is available in <sys/stat.h>.
|
||||
#undef HAVE_S_IFREG
|
||||
|
||||
// Define if writev is available in <sys/uio.h>.
|
||||
#undef HAVE_WRITEV
|
||||
|
||||
// Define if int64_t is available in <stdint.h>.
|
||||
#undef HAVE_INT64_T
|
||||
|
||||
// Define if LC_MESSAGES is available in <locale.h>.
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
4245
contrib/libstdc++/aclocal.m4
vendored
4245
contrib/libstdc++/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
37
contrib/libstdc++/config/allocator/bitmap_allocator_base.h
Normal file
37
contrib/libstdc++/config/allocator/bitmap_allocator_base.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Base to std::allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _CXX_ALLOCATOR_H
|
||||
#define _CXX_ALLOCATOR_H 1
|
||||
|
||||
// Define bitmap_allocator as the base class to std::allocator.
|
||||
#include <ext/bitmap_allocator.h>
|
||||
#define ___glibcxx_base_allocator __gnu_cxx::bitmap_allocator
|
||||
|
||||
#endif
|
37
contrib/libstdc++/config/allocator/malloc_allocator_base.h
Normal file
37
contrib/libstdc++/config/allocator/malloc_allocator_base.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Base to std::allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _CXX_ALLOCATOR_H
|
||||
#define _CXX_ALLOCATOR_H 1
|
||||
|
||||
// Define new_allocator as the base class to std::allocator.
|
||||
#include <ext/malloc_allocator.h>
|
||||
#define ___glibcxx_base_allocator __gnu_cxx::malloc_allocator
|
||||
|
||||
#endif
|
37
contrib/libstdc++/config/allocator/mt_allocator_base.h
Normal file
37
contrib/libstdc++/config/allocator/mt_allocator_base.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Base to std::allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _CXX_ALLOCATOR_H
|
||||
#define _CXX_ALLOCATOR_H 1
|
||||
|
||||
// Define mt_allocator as the base class to std::allocator.
|
||||
#include <ext/mt_allocator.h>
|
||||
#define ___glibcxx_base_allocator __gnu_cxx::__mt_alloc
|
||||
|
||||
#endif
|
37
contrib/libstdc++/config/allocator/new_allocator_base.h
Normal file
37
contrib/libstdc++/config/allocator/new_allocator_base.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Base to std::allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _CXX_ALLOCATOR_H
|
||||
#define _CXX_ALLOCATOR_H 1
|
||||
|
||||
// Define new_allocator as the base class to std::allocator.
|
||||
#include <ext/new_allocator.h>
|
||||
#define ___glibcxx_base_allocator __gnu_cxx::new_allocator
|
||||
|
||||
#endif
|
37
contrib/libstdc++/config/allocator/pool_allocator_base.h
Normal file
37
contrib/libstdc++/config/allocator/pool_allocator_base.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Base to std::allocator -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _CXX_ALLOCATOR_H
|
||||
#define _CXX_ALLOCATOR_H 1
|
||||
|
||||
// Define new_allocator as the base class to std::allocator.
|
||||
#include <ext/pool_allocator.h>
|
||||
#define ___glibcxx_base_allocator __gnu_cxx::__pool_alloc
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: Alpha version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2003, 2004 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
|
||||
@ -27,23 +27,22 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
/* @@@ 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)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
register int __result, __tmp;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
_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"
|
||||
@ -53,16 +52,16 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
|
||||
: "m" (*__mem), "r"(__val));
|
||||
|
||||
return __result;
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
register _Atomic_word __result;
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
register _Atomic_word __result;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
__asm__ __volatile__ (
|
||||
"\n$Ladd_%=:\n\t"
|
||||
"ldl_l %0,%2\n\t"
|
||||
"addl %0,%3,%0\n\t"
|
||||
@ -71,6 +70,6 @@ __atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
"mb"
|
||||
: "=&r"(__result), "=m"(*__mem)
|
||||
: "m" (*__mem), "r"(__val));
|
||||
}
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
||||
#endif /* atomicity.h */
|
||||
|
36
contrib/libstdc++/config/cpu/cris/atomic_word.h
Normal file
36
contrib/libstdc++/config/cpu/cris/atomic_word.h
Normal file
@ -0,0 +1,36 @@
|
||||
// Low-level type for atomic operations -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _GLIBCXX_ATOMIC_WORD_H
|
||||
#define _GLIBCXX_ATOMIC_WORD_H 1
|
||||
|
||||
// This entity must not cross a page boundary.
|
||||
typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: CRIS version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2003, 2004 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
|
||||
@ -27,21 +27,18 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
// 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)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
int __tmp;
|
||||
_Atomic_word __result;
|
||||
_Atomic_word
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
int __tmp;
|
||||
_Atomic_word __result;
|
||||
|
||||
#if (__CRIS_arch_version >= 10)
|
||||
__asm__ __volatile__ (" clearf \n"
|
||||
__asm__ __volatile__ (" clearf \n"
|
||||
"0: \n"
|
||||
" move.d %4,%2 \n"
|
||||
" move.d [%3],%0 \n"
|
||||
@ -52,9 +49,11 @@ __exchange_and_add (_Atomic_word* __mem, int __val)
|
||||
" clearf \n"
|
||||
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
||||
: "r" (__mem), "g" (__val), "m" (*__mem)
|
||||
/* The memory clobber must stay, regardless of
|
||||
current uses of this function. */
|
||||
: "memory");
|
||||
#else
|
||||
__asm__ __volatile__ (" move $ccr,$r9 \n"
|
||||
__asm__ __volatile__ (" move $ccr,$r9 \n"
|
||||
" di \n"
|
||||
" move.d %4,%2 \n"
|
||||
" move.d [%3],%0 \n"
|
||||
@ -63,17 +62,16 @@ __exchange_and_add (_Atomic_word* __mem, int __val)
|
||||
" move $r9,$ccr \n"
|
||||
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
||||
: "r" (__mem), "g" (__val), "m" (*__mem)
|
||||
: "memory", "r9");
|
||||
: "r9",
|
||||
/* The memory clobber must stay, regardless of
|
||||
current uses of this function. */
|
||||
"memory");
|
||||
#endif
|
||||
|
||||
return __result;
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (_Atomic_word* __mem, int __val)
|
||||
{
|
||||
__exchange_and_add (__mem, __val);
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
void
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __exchange_and_add(__mem, __val); }
|
||||
} // namespace __gnu_cxx
|
||||
|
35
contrib/libstdc++/config/cpu/generic/atomic_word.h
Normal file
35
contrib/libstdc++/config/cpu/generic/atomic_word.h
Normal file
@ -0,0 +1,35 @@
|
||||
// Low-level type for atomic operations -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _GLIBCXX_ATOMIC_WORD_H
|
||||
#define _GLIBCXX_ATOMIC_WORD_H 1
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: Generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2001, 2002, 2003, 2004 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
|
||||
@ -27,51 +27,30 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
#include <bits/concurrence.h>
|
||||
|
||||
#include <bits/gthr.h>
|
||||
|
||||
#define _GLIBCPP_NEED_GENERIC_MUTEX
|
||||
|
||||
typedef int _Atomic_word;
|
||||
namespace __gnu_internal
|
||||
{
|
||||
__glibcxx_mutex_define_initialized(atomic_mutex);
|
||||
} // namespace __gnu_internal
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
extern __gthread_mutex_t _Atomic_add_mutex;
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
__glibcxx_mutex_lock(__gnu_internal::atomic_mutex);
|
||||
_Atomic_word __result;
|
||||
__result = *__mem;
|
||||
*__mem += __val;
|
||||
__glibcxx_mutex_unlock(__gnu_internal::atomic_mutex);
|
||||
return __result;
|
||||
}
|
||||
|
||||
#ifndef __GTHREAD_MUTEX_INIT
|
||||
extern __gthread_once_t _Atomic_add_mutex_once;
|
||||
extern void __gthread_atomic_add_mutex_once();
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
#ifndef __GTHREAD_MUTEX_INIT
|
||||
__gthread_once (&__gnu_cxx::_Atomic_add_mutex_once,
|
||||
__gnu_cxx::__gthread_atomic_add_mutex_once);
|
||||
#endif
|
||||
|
||||
_Atomic_word __result;
|
||||
|
||||
__gthread_mutex_lock (&__gnu_cxx::_Atomic_add_mutex);
|
||||
|
||||
__result = *__mem;
|
||||
*__mem += __val;
|
||||
|
||||
__gthread_mutex_unlock (&__gnu_cxx::_Atomic_add_mutex);
|
||||
return __result;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
(void) __exchange_and_add (__mem, __val);
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __exchange_and_add(__mem, __val); }
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,90 +1,95 @@
|
||||
/* Low-level functions for atomic operations. PA-RISC version. -*- C++ -*-
|
||||
Copyright 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
// Low-level functions for atomic operations: PA-RISC version -*- C++ -*-
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
// Copyright (C) 2002, 2004 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.
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
// 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 Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
// 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.
|
||||
|
||||
#ifndef _BITS_ATOMICITY_H
|
||||
#define _BITS_ATOMICITY_H 1
|
||||
// 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.
|
||||
|
||||
typedef int _Atomic_word;
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/atomicity.h>
|
||||
|
||||
template <int __inst>
|
||||
struct __Atomicity_lock
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
static volatile int _S_atomicity_lock;
|
||||
};
|
||||
template<int _Inst>
|
||||
struct _Atomicity_lock
|
||||
{
|
||||
static volatile int _S_atomicity_lock;
|
||||
};
|
||||
|
||||
template<int _Inst>
|
||||
volatile int
|
||||
_Atomicity_lock<_Inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
|
||||
|
||||
template <int __inst>
|
||||
volatile int
|
||||
__Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
|
||||
// Because of the lack of weak support when using the hpux som
|
||||
// linker, we explicitly instantiate the atomicity lock.
|
||||
template volatile int _Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
/* Because of the lack of weak support when using the hpux
|
||||
som linker, we explicitly instantiate the atomicity lock
|
||||
in src/misc-inst.cc when _GLIBCPP_INST_ATOMICITY_LOCK
|
||||
is defined. */
|
||||
#ifndef _GLIBCPP_INST_ATOMICITY_LOCK
|
||||
template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word result;
|
||||
int tmp;
|
||||
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
|
||||
"cmpib,<>,n 0,%0,.+20\n\t"
|
||||
"ldw 0(%1),%0\n\t"
|
||||
"cmpib,= 0,%0,.-4\n\t"
|
||||
"nop\n\t"
|
||||
"b,n .-20"
|
||||
: "=&r" (tmp)
|
||||
: "r" (&lock));
|
||||
|
||||
result = *__mem;
|
||||
*__mem = result + __val;
|
||||
/* Reset lock with PA 2.0 "ordered" store. */
|
||||
__asm__ __volatile__ ("stw,ma %1,0(%0)"
|
||||
: : "r" (&lock), "r" (tmp) : "memory");
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (_Atomic_word* __mem, int __val)
|
||||
{
|
||||
int tmp;
|
||||
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
|
||||
"cmpib,<>,n 0,%0,.+20\n\t"
|
||||
"ldw 0(%1),%0\n\t"
|
||||
"cmpib,= 0,%0,.-4\n\t"
|
||||
"nop\n\t"
|
||||
"b,n .-20"
|
||||
: "=&r" (tmp)
|
||||
: "r" (&lock));
|
||||
|
||||
*__mem += __val;
|
||||
/* Reset lock with PA 2.0 "ordered" store. */
|
||||
__asm__ __volatile__ ("stw,ma %1,0(%0)"
|
||||
: : "r" (&lock), "r" (tmp) : "memory");
|
||||
}
|
||||
|
||||
#endif
|
||||
int
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word result;
|
||||
int tmp;
|
||||
volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
|
||||
"cmpib,<>,n 0,%0,.+20\n\t"
|
||||
"ldw 0(%1),%0\n\t"
|
||||
"cmpib,= 0,%0,.-4\n\t"
|
||||
"nop\n\t"
|
||||
"b,n .-20"
|
||||
: "=&r" (tmp)
|
||||
: "r" (&lock));
|
||||
|
||||
result = *__mem;
|
||||
*__mem = result + __val;
|
||||
/* Reset lock with PA 2.0 "ordered" store. */
|
||||
__asm__ __volatile__ ("stw,ma %1,0(%0)"
|
||||
: : "r" (&lock), "r" (tmp) : "memory");
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
int tmp;
|
||||
volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
|
||||
"cmpib,<>,n 0,%0,.+20\n\t"
|
||||
"ldw 0(%1),%0\n\t"
|
||||
"cmpib,= 0,%0,.-4\n\t"
|
||||
"nop\n\t"
|
||||
"b,n .-20"
|
||||
: "=&r" (tmp)
|
||||
: "r" (&lock));
|
||||
|
||||
*__mem += __val;
|
||||
/* Reset lock with PA 2.0 "ordered" store. */
|
||||
__asm__ __volatile__ ("stw,ma %1,0(%0)"
|
||||
: : "r" (&lock), "r" (tmp) : "memory");
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: x86, x >= 3 version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2004 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
|
||||
@ -27,49 +27,48 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
template <int __inst>
|
||||
struct __Atomicity_lock
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
static volatile _Atomic_word _S_atomicity_lock;
|
||||
};
|
||||
template<int __inst>
|
||||
struct _Atomicity_lock
|
||||
{
|
||||
static volatile _Atomic_word _S_atomicity_lock;
|
||||
};
|
||||
|
||||
template <int __inst>
|
||||
volatile _Atomic_word __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
|
||||
template<int __inst>
|
||||
volatile _Atomic_word _Atomicity_lock<__inst>::_S_atomicity_lock = 0;
|
||||
|
||||
template volatile _Atomic_word __Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
|
||||
{
|
||||
register _Atomic_word __result, __tmp = 1;
|
||||
|
||||
/* obtain the atomic exchange/add spin lock */
|
||||
do {
|
||||
__asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}"
|
||||
: "+m" (__Atomicity_lock<0>::_S_atomicity_lock),
|
||||
"+r" (__tmp));
|
||||
} while (__tmp);
|
||||
|
||||
__result = *__mem;
|
||||
*__mem += __val;
|
||||
|
||||
/* release spin lock */
|
||||
__Atomicity_lock<0>::_S_atomicity_lock = 0;
|
||||
|
||||
return __result;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
__exchange_and_add (__mem, __val);
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
template volatile _Atomic_word _Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
register _Atomic_word __result, __tmp = 1;
|
||||
|
||||
// Obtain the atomic exchange/add spin lock.
|
||||
do
|
||||
{
|
||||
__asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}"
|
||||
: "=m" (_Atomicity_lock<0>::_S_atomicity_lock),
|
||||
"+r" (__tmp)
|
||||
: "m" (_Atomicity_lock<0>::_S_atomicity_lock));
|
||||
}
|
||||
while (__tmp);
|
||||
|
||||
__result = *__mem;
|
||||
*__mem += __val;
|
||||
|
||||
// Release spin lock.
|
||||
_Atomicity_lock<0>::_S_atomicity_lock = 0;
|
||||
|
||||
return __result;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __exchange_and_add(__mem, __val); }
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2004 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
|
||||
@ -27,31 +27,27 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
register _Atomic_word __result;
|
||||
__asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
|
||||
: "=r" (__result), "+m" (*__mem)
|
||||
: "0" (__val)
|
||||
: "memory");
|
||||
return __result;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
__asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
|
||||
: "+m" (*__mem) : "ir" (__val) : "memory");
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
register _Atomic_word __result;
|
||||
__asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
|
||||
: "=r" (__result), "=m" (*__mem)
|
||||
: "0" (__val), "m" (*__mem));
|
||||
return __result;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
__asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
|
||||
: "=m" (*__mem) : "ir" (__val), "m" (*__mem));
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: IA64 version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2003, 2004 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
|
||||
@ -27,25 +27,18 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
#include <ia64intrin.h>
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
return __sync_fetch_and_add (__mem, __val);
|
||||
}
|
||||
_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);
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __sync_fetch_and_add(__mem, __val); }
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: m68k version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -27,111 +27,107 @@
|
||||
// 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;
|
||||
#include <bits/atomicity.h>
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
#if ( defined(__mc68020__) || defined(__mc68030__) \
|
||||
|| defined(__mc68040__) || defined(__mc68060__) ) \
|
||||
&& !defined(__mcpu32__)
|
||||
// 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"
|
||||
"jne 1b"
|
||||
: "=d" (__result), "=&d" (__temp)
|
||||
: "d" (__val), "m" (*__mem), "0" (__result)
|
||||
: "memory");
|
||||
return __result;
|
||||
}
|
||||
// These variants support compare-and-swap.
|
||||
_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 %3,%1\n\t"
|
||||
"cas%.l %0,%1,%2\n\t"
|
||||
"jne 1b"
|
||||
: "=d" (__result), "=&d" (__temp), "=m" (*__mem)
|
||||
: "d" (__val), "0" (__result), "m" (*__mem));
|
||||
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;
|
||||
}
|
||||
// TAS/JBNE is unsafe on systems with strict priority-based scheduling.
|
||||
// Disable interrupts, which we can do only from supervisor mode.
|
||||
_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
|
||||
|
||||
template<int __inst>
|
||||
struct _Atomicity_lock
|
||||
{
|
||||
static volatile unsigned char _S_atomicity_lock;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
// bset with no immediate addressing
|
||||
#if defined(__mcf5200__) || defined(__mcf5300__) || defined(__mcf5400__)
|
||||
__asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b"
|
||||
: /* no outputs */
|
||||
: "a"(&__Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: "cc", "memory");
|
||||
|
||||
// bset with immediate addressing
|
||||
#elif defined(__mc68000__)
|
||||
__asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b"
|
||||
: "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: /* none */
|
||||
: "cc");
|
||||
|
||||
#else // 680x0, cpu32, 5400 support test-and-set.
|
||||
__asm__ __volatile__("1: tas %0\n\tjbne 1b"
|
||||
: "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: /* none */
|
||||
: "cc");
|
||||
template<int __inst>
|
||||
volatile unsigned char _Atomicity_lock<__inst>::_S_atomicity_lock = 0;
|
||||
|
||||
template volatile unsigned char _Atomicity_lock<0>::_S_atomicity_lock;
|
||||
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word __result;
|
||||
|
||||
// bset with no immediate addressing (not SMP-safe)
|
||||
#if defined(__mcf5200__) || defined(__mcf5300__)
|
||||
__asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b"
|
||||
: /* no outputs */
|
||||
: "a"(&_Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: "cc", "memory");
|
||||
|
||||
// CPU32 and MCF5400 support test-and-set (SMP-safe).
|
||||
#elif defined(__mcpu32__) || defined(__mcf5400__)
|
||||
__asm__ __volatile__("1: tas %0\n\tjbne 1b"
|
||||
: "+m"(_Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: /* none */
|
||||
: "cc");
|
||||
|
||||
// Use bset with immediate addressing for 68000/68010 (not SMP-safe)
|
||||
// NOTE: TAS is available on the 68000, but unsupported by some Amiga
|
||||
// memory controllers.
|
||||
#else
|
||||
__asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b"
|
||||
: "+m"(_Atomicity_lock<0>::_S_atomicity_lock)
|
||||
: /* none */
|
||||
: "cc");
|
||||
#endif
|
||||
|
||||
__result = *__mem;
|
||||
*__mem = __result + __val;
|
||||
|
||||
__Atomicity_lock<0>::_S_atomicity_lock = 0;
|
||||
|
||||
return __result;
|
||||
}
|
||||
|
||||
|
||||
__result = *__mem;
|
||||
*__mem = __result + __val;
|
||||
|
||||
_Atomicity_lock<0>::_S_atomicity_lock = 0;
|
||||
|
||||
return __result;
|
||||
}
|
||||
|
||||
#endif /* TAS / BSET */
|
||||
|
||||
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 /* _BITS_ATOMICITY_H */
|
||||
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.
|
||||
__exchange_and_add(__mem, __val);
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations.
|
||||
// Low-level functions for atomic operations: MIPS version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -27,55 +27,55 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
static inline int
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
int __result, __tmp;
|
||||
|
||||
__asm__ __volatile__
|
||||
("/* Inline exchange & add */\n\t"
|
||||
"1:\n\t"
|
||||
".set push\n\t"
|
||||
".set mips2\n\t"
|
||||
"ll %0,%3\n\t"
|
||||
"addu %1,%4,%0\n\t"
|
||||
"sc %1,%2\n\t"
|
||||
".set pop\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"
|
||||
".set push\n\t"
|
||||
".set mips2\n\t"
|
||||
"ll %0,%2\n\t"
|
||||
"addu %0,%3,%0\n\t"
|
||||
"sc %0,%1\n\t"
|
||||
".set pop\n\t"
|
||||
"beqz %0,1b\n\t"
|
||||
"/* End atomic add */"
|
||||
: "=&r"(__result), "=m"(*__mem)
|
||||
: "m" (*__mem), "r"(__val)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word __result, __tmp;
|
||||
|
||||
__asm__ __volatile__
|
||||
("/* Inline exchange & add */\n\t"
|
||||
"1:\n\t"
|
||||
".set push\n\t"
|
||||
#if _MIPS_SIM == _ABIO32
|
||||
".set mips2\n\t"
|
||||
#endif
|
||||
"ll %0,%3\n\t"
|
||||
"addu %1,%4,%0\n\t"
|
||||
"sc %1,%2\n\t"
|
||||
".set pop\n\t"
|
||||
"beqz %1,1b\n\t"
|
||||
"/* End exchange & add */"
|
||||
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
|
||||
: "m" (*__mem), "r"(__val));
|
||||
|
||||
return __result;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word __result;
|
||||
|
||||
__asm__ __volatile__
|
||||
("/* Inline atomic add */\n\t"
|
||||
"1:\n\t"
|
||||
".set push\n\t"
|
||||
#if _MIPS_SIM == _ABIO32
|
||||
".set mips2\n\t"
|
||||
#endif
|
||||
"ll %0,%2\n\t"
|
||||
"addu %0,%3,%0\n\t"
|
||||
"sc %0,%1\n\t"
|
||||
".set pop\n\t"
|
||||
"beqz %0,1b\n\t"
|
||||
"/* End atomic add */"
|
||||
: "=&r"(__result), "=m"(*__mem)
|
||||
: "m" (*__mem), "r"(__val));
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2003, 2004 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
|
||||
@ -27,8 +27,7 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
#ifdef __PPC405__
|
||||
#define _STWCX "sync \n\tstwcx. "
|
||||
@ -36,43 +35,42 @@
|
||||
#define _STWCX "stwcx. "
|
||||
#endif
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
_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");
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
_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,%3 \n\t"
|
||||
"add%I4 %1,%0,%4 \n\t"
|
||||
_STWCX " %1,0,%3 \n\t"
|
||||
"bne- 0b \n\t"
|
||||
"/* End exchange & add */"
|
||||
: "=&b"(__res), "=&r"(__tmp), "=m" (*__mem)
|
||||
: "r" (__mem), "Ir"(__val), "m" (*__mem)
|
||||
: "cr0");
|
||||
return __res;
|
||||
}
|
||||
|
||||
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,%2 \n\t"
|
||||
"add%I3 %0,%0,%3 \n\t"
|
||||
_STWCX " %0,0,%2 \n\t"
|
||||
"bne- 0b \n\t"
|
||||
"/* End atomic add */"
|
||||
: "=&b"(__tmp), "=m" (*__mem)
|
||||
: "r" (__mem), "Ir"(__val), "m" (*__mem)
|
||||
: "cr0");
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: S/390 version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2003, 2004 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
|
||||
@ -27,34 +27,28 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
typedef int _Atomic_word;
|
||||
|
||||
static inline _Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
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 */
|
||||
|
||||
|
||||
_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(%3)\n"
|
||||
"0: lr %1,%0\n"
|
||||
" ar %1,%4\n"
|
||||
" cs %0,%1,0(%3)\n"
|
||||
" jl 0b"
|
||||
: "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem)
|
||||
: "a" (__mem), "d" (__val), "m" (*__mem) : "cc");
|
||||
return __old_val;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __exchange_and_add(__mem, __val); }
|
||||
} // namespace __gnu_cxx
|
||||
|
39
contrib/libstdc++/config/cpu/sparc/atomic_word.h
Normal file
39
contrib/libstdc++/config/cpu/sparc/atomic_word.h
Normal file
@ -0,0 +1,39 @@
|
||||
// Low-level type for atomic operations -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _GLIBCXX_ATOMIC_WORD_H
|
||||
#define _GLIBCXX_ATOMIC_WORD_H 1
|
||||
|
||||
#ifdef __arch64__
|
||||
typedef long _Atomic_word;
|
||||
#else
|
||||
typedef int _Atomic_word;
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: Sparc version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2004 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
|
||||
@ -27,105 +27,99 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
#ifdef __arch64__
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word __tmp1, __tmp2;
|
||||
_Atomic_word __val_extended = __val;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
__asm__ __volatile__("1: ldx [%3], %0\n\t"
|
||||
" add %0, %4, %1\n\t"
|
||||
" casx [%3], %0, %1\n\t"
|
||||
" sub %0, %1, %0\n\t"
|
||||
" brnz,pn %0, 1b\n\t"
|
||||
" nop"
|
||||
: "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
|
||||
: "r" (__mem), "r" (__val_extended), "m" (*__mem));
|
||||
return __tmp2;
|
||||
}
|
||||
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
_Atomic_word __tmp1, __tmp2;
|
||||
_Atomic_word __val_extended = __val;
|
||||
|
||||
__asm__ __volatile__("1: ldx [%3], %0\n\t"
|
||||
" add %0, %4, %1\n\t"
|
||||
" casx [%3], %0, %1\n\t"
|
||||
" sub %0, %1, %0\n\t"
|
||||
" brnz,pn %0, 1b\n\t"
|
||||
" nop"
|
||||
: "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
|
||||
: "r" (__mem), "r" (__val_extended), "m" (*__mem));
|
||||
}
|
||||
|
||||
#else /* __arch32__ */
|
||||
|
||||
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");
|
||||
}
|
||||
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;
|
||||
|
||||
_Atomic_word
|
||||
__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;
|
||||
}
|
||||
|
||||
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 /* __arch32__ */
|
||||
|
||||
#endif /* atomicity.h */
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Wrapper of C-language FILE struct -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003, 2004 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
|
||||
@ -33,31 +33,147 @@
|
||||
|
||||
#include <bits/basic_file.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _GLIBCPP_HAVE_SYS_IOCTL_H
|
||||
#define BSD_COMP /* Get FIONREAD on Solaris2. */
|
||||
#ifdef _GLIBCXX_HAVE_POLL
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
// Pick up ioctl on Solaris 2.8
|
||||
#ifdef _GLIBCXX_HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
// Pick up FIONREAD on Solaris 2
|
||||
#ifdef _GLIBCXX_HAVE_SYS_IOCTL_H
|
||||
#define BSD_COMP
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
// Pick up FIONREAD on Solaris 2.5.
|
||||
#ifdef _GLIBCPP_HAVE_SYS_FILIO_H
|
||||
#ifdef _GLIBCXX_HAVE_SYS_FILIO_H
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCPP_HAVE_POLL
|
||||
#include <poll.h>
|
||||
#ifdef _GLIBCXX_HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#if defined(_GLIBCPP_HAVE_S_ISREG) || defined(_GLIBCPP_HAVE_S_IFREG)
|
||||
#if defined(_GLIBCXX_HAVE_S_ISREG) || defined(_GLIBCXX_HAVE_S_IFREG)
|
||||
# include <sys/stat.h>
|
||||
# ifdef _GLIBCPP_HAVE_S_ISREG
|
||||
# define _GLIBCPP_ISREG(x) S_ISREG(x)
|
||||
# ifdef _GLIBCXX_HAVE_S_ISREG
|
||||
# define _GLIBCXX_ISREG(x) S_ISREG(x)
|
||||
# else
|
||||
# define _GLIBCPP_ISREG(x) (((x) & S_IFMT) == S_IFREG)
|
||||
# define _GLIBCXX_ISREG(x) (((x) & S_IFMT) == S_IFREG)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <limits> // For <off_t>::max() and min()
|
||||
|
||||
namespace __gnu_internal
|
||||
{
|
||||
// Map ios_base::openmode flags to a string for use in fopen().
|
||||
// Table of valid combinations as given in [lib.filebuf.members]/2.
|
||||
static const char*
|
||||
fopen_mode(std::ios_base::openmode mode)
|
||||
{
|
||||
enum
|
||||
{
|
||||
in = std::ios_base::in,
|
||||
out = std::ios_base::out,
|
||||
trunc = std::ios_base::trunc,
|
||||
app = std::ios_base::app,
|
||||
binary = std::ios_base::binary
|
||||
};
|
||||
|
||||
switch (mode & (in|out|trunc|app|binary))
|
||||
{
|
||||
case ( out ): return "w";
|
||||
case ( out |app ): return "a";
|
||||
case ( out|trunc ): return "w";
|
||||
case (in ): return "r";
|
||||
case (in|out ): return "r+";
|
||||
case (in|out|trunc ): return "w+";
|
||||
|
||||
case ( out |binary): return "wb";
|
||||
case ( out |app|binary): return "ab";
|
||||
case ( out|trunc |binary): return "wb";
|
||||
case (in |binary): return "rb";
|
||||
case (in|out |binary): return "r+b";
|
||||
case (in|out|trunc |binary): return "w+b";
|
||||
|
||||
default: return 0; // invalid
|
||||
}
|
||||
}
|
||||
|
||||
// Wrapper handling partial write.
|
||||
static std::streamsize
|
||||
xwrite(int __fd, const char* __s, std::streamsize __n)
|
||||
{
|
||||
std::streamsize __nleft = __n;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const std::streamsize __ret = write(__fd, __s, __nleft);
|
||||
if (__ret == -1L && errno == EINTR)
|
||||
continue;
|
||||
if (__ret == -1L)
|
||||
break;
|
||||
|
||||
__nleft -= __ret;
|
||||
if (__nleft == 0)
|
||||
break;
|
||||
|
||||
__s += __ret;
|
||||
}
|
||||
|
||||
return __n - __nleft;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCXX_HAVE_WRITEV
|
||||
// Wrapper handling partial writev.
|
||||
static std::streamsize
|
||||
xwritev(int __fd, const char* __s1, std::streamsize __n1,
|
||||
const char* __s2, std::streamsize __n2)
|
||||
{
|
||||
std::streamsize __nleft = __n1 + __n2;
|
||||
std::streamsize __n1_left = __n1;
|
||||
|
||||
struct iovec __iov[2];
|
||||
__iov[1].iov_base = const_cast<char*>(__s2);
|
||||
__iov[1].iov_len = __n2;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
__iov[0].iov_base = const_cast<char*>(__s1);
|
||||
__iov[0].iov_len = __n1_left;
|
||||
|
||||
const std::streamsize __ret = writev(__fd, __iov, 2);
|
||||
if (__ret == -1L && errno == EINTR)
|
||||
continue;
|
||||
if (__ret == -1L)
|
||||
break;
|
||||
|
||||
__nleft -= __ret;
|
||||
if (__nleft == 0)
|
||||
break;
|
||||
|
||||
const std::streamsize __off = __ret - __n1_left;
|
||||
if (__off >= 0)
|
||||
{
|
||||
__nleft -= xwrite(__fd, __s2 + __off, __n2 - __off);
|
||||
break;
|
||||
}
|
||||
|
||||
__s1 += __ret;
|
||||
__n1_left -= __ret;
|
||||
}
|
||||
|
||||
return __n1 + __n2 - __nleft;
|
||||
}
|
||||
#endif
|
||||
} // namespace __gnu_internal
|
||||
|
||||
namespace std
|
||||
{
|
||||
// Definitions for __basic_file<char>.
|
||||
@ -67,53 +183,6 @@ namespace std
|
||||
__basic_file<char>::~__basic_file()
|
||||
{ this->close(); }
|
||||
|
||||
void
|
||||
__basic_file<char>::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
|
||||
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;
|
||||
|
||||
// Set __c_mode for use in fopen.
|
||||
// Set __p_mode for use in open.
|
||||
if (!__testi && __testo && !__testt && !__testa)
|
||||
{
|
||||
strcpy(__c_mode, "w");
|
||||
__p_mode = (O_WRONLY | O_CREAT);
|
||||
}
|
||||
if (!__testi && __testo && !__testt && __testa)
|
||||
{
|
||||
strcpy(__c_mode, "a");
|
||||
__p_mode |= O_WRONLY | O_CREAT | O_APPEND;
|
||||
}
|
||||
if (!__testi && __testo && __testt && !__testa)
|
||||
{
|
||||
strcpy(__c_mode, "w");
|
||||
__p_mode |= O_WRONLY | O_CREAT | O_TRUNC;
|
||||
}
|
||||
|
||||
if (__testi && !__testo && !__testt && !__testa)
|
||||
{
|
||||
strcpy(__c_mode, "r");
|
||||
__p_mode |= O_RDONLY;
|
||||
}
|
||||
if (__testi && __testo && !__testt && !__testa)
|
||||
{
|
||||
strcpy(__c_mode, "r+");
|
||||
__p_mode |= O_RDWR | O_CREAT;
|
||||
}
|
||||
if (__testi && __testo && __testt && !__testa)
|
||||
{
|
||||
strcpy(__c_mode, "w+");
|
||||
__p_mode |= O_RDWR | O_CREAT | O_TRUNC;
|
||||
}
|
||||
if (__testb)
|
||||
strcat(__c_mode, "b");
|
||||
}
|
||||
|
||||
__basic_file<char>*
|
||||
__basic_file<char>::sys_open(__c_file* __file, ios_base::openmode)
|
||||
{
|
||||
@ -122,56 +191,41 @@ namespace std
|
||||
{
|
||||
_M_cfile = __file;
|
||||
_M_cfile_created = false;
|
||||
this->sync();
|
||||
__ret = this;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
__basic_file<char>*
|
||||
__basic_file<char>::sys_open(int __fd, ios_base::openmode __mode,
|
||||
bool __del)
|
||||
__basic_file<char>::sys_open(int __fd, ios_base::openmode __mode)
|
||||
{
|
||||
__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)))
|
||||
const char* __c_mode = __gnu_internal::fopen_mode(__mode);
|
||||
if (__c_mode && !this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
|
||||
{
|
||||
// Iff __del is true, then close will fclose the fd.
|
||||
_M_cfile_created = __del;
|
||||
|
||||
char* __buf = NULL;
|
||||
_M_cfile_created = true;
|
||||
if (__fd == 0)
|
||||
setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
|
||||
|
||||
setvbuf(_M_cfile, __buf, _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())
|
||||
const char* __c_mode = __gnu_internal::fopen_mode(__mode);
|
||||
if (__c_mode && !this->is_open())
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_LFS
|
||||
if ((_M_cfile = fopen64(__name, __c_mode)))
|
||||
#else
|
||||
if ((_M_cfile = fopen(__name, __c_mode)))
|
||||
#endif
|
||||
{
|
||||
_M_cfile_created = true;
|
||||
__ret = this;
|
||||
@ -186,69 +240,92 @@ namespace std
|
||||
|
||||
int
|
||||
__basic_file<char>::fd()
|
||||
{ return fileno(_M_cfile) ; }
|
||||
{ return fileno(_M_cfile); }
|
||||
|
||||
__c_file*
|
||||
__basic_file<char>::file()
|
||||
{ return _M_cfile; }
|
||||
|
||||
__basic_file<char>*
|
||||
__basic_file<char>::close()
|
||||
{
|
||||
__basic_file* __retval = static_cast<__basic_file*>(NULL);
|
||||
__basic_file* __ret = static_cast<__basic_file*>(NULL);
|
||||
if (this->is_open())
|
||||
{
|
||||
if (_M_cfile_created)
|
||||
fclose(_M_cfile);
|
||||
else
|
||||
fflush(_M_cfile);
|
||||
this->sync();
|
||||
_M_cfile = 0;
|
||||
__retval = this;
|
||||
__ret = this;
|
||||
}
|
||||
return __retval;
|
||||
return __ret;
|
||||
}
|
||||
|
||||
streamsize
|
||||
__basic_file<char>::xsgetn(char* __s, streamsize __n)
|
||||
{ return fread(__s, 1, __n, _M_cfile); }
|
||||
|
||||
{
|
||||
streamsize __ret;
|
||||
do
|
||||
__ret = read(this->fd(), __s, __n);
|
||||
while (__ret == -1L && errno == EINTR);
|
||||
return __ret;
|
||||
}
|
||||
|
||||
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*/)
|
||||
{
|
||||
if (!fseek(_M_cfile, __off, __way))
|
||||
return ftell(_M_cfile);
|
||||
else
|
||||
// Fseek failed.
|
||||
return -1L;
|
||||
{ return __gnu_internal::xwrite(this->fd(), __s, __n); }
|
||||
|
||||
streamsize
|
||||
__basic_file<char>::xsputn_2(const char* __s1, streamsize __n1,
|
||||
const char* __s2, streamsize __n2)
|
||||
{
|
||||
streamsize __ret = 0;
|
||||
#ifdef _GLIBCXX_HAVE_WRITEV
|
||||
__ret = __gnu_internal::xwritev(this->fd(), __s1, __n1, __s2, __n2);
|
||||
#else
|
||||
if (__n1)
|
||||
__ret = __gnu_internal::xwrite(this->fd(), __s1, __n1);
|
||||
|
||||
if (__ret == __n1)
|
||||
__ret += __gnu_internal::xwrite(this->fd(), __s2, __n2);
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
streamoff
|
||||
__basic_file<char>::seekpos(streamoff __pos, ios_base::openmode /*__mode*/)
|
||||
{
|
||||
if (!fseek(_M_cfile, __pos, ios_base::beg))
|
||||
return ftell(_M_cfile);
|
||||
else
|
||||
// Fseek failed.
|
||||
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way)
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_LFS
|
||||
return lseek64(this->fd(), __off, __way);
|
||||
#else
|
||||
if (__off > std::numeric_limits<off_t>::max()
|
||||
|| __off < std::numeric_limits<off_t>::min())
|
||||
return -1L;
|
||||
return lseek(this->fd(), __off, __way);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
__basic_file<char>::sync()
|
||||
{ return fflush(_M_cfile); }
|
||||
|
||||
streamsize
|
||||
__basic_file<char>::showmanyc_helper()
|
||||
__basic_file<char>::showmanyc()
|
||||
{
|
||||
#ifdef FIONREAD
|
||||
// Pipes and sockets.
|
||||
#ifdef _GLIBCXX_FIONREAD_TAKES_OFF_T
|
||||
off_t __num = 0;
|
||||
#else
|
||||
int __num = 0;
|
||||
#endif
|
||||
int __r = ioctl(this->fd(), FIONREAD, &__num);
|
||||
if (!__r && __num >= 0)
|
||||
return __num;
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCPP_HAVE_POLL
|
||||
#ifdef _GLIBCXX_HAVE_POLL
|
||||
// Cheap test.
|
||||
struct pollfd __pfd[1];
|
||||
__pfd[0].fd = this->fd();
|
||||
@ -257,12 +334,12 @@ namespace std
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#if defined(_GLIBCPP_HAVE_S_ISREG) || defined(_GLIBCPP_HAVE_S_IFREG)
|
||||
#if defined(_GLIBCXX_HAVE_S_ISREG) || defined(_GLIBCXX_HAVE_S_IFREG)
|
||||
// Regular files.
|
||||
struct stat __buffer;
|
||||
int __ret = fstat(this->fd(), &__buffer);
|
||||
if (!__ret && _GLIBCPP_ISREG(__buffer.st_mode))
|
||||
return __buffer.st_size - ftell(_M_cfile);
|
||||
if (!__ret && _GLIBCXX_ISREG(__buffer.st_mode))
|
||||
return __buffer.st_size - lseek(this->fd(), 0, ios_base::cur);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Wrapper of C-language FILE struct -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003, 2004 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
|
||||
@ -36,8 +36,8 @@
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_BASIC_FILE
|
||||
#define _CPP_BASIC_FILE 1
|
||||
#ifndef _BASIC_FILE_STDIO_H
|
||||
#define _BASIC_FILE_STDIO_H 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@ -56,16 +56,13 @@ namespace std
|
||||
{
|
||||
// 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);
|
||||
|
||||
@ -73,13 +70,7 @@ namespace std
|
||||
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);
|
||||
sys_open(int __fd, ios_base::openmode __mode);
|
||||
|
||||
__basic_file*
|
||||
close();
|
||||
@ -90,28 +81,30 @@ namespace std
|
||||
int
|
||||
fd();
|
||||
|
||||
__c_file*
|
||||
file();
|
||||
|
||||
~__basic_file();
|
||||
|
||||
streamsize
|
||||
xsputn(const char* __s, streamsize __n);
|
||||
|
||||
streamsize
|
||||
xsputn_2(const char* __s1, streamsize __n1,
|
||||
const char* __s2, streamsize __n2);
|
||||
|
||||
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);
|
||||
seekoff(streamoff __off, ios_base::seekdir __way);
|
||||
|
||||
int
|
||||
sync();
|
||||
|
||||
streamsize
|
||||
showmanyc_helper();
|
||||
showmanyc();
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_BASIC_FILE
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// underlying io library -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003 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
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
// c_io_stdio.h - Defines for using "C" stdio.h
|
||||
|
||||
#ifndef _CPP_IO_STDIO_H
|
||||
#define _CPP_IO_STDIO_H 1
|
||||
#ifndef _C_IO_STDIO_H
|
||||
#define _C_IO_STDIO_H 1
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstddef>
|
||||
@ -38,20 +38,12 @@
|
||||
|
||||
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
|
||||
// for basic_file.h
|
||||
typedef FILE __c_file;
|
||||
|
||||
// for ios_base.h
|
||||
// for ios_base.h
|
||||
struct __ios_flags
|
||||
{
|
||||
typedef short __int_type;
|
||||
@ -90,4 +82,4 @@ namespace std
|
||||
};
|
||||
}
|
||||
|
||||
#endif // _CPP_IO_STDIO_H
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Linker script for GNU ld 2.11.94+ only.
|
||||
## Linker script for GNU ld 2.13.91+ only.
|
||||
##
|
||||
## Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
##
|
||||
## This file is part of the libstdc++ version 3 distribution.
|
||||
##
|
||||
@ -20,159 +20,87 @@
|
||||
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
## USA.
|
||||
|
||||
GLIBCPP_3.2 {
|
||||
GLIBCXX_3.4 {
|
||||
|
||||
global:
|
||||
|
||||
# Names inside the 'extern' block are demangled names.
|
||||
# All but the last are terminated with a semicolon.
|
||||
extern "C++"
|
||||
{
|
||||
std::[A-Za]*;
|
||||
std::ba[a-r]*;
|
||||
std::basic_[a-h]*;
|
||||
std::basic_ifstream*;
|
||||
std::basic_istringstream*;
|
||||
std::basic_istream*;
|
||||
std::basic_iostream*;
|
||||
std::basic_[j-r]*;
|
||||
std::basic_streambuf*;
|
||||
std::basic_stringbuf*;
|
||||
std::basic_stringstream*;
|
||||
std::basic_[t-z]*;
|
||||
std::ba[t-z]*;
|
||||
std::b[b-z]*;
|
||||
std::c[a-n]*;
|
||||
std::co[a-c]*;
|
||||
std::codecvt_byname*;
|
||||
std::codecvt::[A-Za-b]*;
|
||||
std::codecvt::[A-Zd-z]*;
|
||||
std::codecvt_c;
|
||||
std::codecvt_w;
|
||||
std::co[e-z]*;
|
||||
std::c[p-z]*;
|
||||
std::c_[a-z]*;
|
||||
std::[A-Zd-k]*;
|
||||
std::[A-Za-h]*;
|
||||
std::i[a-n]*;
|
||||
std::ios_base::[A-Ha-z]*;
|
||||
std::ios_base::_M_grow_words*;
|
||||
std::ios_base::_M_init*;
|
||||
std::ios_base::Init::[A-Za-z]*;
|
||||
std::ios_base::[J-Za-z]*;
|
||||
std::i[p-z]*;
|
||||
std::[A-Zj-k]*;
|
||||
std::length_error*;
|
||||
std::logic_error*;
|
||||
std::locale::[A-Za-e]*;
|
||||
std::locale::facet::[A-Za-z]*;
|
||||
std::locale::facet::_M*;
|
||||
std::locale::facet::_S_c_locale;
|
||||
std::locale::facet::_S_get_c_locale*;
|
||||
std::locale::facet::_S_clone_c_locale*;
|
||||
std::locale::facet::_S_create_c_locale*;
|
||||
std::locale::facet::_S_destroy_c_locale*;
|
||||
std::locale::[A-Zg-z]*;
|
||||
std::locale::_[A-Ra-z]*;
|
||||
std::locale::_S_classic;
|
||||
std::locale::_S_global;
|
||||
std::locale::_S_num_categories;
|
||||
std::locale::[A-Zg-h]*;
|
||||
std::locale::id::[A-Za-z]*;
|
||||
std::locale::id::_M_id*;
|
||||
std::locale::[A-Zj-z]*;
|
||||
std::locale::_[A-Ha-z]*;
|
||||
std::locale::_Impl::[A-Za-z]*;
|
||||
std::locale::_Impl::_M_[A-Za-z]*;
|
||||
std::locale::_[J-Ra-z]*;
|
||||
std::locale::_S_normalize_category*;
|
||||
std::locale::_[T-Za-z]*;
|
||||
std::[A-Zm]*;
|
||||
std::n[a-t]*;
|
||||
std::num_put_[cw];
|
||||
std::numeric*;
|
||||
std::numpunct*;
|
||||
std::num_get*;
|
||||
std::num_get_[cw];
|
||||
std::n[v-z]*;
|
||||
std::ostrstream*;
|
||||
std::overflow_error*;
|
||||
std::out_of_range*;
|
||||
std::[A-Zp-z]*;
|
||||
std::[A-Zm-z]*;
|
||||
std::_List_node_base::hook*;
|
||||
std::_List_node_base::swap*;
|
||||
std::_List_node_base::unhook*;
|
||||
std::_List_node_base::reverse*;
|
||||
std::_List_node_base::transfer*;
|
||||
std::__throw_*;
|
||||
std::__numeric_limits_base*;
|
||||
std::__timepunct*;
|
||||
std::_S_bit_count;
|
||||
std::_S_first_one
|
||||
std::__numeric_limits_base*;
|
||||
std::__num_base::_S_format_float*;
|
||||
std::__num_base::_S_format_int*;
|
||||
std::__num_base::_S_atoms_in;
|
||||
std::__num_base::_S_atoms_out;
|
||||
std::__moneypunct_cache*;
|
||||
std::__numpunct_cache*;
|
||||
std::__timepunct_cache*;
|
||||
__gnu_debug::_Safe_iterator_base*;
|
||||
__gnu_debug::_Safe_sequence_base*;
|
||||
__gnu_debug::_Error_formatter*;
|
||||
__gnu_norm::_List_node_base::hook*;
|
||||
__gnu_norm::_List_node_base::swap*;
|
||||
__gnu_norm::_List_node_base::unhook*;
|
||||
__gnu_norm::_List_node_base::reverse*;
|
||||
__gnu_norm::_List_node_base::transfer*
|
||||
};
|
||||
|
||||
# Names not in an 'extern' block are mangled names.
|
||||
_ZSt7getline*;
|
||||
_ZStrs*;
|
||||
_ZNSo*;
|
||||
_ZNKSt9basic_ios*;
|
||||
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE15_M_cache_facetsERKSt6locale;
|
||||
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[A-Z]*;
|
||||
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[0-9][A-Za-z]*;
|
||||
_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[0-9][0-9][A-Za-z]*;
|
||||
|
||||
_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEC*;
|
||||
_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEED*;
|
||||
_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC*;
|
||||
_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED*;
|
||||
# operator new(size_t)
|
||||
_Znw[jm];
|
||||
# operator new(size_t, std::nothrow_t const&)
|
||||
_Znw[jm]RKSt9nothrow_t;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE6do_put*;
|
||||
# operator delete(void*)
|
||||
_ZdlPv;
|
||||
# operator delete(void*, std::nothrow_t const&)
|
||||
_ZdlPvRKSt9nothrow_t;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE3put*;
|
||||
_ZNSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE2idE;
|
||||
# operator new[](size_t)
|
||||
_Zna[jm];
|
||||
# operator new[](size_t, std::nothrow_t const&)
|
||||
_Zna[jm]RKSt9nothrow_t;
|
||||
|
||||
_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intI[lmxy]EES3_S3_RSt8ios_basecccT_;
|
||||
|
||||
_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intI[lmxy]EES3_S3_RSt8ios_basewccT_;
|
||||
|
||||
_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatI[de]EES3_S3_RSt8ios_baseccT_;
|
||||
|
||||
_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatI[de]EES3_S3_RSt8ios_basewcT_;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE12_M_widen_int*;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE14_M_widen_float*;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE9_M_insert*;
|
||||
|
||||
_ZSt9use_facetISt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEEERKT_RKSt6locale;
|
||||
|
||||
# __num_base
|
||||
_ZNSt10__num_base13_S_format_intERKSt8ios_basePccc;
|
||||
_ZNSt10__num_base15_S_format_floatERKSt8ios_basePcc[il];
|
||||
_ZNSt10__num_base8_S_atomsE;
|
||||
|
||||
# std::string minus binary operator plus
|
||||
_ZNKSs*;
|
||||
_ZNKSb*;
|
||||
_ZNSs[A-Za-z]*;
|
||||
_ZNSs[0-9][A-Za-z]*;
|
||||
_ZNSs[0-9][0-9][A-Za-z]*;
|
||||
_ZNSs[0-9]_[A-Ra-z]*;
|
||||
_ZNSs[0-9][0-9]_[A-Ra-z]*;
|
||||
_ZNSs12_S_empty_repEv;
|
||||
_ZNSs20_S_empty_rep_storageE;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE20_S_empty_rep_storageE;
|
||||
_ZNSs12_S_constructE*;
|
||||
_ZNSs13_S_copy_charsE*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE[A-Ra-z]*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE[0-9][A-Ra-z]*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE[0-9][0-9][A-Ra-z]*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE[0-9]_[A-Ra-z]*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE[0-9][0-9]_[A-Ra-z]*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE13_S_copy_chars*;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE12_S_constructE[jm]wRKS1_;
|
||||
_ZNSbIwSt11char_traitsIwESaIwEE12_S_empty_repEv;
|
||||
_ZSt24__uninitialized_copy_auxIN9*;
|
||||
_ZSt26__uninitialized_fill_n_aux*;
|
||||
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_;
|
||||
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ES3_RKS6_;
|
||||
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_EPKS3_RKS6_;
|
||||
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ES3_RKS6_;
|
||||
|
||||
# std::__basic_file minus showmanyc_helper
|
||||
_ZNSt12__basic_fileIcED*;
|
||||
_ZNSt12__basic_fileIcEC*;
|
||||
_ZNSt12__basic_fileIcE8sys_open*;
|
||||
_ZNSt12__basic_fileIcE8sys_getc*;
|
||||
_ZNSt12__basic_fileIcE10sys_ungetc*;
|
||||
_ZNSt12__basic_fileIcE7seekpos*;
|
||||
_ZNSt12__basic_fileIcE7seekoff*;
|
||||
_ZNSt12__basic_fileIcE6xsputn*;
|
||||
_ZNSt12__basic_fileIcE6xsgetn*;
|
||||
_ZNSt12__basic_fileIcE5close*;
|
||||
_ZNSt12__basic_fileIcE4sync*;
|
||||
_ZNSt12__basic_fileIcE4open*;
|
||||
_ZNSt12__basic_fileIcE2fd*;
|
||||
_ZNSt12__basic_fileIcE12_M_open_modeE*;
|
||||
_ZNKSt12__basic_fileIcE7is_open*;
|
||||
# operator delete[](void*)
|
||||
_ZdaPv;
|
||||
# operator delete[](void*, std::nothrow_t const&)
|
||||
_ZdaPvRKSt9nothrow_t;
|
||||
|
||||
# std::locale destructors
|
||||
_ZNSt6localeD*;
|
||||
@ -180,224 +108,165 @@ GLIBCPP_3.2 {
|
||||
# std::locale::facet destructors
|
||||
_ZNSt6locale5facetD*;
|
||||
|
||||
# std::codecvt<char> members.
|
||||
_ZNKSt7codecvtIcc11__mbstate_tE*;
|
||||
# std::codecvt<char>::~codecvt
|
||||
_ZNSt7codecvtIcc11__mbstate_tED*;
|
||||
# std::codecvt<char>::codecvt(size_t), where size_t variable.
|
||||
_ZNSt7codecvtIcc11__mbstate_tEC[12]E[jm];
|
||||
# std::codecvt<char>::id
|
||||
_ZNSt7codecvtIcc11__mbstate_tE2idE;
|
||||
# std::locale::_Impl constructors, destructors
|
||||
_ZNSt6locale5_ImplC*;
|
||||
_ZNSt6locale5_ImplD*;
|
||||
|
||||
# std::codecvt<wchar_t> members.
|
||||
_ZNKSt7codecvtIwc11__mbstate_tE*;
|
||||
# std::codecvt<wchar_t>::~codecvt
|
||||
_ZNSt7codecvtIwc11__mbstate_tED*;
|
||||
# std::codecvt<wchar_t>::codecvt(size_t), where size_t variable.
|
||||
_ZNSt7codecvtIwc11__mbstate_tEC[12]E[jm];
|
||||
# std::codecvt<wchar_t>::id
|
||||
_ZNSt7codecvtIwc11__mbstate_tE2idE;
|
||||
# std::ios_base, std::ios_base::Init destructors
|
||||
_ZNSt8ios_baseD*;
|
||||
_ZNSt8ios_base4InitD*;
|
||||
|
||||
# std::use_facet<codecvt>
|
||||
_ZSt9use_facetISt7codecvtIcc11__mbstate_tEERKT_RKSt6locale;
|
||||
_ZSt9use_facetISt7codecvtIwc11__mbstate_tEERKT_RKSt6locale;
|
||||
|
||||
# std::has_facet*
|
||||
# bool has_facet
|
||||
_ZSt9has_facet*;
|
||||
|
||||
# std::__default_alloc_template
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE10deallocate*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE8allocate*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE12_S_free_listE;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE22_S_node_allocator_lockE;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE9_S_refillE*;
|
||||
# _Rb_tree
|
||||
_ZSt18_Rb_tree_decrementPKSt18_Rb_tree_node_base;
|
||||
_ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base;
|
||||
_ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_base;
|
||||
_ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base;
|
||||
_ZSt20_Rb_tree_black_countPKSt18_Rb_tree_node_baseS1_;
|
||||
_ZSt20_Rb_tree_rotate_leftPSt18_Rb_tree_node_baseRS0_;
|
||||
_ZSt21_Rb_tree_rotate_rightPSt18_Rb_tree_node_baseRS0_;
|
||||
_ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_;
|
||||
_ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_;
|
||||
|
||||
# std::__default_alloc_template to be removed in the future
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE10reallocateEPv*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE11_S_round_upE*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE14_S_chunk_allocE*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE17_S_freelist_indexE*;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE;
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE5_Lock*;
|
||||
# std::__codecvt_abstract_base*
|
||||
_ZNStSt23__codecvt_abstract_base*;
|
||||
|
||||
# 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;
|
||||
# std::__basic_file
|
||||
_ZNKSt12__basic_fileIcE7is_openEv;
|
||||
_ZNSt12__basic_fileIcE2fdEv;
|
||||
_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei;
|
||||
_ZNSt12__basic_fileIcE4syncEv;
|
||||
_ZNSt12__basic_fileIcE5closeEv;
|
||||
_ZNSt12__basic_fileIcE6xsgetn*;
|
||||
_ZNSt12__basic_fileIcE6xsputn*;
|
||||
_ZNSt12__basic_fileIcE7seekoff*;
|
||||
_ZNSt12__basic_fileIcE8sys_openE*St13_Ios_Openmode;
|
||||
_ZNSt12__basic_fileIcE8sys_openEiSt13_Ios_Openmode;
|
||||
_ZNSt12__basic_fileIcE8xsputn_2*;
|
||||
_ZNSt12__basic_fileIcE9showmanycEv;
|
||||
_ZNSt12__basic_fileIcEC*;
|
||||
_ZNSt12__basic_fileIcED*;
|
||||
|
||||
# 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
|
||||
# virtual table
|
||||
_ZTVNSt8ios_base7failureE;
|
||||
_ZTVNSt6locale5facetE;
|
||||
_ZTVS[a-z];
|
||||
_ZTVSt[0-9][A-Za-z]*;
|
||||
_ZTVSt[0-9][0-9][A-Za-z]*;
|
||||
_ZTTS[a-z];
|
||||
_ZTTSt[0-9][A-Za-z]*;
|
||||
_ZTTSt[0-9][0-9][A-Za-z]*;
|
||||
_ZTVN9__gnu_cxx*;
|
||||
_ZTVNSt6locale5facetE;
|
||||
_ZTVSt11__timepunctI[cw]E;
|
||||
_ZTVNSt8ios_base7failureE;
|
||||
_ZTVSt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
|
||||
_ZTVSt21__ctype_abstract_baseI[cw]E;
|
||||
|
||||
# XXX
|
||||
_ZTVN10__cxxabi*;
|
||||
# VTT structure
|
||||
_ZTTS[a-z];
|
||||
_ZTTSt[0-9][A-Za-z]*;
|
||||
_ZTTSt[0-9][0-9][A-Za-z]*;
|
||||
|
||||
# typeinfo
|
||||
_ZTI[a-z];
|
||||
_ZTIP[a-z];
|
||||
_ZTIPK[a-z];
|
||||
# typeinfo structure
|
||||
_ZTIS[a-z];
|
||||
_ZTINSt8ios_base7failureE;
|
||||
_ZTINSt6locale5facetE;
|
||||
_ZTISt[0-9][A-Za-z]*;
|
||||
_ZTISt[0-9][0-9][A-Za-z]*;
|
||||
_ZTS[a-z];
|
||||
_ZTSS[a-z];
|
||||
_ZTSP[a-z];
|
||||
_ZTSPK[a-z];
|
||||
_ZTSSt[0-9][A-Za-z]*;
|
||||
_ZTSSt[0-9][0-9][A-Za-z]*;
|
||||
_ZTSN9__gnu_cxx*;
|
||||
_ZTIN9__gnu_cxx*;
|
||||
_ZTINSt8ios_base7failureE;
|
||||
_ZTSNSt8ios_base7failureE;
|
||||
_ZTINSt6locale5facetE;
|
||||
_ZTSNSt6locale5facetE;
|
||||
_ZTISt11__timepunctI[cw]E;
|
||||
_ZTSSt11__timepunctI[cw]E;
|
||||
_ZTSSt10__num_base;
|
||||
_ZTISt10__num_base;
|
||||
_ZTSSt21__ctype_abstract_baseI[cw]E;
|
||||
_ZTISt21__ctype_abstract_baseI[cw]E;
|
||||
_ZTISt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
|
||||
_ZTSSt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
|
||||
_ZTIN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EEE;
|
||||
_ZTIN9__gnu_cxx13stdio_filebufI[cw]St11char_traitsI[cw]EEE;
|
||||
|
||||
# XXX
|
||||
_ZTIN10__cxxabi*;
|
||||
_ZTSN10__cxxabi*;
|
||||
# typeinfo name
|
||||
_ZTSNSt8ios_base7failureE;
|
||||
_ZTSNSt6locale5facetE;
|
||||
_ZTSS[a-z];
|
||||
_ZTSSt[0-9][A-Za-z]*;
|
||||
_ZTSSt[0-9][0-9][A-Za-z]*;
|
||||
_ZTSSt11__timepunctI[cw]E;
|
||||
_ZTSSt10__num_base;
|
||||
_ZTSSt21__ctype_abstract_baseI[cw]E;
|
||||
_ZTSSt23__codecvt_abstract_baseI[cw]c11__mbstate_tE;
|
||||
_ZTSN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EEE;
|
||||
_ZTSN9__gnu_cxx13stdio_filebufI[cw]St11char_traitsI[cw]EEE;
|
||||
|
||||
# function-scope static objects requires a guard variable.
|
||||
_ZGV*;
|
||||
_ZGVNSt*;
|
||||
|
||||
# virtual function thunks
|
||||
_ZTh*;
|
||||
_ZTv*;
|
||||
_ZTc*;
|
||||
_ZThn8_NS*;
|
||||
_ZThn16_NS*;
|
||||
_ZTv0_n12_NS*;
|
||||
_ZTv0_n24_NS*;
|
||||
|
||||
# std::__convert_to_v
|
||||
_ZSt14__convert_to_v*;
|
||||
|
||||
# stub functions from libmath
|
||||
sinf;
|
||||
sinl;
|
||||
sinhf;
|
||||
sinhl;
|
||||
cosf;
|
||||
cosl;
|
||||
coshf;
|
||||
coshl;
|
||||
tanf;
|
||||
tanl;
|
||||
tanhf;
|
||||
tanhl;
|
||||
atan2f;
|
||||
atan2l;
|
||||
expf;
|
||||
expl;
|
||||
hypotf;
|
||||
hypotl;
|
||||
hypot;
|
||||
logf;
|
||||
logl;
|
||||
log10f;
|
||||
log10l;
|
||||
powf;
|
||||
powl;
|
||||
sqrtf;
|
||||
sqrtl;
|
||||
copysignf;
|
||||
__signbit;
|
||||
__signbitf;
|
||||
__signbitl;
|
||||
|
||||
# __gnu_cxx::stdio_sync_filebuf
|
||||
_ZTVN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EEE;
|
||||
|
||||
# __gnu_cxx::__atomic_add
|
||||
# __gnu_cxx::__exchange_and_add
|
||||
_ZN9__gnu_cxx12__atomic_add*;
|
||||
_ZN9__gnu_cxx18__exchange_and_add*;
|
||||
|
||||
# DO NOT DELETE THIS LINE. Port-specific symbols, if any, will be here.
|
||||
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
# Symbols added after GLIBCPP_3.2
|
||||
GLIBCPP_3.2.1 {
|
||||
GLIBCXX_3.4.1 {
|
||||
|
||||
_ZNSt12__basic_fileIcE4fileEv;
|
||||
|
||||
} GLIBCXX_3.4;
|
||||
|
||||
GLIBCXX_3.4.2 {
|
||||
|
||||
_ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structj;
|
||||
_ZNSt7codecvtIcc11__mbstate_tEC2EP15__locale_structj;
|
||||
_ZNSt7codecvtIwc11__mbstate_tEC1EP15__locale_structj;
|
||||
_ZNSt7codecvtIwc11__mbstate_tEC2EP15__locale_structj;
|
||||
_ZN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EE4fileEv;
|
||||
|
||||
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_;
|
||||
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_;
|
||||
|
||||
# stub functions from libmath
|
||||
sinf;
|
||||
sinl;
|
||||
sinhf;
|
||||
sinhl;
|
||||
cosf;
|
||||
cosl;
|
||||
coshf;
|
||||
coshl;
|
||||
tanf;
|
||||
tanl;
|
||||
tanhf;
|
||||
tanhl;
|
||||
atan2f;
|
||||
atan2l;
|
||||
expf;
|
||||
expl;
|
||||
hypotf;
|
||||
hypotl;
|
||||
hypot;
|
||||
logf;
|
||||
logl;
|
||||
log10f;
|
||||
log10l;
|
||||
powf;
|
||||
powl;
|
||||
sqrtf;
|
||||
sqrtl;
|
||||
copysignf;
|
||||
nan;
|
||||
__signbit;
|
||||
__signbitf;
|
||||
__signbitl;
|
||||
|
||||
} GLIBCPP_3.2;
|
||||
|
||||
GLIBCPP_3.2.2 {
|
||||
|
||||
_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE;
|
||||
|
||||
} GLIBCPP_3.2.1;
|
||||
|
||||
GLIBCPP_3.2.3 {
|
||||
|
||||
global:
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
# Needed only when generic cpu's atomicity.h is in use.
|
||||
__gnu_cxx::_Atomic_add_mutex;
|
||||
__gnu_cxx::_Atomic_add_mutex_once;
|
||||
__gnu_cxx::__gthread_atomic_add_mutex_once;
|
||||
|
||||
std::__num_base::_S_atoms_in;
|
||||
std::__num_base::_S_atoms_out
|
||||
};
|
||||
|
||||
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE6_M_pad*;
|
||||
|
||||
_ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE14_M_convert_intI[yxml]EES3_S3_RSt8ios_base[cw]T_;
|
||||
|
||||
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE14_M_group_float*;
|
||||
|
||||
_ZNKSt7num_putI[wc]St19ostreambuf_iteratorI[wc]St11char_traitsI[wc]EEE12_M_group_int*;
|
||||
|
||||
# __basic_file::showmanyc_helper
|
||||
_ZNSt12__basic_fileIcE16showmanyc_helperEv;
|
||||
|
||||
} GLIBCPP_3.2.2;
|
||||
_ZN9__gnu_cxx11__pool_base9_M_refillE[jm];
|
||||
_ZN9__gnu_cxx11__pool_base16_M_get_free_listE[jm];
|
||||
_ZN9__gnu_cxx11__pool_base12_M_get_mutexEv;
|
||||
|
||||
} GLIBCXX_3.4.1;
|
||||
|
||||
# Symbols in the support library (libsupc++) have their own tag.
|
||||
CXXABI_1.2 {
|
||||
CXXABI_1.3 {
|
||||
|
||||
global:
|
||||
__cxa_allocate_exception;
|
||||
@ -411,6 +280,9 @@ CXXABI_1.2 {
|
||||
__cxa_free_exception;
|
||||
__cxa_get_globals;
|
||||
__cxa_get_globals_fast;
|
||||
__cxa_guard_abort;
|
||||
__cxa_guard_acquire;
|
||||
__cxa_guard_release;
|
||||
__cxa_pure_virtual;
|
||||
__cxa_rethrow;
|
||||
__cxa_throw;
|
||||
@ -428,38 +300,72 @@ CXXABI_1.2 {
|
||||
__gxx_personality_sj0;
|
||||
__dynamic_cast;
|
||||
|
||||
# *_type_info classes, ctor and dtor
|
||||
_ZN10__cxxabiv117__array_type_info*;
|
||||
_ZN10__cxxabiv117__class_type_info*;
|
||||
_ZN10__cxxabiv116__enum_type_info*;
|
||||
_ZN10__cxxabiv120__function_type_info*;
|
||||
_ZN10__cxxabiv123__fundamental_type_info*;
|
||||
_ZN10__cxxabiv117__pbase_type_info*;
|
||||
_ZN10__cxxabiv129__pointer_to_member_type_info*;
|
||||
_ZN10__cxxabiv119__pointer_type_info*;
|
||||
_ZN10__cxxabiv120__si_class_type_info*;
|
||||
_ZN10__cxxabiv121__vmi_class_type_info*;
|
||||
|
||||
# *_type_info classes, member functions
|
||||
_ZNK10__cxxabiv117__class_type_info*;
|
||||
_ZNK10__cxxabiv120__function_type_info*;
|
||||
_ZNK10__cxxabiv117__pbase_type_info*;
|
||||
_ZNK10__cxxabiv129__pointer_to_member_type_info*;
|
||||
_ZNK10__cxxabiv119__pointer_type_info*;
|
||||
_ZNK10__cxxabiv120__si_class_type_info*;
|
||||
_ZNK10__cxxabiv121__vmi_class_type_info*;
|
||||
|
||||
# virtual table
|
||||
_ZTVN10__cxxabiv117__array_type_infoE;
|
||||
_ZTVN10__cxxabiv117__class_type_infoE;
|
||||
_ZTVN10__cxxabiv116__enum_type_infoE;
|
||||
_ZTVN10__cxxabiv120__function_type_infoE;
|
||||
_ZTVN10__cxxabiv123__fundamental_type_infoE;
|
||||
_ZTVN10__cxxabiv117__pbase_type_infoE;
|
||||
_ZTVN10__cxxabiv129__pointer_to_member_type_infoE;
|
||||
_ZTVN10__cxxabiv119__pointer_type_infoE;
|
||||
_ZTVN10__cxxabiv120__si_class_type_infoE;
|
||||
_ZTVN10__cxxabiv121__vmi_class_type_infoE;
|
||||
|
||||
# typeinfo structure (and some names)
|
||||
_ZTI[a-z];
|
||||
_ZTIP[a-z];
|
||||
_ZTIPK[a-z];
|
||||
_ZTIN10__cxxabiv117__array_type_infoE;
|
||||
_ZTIN10__cxxabiv117__class_type_infoE;
|
||||
_ZTIN10__cxxabiv116__enum_type_infoE;
|
||||
_ZTIN10__cxxabiv120__function_type_infoE;
|
||||
_ZTIN10__cxxabiv123__fundamental_type_infoE;
|
||||
_ZTIN10__cxxabiv117__pbase_type_infoE;
|
||||
_ZTIN10__cxxabiv129__pointer_to_member_type_infoE;
|
||||
_ZTIN10__cxxabiv119__pointer_type_infoE;
|
||||
_ZTIN10__cxxabiv120__si_class_type_infoE;
|
||||
_ZTIN10__cxxabiv121__vmi_class_type_infoE;
|
||||
|
||||
# typeinfo name
|
||||
_ZTS[a-z];
|
||||
_ZTSP[a-z];
|
||||
_ZTSPK[a-z];
|
||||
_ZTSN10__cxxabiv117__array_type_infoE;
|
||||
_ZTSN10__cxxabiv117__class_type_infoE;
|
||||
_ZTSN10__cxxabiv116__enum_type_infoE;
|
||||
_ZTSN10__cxxabiv120__function_type_infoE;
|
||||
_ZTSN10__cxxabiv123__fundamental_type_infoE;
|
||||
_ZTSN10__cxxabiv117__pbase_type_infoE;
|
||||
_ZTSN10__cxxabiv129__pointer_to_member_type_infoE;
|
||||
_ZTSN10__cxxabiv119__pointer_type_infoE;
|
||||
_ZTSN10__cxxabiv120__si_class_type_infoE;
|
||||
_ZTSN10__cxxabiv121__vmi_class_type_infoE;
|
||||
|
||||
# __gnu_cxx::_verbose_terminate_handler()
|
||||
_ZN9__gnu_cxx27__verbose_terminate_handlerEv;
|
||||
|
||||
# XXX Should not be exported.
|
||||
__cxa_dyn_string_append_char;
|
||||
__cxa_dyn_string_append_cstr;
|
||||
__cxa_dyn_string_append;
|
||||
__cxa_dyn_string_clear;
|
||||
__cxa_dyn_string_copy_cstr;
|
||||
__cxa_dyn_string_copy;
|
||||
__cxa_dyn_string_delete;
|
||||
__cxa_dyn_string_eq;
|
||||
__cxa_dyn_string_init;
|
||||
__cxa_dyn_string_insert_char;
|
||||
__cxa_dyn_string_insert_cstr;
|
||||
__cxa_dyn_string_insert;
|
||||
__cxa_dyn_string_new;
|
||||
__cxa_dyn_string_prepend_cstr;
|
||||
__cxa_dyn_string_prepend;
|
||||
__cxa_dyn_string_release;
|
||||
__cxa_dyn_string_resize;
|
||||
__cxa_dyn_string_substring;
|
||||
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
# Symbols added after CXXABI_1.2
|
||||
CXXABI_1.2.1 {
|
||||
|
||||
__cxa_guard_acquire;
|
||||
__cxa_guard_release;
|
||||
__cxa_guard_abort;
|
||||
|
||||
} CXXABI_1.2;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Wrapper for underlying C-language localization -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003 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
|
||||
@ -33,89 +33,22 @@
|
||||
|
||||
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
#include <cerrno> // For errno
|
||||
#include <cmath> // For isinf, finite, finitef, fabs
|
||||
#include <cstdlib> // For strof, strtold
|
||||
#include <locale>
|
||||
|
||||
#ifdef _GLIBCPP_HAVE_IEEEFP_H
|
||||
#ifdef _GLIBCXX_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)
|
||||
const __c_locale&)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
@ -124,18 +57,18 @@ namespace std
|
||||
setlocale(LC_ALL, "C");
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
#if defined(_GLIBCPP_USE_C99)
|
||||
#if defined(_GLIBCXX_USE_C99)
|
||||
float __f = strtof(__s, &__sanity);
|
||||
#else
|
||||
double __d = strtod(__s, &__sanity);
|
||||
float __f = static_cast<float>(__d);
|
||||
#ifdef _GLIBCPP_HAVE_FINITEF
|
||||
#ifdef _GLIBCXX_HAVE_FINITEF
|
||||
if (!finitef (__f))
|
||||
errno = ERANGE;
|
||||
#elif defined (_GLIBCPP_HAVE_FINITE)
|
||||
#elif defined (_GLIBCXX_HAVE_FINITE)
|
||||
if (!finite (static_cast<double> (__f)))
|
||||
errno = ERANGE;
|
||||
#elif defined (_GLIBCPP_HAVE_ISINF)
|
||||
#elif defined (_GLIBCXX_HAVE_ISINF)
|
||||
if (isinf (static_cast<double> (__f)))
|
||||
errno = ERANGE;
|
||||
#else
|
||||
@ -143,7 +76,7 @@ namespace std
|
||||
errno = ERANGE;
|
||||
#endif
|
||||
#endif
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __f;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -155,7 +88,7 @@ namespace std
|
||||
template<>
|
||||
void
|
||||
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
|
||||
const __c_locale&, int)
|
||||
const __c_locale&)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
@ -165,7 +98,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
double __d = strtod(__s, &__sanity);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __d;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -177,18 +110,18 @@ namespace std
|
||||
template<>
|
||||
void
|
||||
__convert_to_v(const char* __s, long double& __v,
|
||||
ios_base::iostate& __err, const __c_locale&, int)
|
||||
ios_base::iostate& __err, const __c_locale&)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
// Assumes __s formatted for "C" locale.
|
||||
char* __old = strdup(setlocale(LC_ALL, NULL));
|
||||
setlocale(LC_ALL, "C");
|
||||
#if defined(_GLIBCPP_USE_C99)
|
||||
#if defined(_GLIBCXX_USE_C99)
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
long double __ld = strtold(__s, &__sanity);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __ld;
|
||||
#else
|
||||
typedef char_traits<char>::int_type int_type;
|
||||
@ -197,7 +130,7 @@ namespace std
|
||||
int __p = sscanf(__s, "%Lf", &__ld);
|
||||
if (errno == ERANGE)
|
||||
__p = 0;
|
||||
#ifdef _GLIBCPP_HAVE_FINITEL
|
||||
#ifdef _GLIBCXX_HAVE_FINITEL
|
||||
if ((__p == 1) && !finitel (__ld))
|
||||
__p = 0;
|
||||
#endif
|
||||
@ -212,9 +145,16 @@ namespace std
|
||||
}
|
||||
|
||||
void
|
||||
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char*,
|
||||
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
|
||||
__c_locale)
|
||||
{ __cloc = NULL; }
|
||||
{
|
||||
// Currently, the generic model only supports the "C" locale.
|
||||
// See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html
|
||||
__cloc = NULL;
|
||||
if (strcmp(__s, "C"))
|
||||
__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
|
||||
"name not valid"));
|
||||
}
|
||||
|
||||
void
|
||||
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
|
||||
@ -223,9 +163,11 @@ namespace std
|
||||
__c_locale
|
||||
locale::facet::_S_clone_c_locale(__c_locale&)
|
||||
{ return __c_locale(); }
|
||||
} // namespace std
|
||||
|
||||
const char* locale::_S_categories[_S_categories_size
|
||||
+ _S_extra_categories_size] =
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
|
||||
{
|
||||
"LC_CTYPE",
|
||||
"LC_NUMERIC",
|
||||
@ -234,4 +176,9 @@ namespace std
|
||||
"LC_MONETARY",
|
||||
"LC_MESSAGES"
|
||||
};
|
||||
}
|
||||
|
||||
namespace std
|
||||
{
|
||||
const char* const* const locale::_S_categories = __gnu_cxx::category_names;
|
||||
} // namespace std
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Wrapper for underlying C-language localization -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -33,14 +33,16 @@
|
||||
|
||||
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
#ifndef _CPP_BITS_C_LOCALE_H
|
||||
#define _CPP_BITS_C_LOCALE_H 1
|
||||
#ifndef _C_LOCALE_H
|
||||
#define _C_LOCALE_H 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <clocale>
|
||||
#include <cstring> // get std::strlen
|
||||
#include <cstdio> // get std::snprintf or std::sprintf
|
||||
|
||||
#define _GLIBCPP_NUM_CATEGORIES 0
|
||||
#define _GLIBCXX_NUM_CATEGORIES 0
|
||||
|
||||
namespace std
|
||||
{
|
||||
@ -53,30 +55,29 @@ namespace std
|
||||
template<typename _Tv>
|
||||
int
|
||||
__convert_from_v(char* __out,
|
||||
const int __attribute__ ((__unused__)) __size,
|
||||
const int __size __attribute__((__unused__)),
|
||||
const char* __fmt,
|
||||
_Tv __v, const __c_locale&, int __prec = -1)
|
||||
{
|
||||
char* __old = setlocale(LC_ALL, NULL);
|
||||
char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
|
||||
if (__sav)
|
||||
strcpy(__sav, __old);
|
||||
setlocale(LC_ALL, "C");
|
||||
char* __old = std::setlocale(LC_ALL, NULL);
|
||||
char* __sav = new char[std::strlen(__old) + 1];
|
||||
std::strcpy(__sav, __old);
|
||||
std::setlocale(LC_ALL, "C");
|
||||
|
||||
int __ret;
|
||||
#ifdef _GLIBCPP_USE_C99
|
||||
#ifdef _GLIBCXX_USE_C99
|
||||
if (__prec >= 0)
|
||||
__ret = snprintf(__out, __size, __fmt, __prec, __v);
|
||||
__ret = std::snprintf(__out, __size, __fmt, __prec, __v);
|
||||
else
|
||||
__ret = snprintf(__out, __size, __fmt, __v);
|
||||
__ret = std::snprintf(__out, __size, __fmt, __v);
|
||||
#else
|
||||
if (__prec >= 0)
|
||||
__ret = sprintf(__out, __fmt, __prec, __v);
|
||||
__ret = std::sprintf(__out, __fmt, __prec, __v);
|
||||
else
|
||||
__ret = sprintf(__out, __fmt, __v);
|
||||
__ret = std::sprintf(__out, __fmt, __v);
|
||||
#endif
|
||||
setlocale(LC_ALL, __sav);
|
||||
free(__sav);
|
||||
std::setlocale(LC_ALL, __sav);
|
||||
delete [] __sav;
|
||||
return __ret;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
namespace std
|
||||
{
|
||||
// Specializations.
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
codecvt_base::result
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_out(state_type& __state, const intern_type* __from,
|
||||
@ -46,25 +46,61 @@ namespace std
|
||||
extern_type* __to, extern_type* __to_end,
|
||||
extern_type*& __to_next) const
|
||||
{
|
||||
result __ret = error;
|
||||
size_t __len = min(__from_end - __from, __to_end - __to);
|
||||
size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
|
||||
result __ret = ok;
|
||||
// The conversion must be done using a temporary destination buffer
|
||||
// since it is not possible to pass the size of the buffer to wcrtomb
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
if (__conv == __len)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = ok;
|
||||
}
|
||||
else if (__conv > 0 && __conv < __len)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = partial;
|
||||
}
|
||||
// The conversion must be done by calling wcrtomb in a loop rather
|
||||
// than using wcsrtombs because wcsrtombs assumes that the input is
|
||||
// zero-terminated.
|
||||
|
||||
// Either we can upper bound the total number of external characters to
|
||||
// something smaller than __to_end - __to or the conversion must be done
|
||||
// using a temporary destination buffer since it is not possible to
|
||||
// pass the size of the buffer to wcrtomb
|
||||
if (MB_CUR_MAX * (__from_end - __from) - (__to_end - __to) <= 0)
|
||||
while (__from < __from_end)
|
||||
{
|
||||
const size_t __conv = wcrtomb(__to, *__from, &__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
__ret = error;
|
||||
break;
|
||||
}
|
||||
__state = __tmp_state;
|
||||
__to += __conv;
|
||||
__from++;
|
||||
}
|
||||
else
|
||||
__ret = error;
|
||||
|
||||
{
|
||||
extern_type __buf[MB_LEN_MAX];
|
||||
while (__from < __from_end && __to < __to_end)
|
||||
{
|
||||
const size_t __conv = wcrtomb(__buf, *__from, &__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
__ret = error;
|
||||
break;
|
||||
}
|
||||
else if (__conv > static_cast<size_t>(__to_end - __to))
|
||||
{
|
||||
__ret = partial;
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy(__to, __buf, __conv);
|
||||
__state = __tmp_state;
|
||||
__to += __conv;
|
||||
__from++;
|
||||
}
|
||||
}
|
||||
|
||||
if (__ret == ok && __from < __from_end)
|
||||
__ret = partial;
|
||||
|
||||
__from_next = __from;
|
||||
__to_next = __to;
|
||||
return __ret;
|
||||
}
|
||||
|
||||
@ -75,25 +111,106 @@ namespace std
|
||||
intern_type* __to, intern_type* __to_end,
|
||||
intern_type*& __to_next) const
|
||||
{
|
||||
result __ret = error;
|
||||
size_t __len = min(__from_end - __from, __to_end - __to);
|
||||
size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
|
||||
result __ret = ok;
|
||||
// This temporary state object is neccessary so __state won't be modified
|
||||
// if [__from, __from_end) is a partial multibyte character.
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
if (__conv == __len)
|
||||
// Conversion must be done by calling mbrtowc in a loop rather than
|
||||
// by calling mbsrtowcs because mbsrtowcs assumes that the input
|
||||
// sequence is zero-terminated.
|
||||
while (__from < __from_end && __to < __to_end)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = ok;
|
||||
size_t __conv = mbrtowc(__to, __from, __from_end - __from,
|
||||
&__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
__ret = error;
|
||||
break;
|
||||
}
|
||||
else if (__conv == static_cast<size_t>(-2))
|
||||
{
|
||||
// It is unclear what to return in this case (see DR 382).
|
||||
__ret = partial;
|
||||
break;
|
||||
}
|
||||
else if (__conv == 0)
|
||||
{
|
||||
// XXX Probably wrong for stateful encodings
|
||||
__conv = 1;
|
||||
*__to = L'\0';
|
||||
}
|
||||
|
||||
__state = __tmp_state;
|
||||
__to++;
|
||||
__from += __conv;
|
||||
}
|
||||
else if (__conv > 0 && __conv < __len)
|
||||
|
||||
// It is not clear that __from < __from_end implies __ret != ok
|
||||
// (see DR 382).
|
||||
if (__ret == ok && __from < __from_end)
|
||||
__ret = partial;
|
||||
|
||||
__from_next = __from;
|
||||
__to_next = __to;
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_encoding() const throw()
|
||||
{
|
||||
// XXX This implementation assumes that the encoding is
|
||||
// stateless and is either single-byte or variable-width.
|
||||
int __ret = 0;
|
||||
if (MB_CUR_MAX == 1)
|
||||
__ret = 1;
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_max_length() const throw()
|
||||
{
|
||||
// XXX Probably wrong for stateful encodings.
|
||||
int __ret = MB_CUR_MAX;
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_length(state_type& __state, const extern_type* __from,
|
||||
const extern_type* __end, size_t __max) const
|
||||
{
|
||||
int __ret = 0;
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
while (__from < __end && __max)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = partial;
|
||||
size_t __conv = mbrtowc(NULL, __from, __end - __from, &__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
// Invalid source character
|
||||
break;
|
||||
}
|
||||
else if (__conv == static_cast<size_t>(-2))
|
||||
{
|
||||
// Remainder of input does not form a complete destination
|
||||
// character.
|
||||
break;
|
||||
}
|
||||
else if (__conv == 0)
|
||||
{
|
||||
// XXX Probably wrong for stateful encodings
|
||||
__conv = 1;
|
||||
}
|
||||
|
||||
__state = __tmp_state;
|
||||
__from += __conv;
|
||||
__ret += __conv;
|
||||
__max--;
|
||||
}
|
||||
else
|
||||
__ret = error;
|
||||
|
||||
|
||||
return __ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -53,7 +53,7 @@ namespace std
|
||||
size_t __n) const
|
||||
{ return strxfrm(__to, __from, __n); }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
int
|
||||
collate<wchar_t>::_M_compare(const wchar_t* __one,
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::ctype implementation details, generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -43,11 +43,14 @@ namespace std
|
||||
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);
|
||||
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
|
||||
{
|
||||
this->_S_destroy_c_locale(this->_M_c_locale_ctype);
|
||||
this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
ctype<wchar_t>::__wmask_type
|
||||
ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
|
||||
{
|
||||
@ -128,13 +131,16 @@ namespace std
|
||||
do_is(mask __m, char_type __c) const
|
||||
{
|
||||
bool __ret = false;
|
||||
const size_t __bitmasksize = 10;
|
||||
// Generically, 15 (instead of 10) since we don't know the numerical
|
||||
// encoding of the various categories in /usr/include/ctype.h.
|
||||
const size_t __bitmasksize = 15;
|
||||
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||
{
|
||||
const mask __bit = static_cast<mask>(1 << __bitcur);
|
||||
if (__m & __bit)
|
||||
__ret |= iswctype(__c, _M_convert_to_wmask(__bit));
|
||||
}
|
||||
if (__m & _M_bit[__bitcur]
|
||||
&& iswctype(__c, _M_wmask[__bitcur]))
|
||||
{
|
||||
__ret = true;
|
||||
break;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
@ -144,14 +150,13 @@ namespace std
|
||||
{
|
||||
for (;__lo < __hi; ++__vec, ++__lo)
|
||||
{
|
||||
const size_t __bitmasksize = 10;
|
||||
// Generically, 15 (instead of 10) since we don't know the numerical
|
||||
// encoding of the various categories in /usr/include/ctype.h.
|
||||
const size_t __bitmasksize = 15;
|
||||
mask __m = 0;
|
||||
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||
{
|
||||
const mask __bit = static_cast<mask>(1 << __bitcur);
|
||||
if (iswctype(*__lo, _M_convert_to_wmask(__bit)))
|
||||
__m |= __bit;
|
||||
}
|
||||
if (iswctype(*__lo, _M_wmask[__bitcur]))
|
||||
__m |= _M_bit[__bitcur];
|
||||
*__vec = __m;
|
||||
}
|
||||
return __hi;
|
||||
@ -178,15 +183,18 @@ namespace std
|
||||
wchar_t
|
||||
ctype<wchar_t>::
|
||||
do_widen(char __c) const
|
||||
{ return btowc(__c); }
|
||||
{ return _M_widen[static_cast<unsigned char>(__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);
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
@ -194,7 +202,9 @@ namespace std
|
||||
ctype<wchar_t>::
|
||||
do_narrow(wchar_t __wc, char __dfault) const
|
||||
{
|
||||
int __c = wctob(__wc);
|
||||
if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
|
||||
return _M_narrow[__wc];
|
||||
const int __c = wctob(__wc);
|
||||
return (__c == EOF ? __dfault : static_cast<char>(__c));
|
||||
}
|
||||
|
||||
@ -203,24 +213,55 @@ namespace std
|
||||
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
|
||||
char* __dest) const
|
||||
{
|
||||
size_t __offset = 0;
|
||||
while (true)
|
||||
{
|
||||
const wchar_t* __start = __lo + __offset;
|
||||
size_t __len = __hi - __start;
|
||||
|
||||
mbstate_t __state;
|
||||
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
|
||||
size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
|
||||
if (__con != __len && __start != 0)
|
||||
{
|
||||
__offset = __start - __lo;
|
||||
__dest[__offset++] = __dfault;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (_M_narrow_ok)
|
||||
while (__lo < __hi)
|
||||
{
|
||||
if (*__lo >= 0 && *__lo < 128)
|
||||
*__dest = _M_narrow[*__lo];
|
||||
else
|
||||
{
|
||||
const int __c = wctob(*__lo);
|
||||
*__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
|
||||
}
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
else
|
||||
while (__lo < __hi)
|
||||
{
|
||||
const int __c = wctob(*__lo);
|
||||
*__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
#endif // _GLIBCPP_USE_WCHAR_T
|
||||
|
||||
void
|
||||
ctype<wchar_t>::_M_initialize_ctype()
|
||||
{
|
||||
wint_t __i;
|
||||
for (__i = 0; __i < 128; ++__i)
|
||||
{
|
||||
const int __c = wctob(__i);
|
||||
if (__c == EOF)
|
||||
break;
|
||||
else
|
||||
_M_narrow[__i] = static_cast<char>(__c);
|
||||
}
|
||||
if (__i == 128)
|
||||
_M_narrow_ok = true;
|
||||
else
|
||||
_M_narrow_ok = false;
|
||||
for (size_t __i = 0;
|
||||
__i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
|
||||
_M_widen[__i] = btowc(__i);
|
||||
|
||||
for (size_t __i = 0; __i <= 15; ++__i)
|
||||
{
|
||||
_M_bit[__i] = static_cast<mask>(1 << __i);
|
||||
_M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
|
||||
}
|
||||
}
|
||||
#endif // _GLIBCXX_USE_WCHAR_T
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace std
|
||||
messages<char>::do_get(catalog, int, int, const string& __dfault) const
|
||||
{ return __dfault; }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
wstring
|
||||
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::messages implementation details, generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2003, 2004 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
|
||||
@ -36,13 +36,13 @@
|
||||
// Non-virtual member functions.
|
||||
template<typename _CharT>
|
||||
messages<_CharT>::messages(size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
{ _M_c_locale_messages = _S_c_locale; }
|
||||
: facet(__refs)
|
||||
{ _M_c_locale_messages = _S_get_c_locale(); }
|
||||
|
||||
template<typename _CharT>
|
||||
messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
{ _M_c_locale_messages = _S_c_locale; }
|
||||
: facet(__refs)
|
||||
{ _M_c_locale_messages = _S_get_c_locale(); }
|
||||
|
||||
template<typename _CharT>
|
||||
typename messages<_CharT>::catalog
|
||||
@ -76,6 +76,9 @@
|
||||
messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
|
||||
: messages<_CharT>(__refs)
|
||||
{
|
||||
_S_destroy_c_locale(_M_c_locale_messages);
|
||||
_S_create_c_locale(_M_c_locale_messages, __s);
|
||||
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
|
||||
{
|
||||
this->_S_destroy_c_locale(this->_M_c_locale_messages);
|
||||
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::moneypunct implementation details, generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -47,58 +47,92 @@ namespace std
|
||||
void
|
||||
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*)
|
||||
{
|
||||
// "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;
|
||||
// "C" locale.
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<char, true>;
|
||||
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = "";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = "";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = "";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
_M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*)
|
||||
{
|
||||
// "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;
|
||||
// "C" locale.
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<char, false>;
|
||||
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = "";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = "";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = "";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
_M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
|
||||
}
|
||||
|
||||
template<>
|
||||
moneypunct<char, true>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
template<>
|
||||
moneypunct<char, false>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
|
||||
const char*)
|
||||
{
|
||||
// "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;
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<wchar_t, true>;
|
||||
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
|
||||
_M_data->_M_atoms[__i] = btowc(uc);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
@ -107,23 +141,37 @@ namespace std
|
||||
const char*)
|
||||
{
|
||||
// "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;
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<wchar_t, false>;
|
||||
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
|
||||
_M_data->_M_atoms[__i] = btowc(uc);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
moneypunct<wchar_t, true>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
template<>
|
||||
moneypunct<wchar_t, false>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
#endif
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::numpunct implementation details, generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -42,32 +42,70 @@ namespace std
|
||||
numpunct<char>::_M_initialize_numpunct(__c_locale)
|
||||
{
|
||||
// "C" locale
|
||||
_M_decimal_point = '.';
|
||||
_M_thousands_sep = ',';
|
||||
_M_grouping = "";
|
||||
_M_truename = "true";
|
||||
_M_falsename = "false";
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<char>;
|
||||
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
|
||||
for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
|
||||
_M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
|
||||
|
||||
for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
|
||||
_M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
|
||||
|
||||
_M_data->_M_truename = "true";
|
||||
_M_data->_M_truename_size = strlen(_M_data->_M_truename);
|
||||
_M_data->_M_falsename = "false";
|
||||
_M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<char>::~numpunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_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";
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<wchar_t>;
|
||||
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
|
||||
// Use ctype::widen code without the facet...
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
|
||||
_M_data->_M_atoms_out[__i] = btowc(uc);
|
||||
}
|
||||
|
||||
for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__i]);
|
||||
_M_data->_M_atoms_in[__i] = btowc(uc);
|
||||
}
|
||||
|
||||
_M_data->_M_truename = L"true";
|
||||
_M_data->_M_truename_size = wcslen(_M_data->_M_truename);
|
||||
_M_data->_M_falsename = L"false";
|
||||
_M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<wchar_t>::~numpunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
#endif
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::time_get, std::time_put implementation, generic version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -55,65 +55,68 @@ namespace std
|
||||
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 = "";
|
||||
// "C" locale.
|
||||
if (!_M_data)
|
||||
_M_data = new __timepunct_cache<char>;
|
||||
|
||||
_M_data->_M_date_format = "%m/%d/%y";
|
||||
_M_data->_M_date_era_format = "%m/%d/%y";
|
||||
_M_data->_M_time_format = "%H:%M:%S";
|
||||
_M_data->_M_time_era_format = "%H:%M:%S";
|
||||
_M_data->_M_date_time_format = "";
|
||||
_M_data->_M_date_time_era_format = "";
|
||||
_M_data->_M_am = "AM";
|
||||
_M_data->_M_pm = "PM";
|
||||
_M_data->_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";
|
||||
_M_data->_M_day1 = "Sunday";
|
||||
_M_data->_M_day2 = "Monday";
|
||||
_M_data->_M_day3 = "Tuesday";
|
||||
_M_data->_M_day4 = "Wednesday";
|
||||
_M_data->_M_day5 = "Thursday";
|
||||
_M_data->_M_day6 = "Friday";
|
||||
_M_data->_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";
|
||||
_M_data->_M_aday1 = "Sun";
|
||||
_M_data->_M_aday2 = "Mon";
|
||||
_M_data->_M_aday3 = "Tue";
|
||||
_M_data->_M_aday4 = "Wed";
|
||||
_M_data->_M_aday5 = "Thu";
|
||||
_M_data->_M_aday6 = "Fri";
|
||||
_M_data->_M_aday7 = "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";
|
||||
_M_data->_M_month01 = "January";
|
||||
_M_data->_M_month02 = "February";
|
||||
_M_data->_M_month03 = "March";
|
||||
_M_data->_M_month04 = "April";
|
||||
_M_data->_M_month05 = "May";
|
||||
_M_data->_M_month06 = "June";
|
||||
_M_data->_M_month07 = "July";
|
||||
_M_data->_M_month08 = "August";
|
||||
_M_data->_M_month09 = "September";
|
||||
_M_data->_M_month10 = "October";
|
||||
_M_data->_M_month11 = "November";
|
||||
_M_data->_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";
|
||||
_M_data->_M_amonth01 = "Jan";
|
||||
_M_data->_M_amonth02 = "Feb";
|
||||
_M_data->_M_amonth03 = "Mar";
|
||||
_M_data->_M_amonth04 = "Apr";
|
||||
_M_data->_M_amonth05 = "May";
|
||||
_M_data->_M_amonth06 = "Jun";
|
||||
_M_data->_M_amonth07 = "Jul";
|
||||
_M_data->_M_amonth08 = "Aug";
|
||||
_M_data->_M_amonth09 = "Sep";
|
||||
_M_data->_M_amonth10 = "Oct";
|
||||
_M_data->_M_amonth11 = "Nov";
|
||||
_M_data->_M_amonth12 = "Dec";
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
__timepunct<wchar_t>::
|
||||
@ -131,62 +134,65 @@ namespace std
|
||||
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"";
|
||||
// "C" locale.
|
||||
if (!_M_data)
|
||||
_M_data = new __timepunct_cache<wchar_t>;
|
||||
|
||||
_M_data->_M_date_format = L"%m/%d/%y";
|
||||
_M_data->_M_date_era_format = L"%m/%d/%y";
|
||||
_M_data->_M_time_format = L"%H:%M:%S";
|
||||
_M_data->_M_time_era_format = L"%H:%M:%S";
|
||||
_M_data->_M_date_time_format = L"";
|
||||
_M_data->_M_date_time_era_format = L"";
|
||||
_M_data->_M_am = L"AM";
|
||||
_M_data->_M_pm = L"PM";
|
||||
_M_data->_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";
|
||||
_M_data->_M_day1 = L"Sunday";
|
||||
_M_data->_M_day2 = L"Monday";
|
||||
_M_data->_M_day3 = L"Tuesday";
|
||||
_M_data->_M_day4 = L"Wednesday";
|
||||
_M_data->_M_day5 = L"Thursday";
|
||||
_M_data->_M_day6 = L"Friday";
|
||||
_M_data->_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";
|
||||
_M_data->_M_aday1 = L"Sun";
|
||||
_M_data->_M_aday2 = L"Mon";
|
||||
_M_data->_M_aday3 = L"Tue";
|
||||
_M_data->_M_aday4 = L"Wed";
|
||||
_M_data->_M_aday5 = L"Thu";
|
||||
_M_data->_M_aday6 = L"Fri";
|
||||
_M_data->_M_aday7 = 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";
|
||||
_M_data->_M_month01 = L"January";
|
||||
_M_data->_M_month02 = L"February";
|
||||
_M_data->_M_month03 = L"March";
|
||||
_M_data->_M_month04 = L"April";
|
||||
_M_data->_M_month05 = L"May";
|
||||
_M_data->_M_month06 = L"June";
|
||||
_M_data->_M_month07 = L"July";
|
||||
_M_data->_M_month08 = L"August";
|
||||
_M_data->_M_month09 = L"September";
|
||||
_M_data->_M_month10 = L"October";
|
||||
_M_data->_M_month11 = L"November";
|
||||
_M_data->_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";
|
||||
_M_data->_M_amonth01 = L"Jan";
|
||||
_M_data->_M_amonth02 = L"Feb";
|
||||
_M_data->_M_amonth03 = L"Mar";
|
||||
_M_data->_M_amonth04 = L"Apr";
|
||||
_M_data->_M_amonth05 = L"May";
|
||||
_M_data->_M_amonth06 = L"Jun";
|
||||
_M_data->_M_amonth07 = L"Jul";
|
||||
_M_data->_M_amonth08 = L"Aug";
|
||||
_M_data->_M_amonth09 = L"Sep";
|
||||
_M_data->_M_amonth10 = L"Oct";
|
||||
_M_data->_M_amonth11 = L"Nov";
|
||||
_M_data->_M_amonth12 = L"Dec";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -36,26 +36,36 @@
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
: facet(__refs), _M_data(NULL)
|
||||
{
|
||||
_M_name_timepunct = _S_c_name;
|
||||
_M_name_timepunct = _S_get_c_name();
|
||||
_M_initialize_timepunct();
|
||||
}
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
|
||||
: facet(__refs), _M_data(__cache)
|
||||
{
|
||||
_M_name_timepunct = _S_get_c_name();
|
||||
_M_initialize_timepunct();
|
||||
}
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
|
||||
size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
: facet(__refs), _M_data(NULL)
|
||||
{
|
||||
_M_name_timepunct = new char[strlen(__s) + 1];
|
||||
strcpy(_M_name_timepunct, __s);
|
||||
char* __tmp = new char[std::strlen(__s) + 1];
|
||||
std::strcpy(__tmp, __s);
|
||||
_M_name_timepunct = __tmp;
|
||||
_M_initialize_timepunct(__cloc);
|
||||
}
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::~__timepunct()
|
||||
{
|
||||
if (_S_c_name != _M_name_timepunct)
|
||||
if (_M_name_timepunct != _S_get_c_name())
|
||||
delete [] _M_name_timepunct;
|
||||
delete _M_data;
|
||||
_S_destroy_c_locale(_M_c_locale_timepunct);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2004 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
|
||||
@ -40,10 +40,6 @@ extern "C" __typeof(strftime_l) __strftime_l;
|
||||
extern "C" __typeof(strtod_l) __strtod_l;
|
||||
extern "C" __typeof(strtof_l) __strtof_l;
|
||||
extern "C" __typeof(strtold_l) __strtold_l;
|
||||
extern "C" __typeof(strtol_l) __strtol_l;
|
||||
extern "C" __typeof(strtoll_l) __strtoll_l;
|
||||
extern "C" __typeof(strtoul_l) __strtoul_l;
|
||||
extern "C" __typeof(strtoull_l) __strtoull_l;
|
||||
extern "C" __typeof(strxfrm_l) __strxfrm_l;
|
||||
extern "C" __typeof(towlower_l) __towlower_l;
|
||||
extern "C" __typeof(towupper_l) __towupper_l;
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
#include <cerrno> // For errno
|
||||
#include <locale>
|
||||
#include <stdexcept>
|
||||
#include <langinfo.h>
|
||||
@ -40,90 +41,17 @@
|
||||
|
||||
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)
|
||||
const __c_locale& __cloc)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
float __f = __strtof_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __f;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -133,14 +61,14 @@ namespace std
|
||||
template<>
|
||||
void
|
||||
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
|
||||
const __c_locale& __cloc, int)
|
||||
const __c_locale& __cloc)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
double __d = __strtod_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __d;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -150,14 +78,14 @@ namespace std
|
||||
template<>
|
||||
void
|
||||
__convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
|
||||
const __c_locale& __cloc, int)
|
||||
const __c_locale& __cloc)
|
||||
{
|
||||
if (!(__err & ios_base::failbit))
|
||||
{
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
long double __ld = __strtold_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
if (__sanity != __s && errno != ERANGE)
|
||||
__v = __ld;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -172,23 +100,26 @@ namespace std
|
||||
if (!__cloc)
|
||||
{
|
||||
// This named locale is not supported by the underlying OS.
|
||||
__throw_runtime_error("attempt to create locale from unknown name");
|
||||
__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
|
||||
"name not valid"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
|
||||
{
|
||||
if (_S_c_locale != __cloc)
|
||||
if (_S_get_c_locale() != __cloc)
|
||||
__freelocale(__cloc);
|
||||
}
|
||||
|
||||
__c_locale
|
||||
locale::facet::_S_clone_c_locale(__c_locale& __cloc)
|
||||
{ return __duplocale(__cloc); }
|
||||
} // namespace std
|
||||
|
||||
const char* locale::_S_categories[_S_categories_size
|
||||
+ _S_extra_categories_size] =
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
|
||||
{
|
||||
"LC_CTYPE",
|
||||
"LC_NUMERIC",
|
||||
@ -203,4 +134,9 @@ namespace std
|
||||
"LC_MEASUREMENT",
|
||||
"LC_IDENTIFICATION"
|
||||
};
|
||||
}
|
||||
|
||||
namespace std
|
||||
{
|
||||
const char* const* const locale::_S_categories = __gnu_cxx::category_names;
|
||||
} // namespace std
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Wrapper for underlying C-language localization -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -33,19 +33,21 @@
|
||||
|
||||
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
#ifndef _CPP_BITS_C_LOCALE_H
|
||||
#define _CPP_BITS_C_LOCALE_H 1
|
||||
#ifndef _C_LOCALE_H
|
||||
#define _C_LOCALE_H 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <cstring> // get std::strlen
|
||||
#include <cstdio> // get std::snprintf or std::sprintf
|
||||
#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
|
||||
#define _GLIBCXX_C_LOCALE_GNU 1
|
||||
|
||||
#define _GLIBCPP_NUM_CATEGORIES 6
|
||||
#define _GLIBCXX_NUM_CATEGORIES 6
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
namespace __gnu_cxx
|
||||
@ -72,31 +74,30 @@ namespace std
|
||||
#else
|
||||
_Tv __v, const __c_locale&, int __prec = -1)
|
||||
{
|
||||
char* __old = setlocale(LC_ALL, NULL);
|
||||
char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
|
||||
if (__sav)
|
||||
strcpy(__sav, __old);
|
||||
setlocale(LC_ALL, "C");
|
||||
char* __old = std::setlocale(LC_ALL, NULL);
|
||||
char* __sav = new char[std::strlen(__old) + 1];
|
||||
std::strcpy(__sav, __old);
|
||||
std::setlocale(LC_ALL, "C");
|
||||
#endif
|
||||
|
||||
int __ret;
|
||||
#ifdef _GLIBCPP_USE_C99
|
||||
#ifdef _GLIBCXX_USE_C99
|
||||
if (__prec >= 0)
|
||||
__ret = snprintf(__out, __size, __fmt, __prec, __v);
|
||||
__ret = std::snprintf(__out, __size, __fmt, __prec, __v);
|
||||
else
|
||||
__ret = snprintf(__out, __size, __fmt, __v);
|
||||
__ret = std::snprintf(__out, __size, __fmt, __v);
|
||||
#else
|
||||
if (__prec >= 0)
|
||||
__ret = sprintf(__out, __fmt, __prec, __v);
|
||||
__ret = std::sprintf(__out, __fmt, __prec, __v);
|
||||
else
|
||||
__ret = sprintf(__out, __fmt, __v);
|
||||
__ret = std::sprintf(__out, __fmt, __v);
|
||||
#endif
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__gnu_cxx::__uselocale(__old);
|
||||
#else
|
||||
setlocale(LC_ALL, __sav);
|
||||
free(__sav);
|
||||
std::setlocale(LC_ALL, __sav);
|
||||
delete [] __sav;
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
namespace std
|
||||
{
|
||||
// Specializations.
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
codecvt_base::result
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_out(state_type& __state, const intern_type* __from,
|
||||
@ -47,31 +47,71 @@ namespace std
|
||||
extern_type* __to, extern_type* __to_end,
|
||||
extern_type*& __to_next) const
|
||||
{
|
||||
result __ret = error;
|
||||
size_t __len = min(__from_end - __from, __to_end - __to);
|
||||
result __ret = ok;
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_S_c_locale);
|
||||
__c_locale __old = __uselocale(_M_c_locale_codecvt);
|
||||
#endif
|
||||
size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
|
||||
|
||||
// wcsnrtombs is *very* fast but stops if encounters NUL characters:
|
||||
// in case we fall back to wcrtomb and then continue, in a loop.
|
||||
// NB: wcsnrtombs is a GNU extension
|
||||
for (__from_next = __from, __to_next = __to;
|
||||
__from_next < __from_end && __to_next < __to_end
|
||||
&& __ret == ok;)
|
||||
{
|
||||
const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
|
||||
__from_end - __from_next);
|
||||
if (!__from_chunk_end)
|
||||
__from_chunk_end = __from_end;
|
||||
|
||||
__from = __from_next;
|
||||
const size_t __conv = wcsnrtombs(__to_next, &__from_next,
|
||||
__from_chunk_end - __from_next,
|
||||
__to_end - __to_next, &__state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
// In case of error, in order to stop at the exact place we
|
||||
// have to start again from the beginning with a series of
|
||||
// wcrtomb.
|
||||
for (; __from < __from_next; ++__from)
|
||||
__to_next += wcrtomb(__to_next, *__from, &__tmp_state);
|
||||
__state = __tmp_state;
|
||||
__ret = error;
|
||||
}
|
||||
else if (__from_next && __from_next < __from_chunk_end)
|
||||
{
|
||||
__to_next += __conv;
|
||||
__ret = partial;
|
||||
}
|
||||
else
|
||||
{
|
||||
__from_next = __from_chunk_end;
|
||||
__to_next += __conv;
|
||||
}
|
||||
|
||||
if (__from_next < __from_end && __ret == ok)
|
||||
{
|
||||
extern_type __buf[MB_LEN_MAX];
|
||||
__tmp_state = __state;
|
||||
const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
|
||||
if (__conv > static_cast<size_t>(__to_end - __to_next))
|
||||
__ret = partial;
|
||||
else
|
||||
{
|
||||
memcpy(__to_next, __buf, __conv);
|
||||
__state = __tmp_state;
|
||||
__to_next += __conv;
|
||||
++__from_next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
|
||||
if (__conv == __len)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = ok;
|
||||
}
|
||||
else if (__conv > 0 && __conv < __len)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = partial;
|
||||
}
|
||||
else
|
||||
__ret = error;
|
||||
|
||||
return __ret;
|
||||
}
|
||||
|
||||
@ -82,31 +122,184 @@ namespace std
|
||||
intern_type* __to, intern_type* __to_end,
|
||||
intern_type*& __to_next) const
|
||||
{
|
||||
result __ret = error;
|
||||
size_t __len = min(__from_end - __from, __to_end - __to);
|
||||
result __ret = ok;
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_S_c_locale);
|
||||
__c_locale __old = __uselocale(_M_c_locale_codecvt);
|
||||
#endif
|
||||
size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
|
||||
|
||||
// mbsnrtowcs is *very* fast but stops if encounters NUL characters:
|
||||
// in case we store a L'\0' and then continue, in a loop.
|
||||
// NB: mbsnrtowcs is a GNU extension
|
||||
for (__from_next = __from, __to_next = __to;
|
||||
__from_next < __from_end && __to_next < __to_end
|
||||
&& __ret == ok;)
|
||||
{
|
||||
const extern_type* __from_chunk_end;
|
||||
__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
|
||||
__from_end
|
||||
- __from_next));
|
||||
if (!__from_chunk_end)
|
||||
__from_chunk_end = __from_end;
|
||||
|
||||
__from = __from_next;
|
||||
size_t __conv = mbsnrtowcs(__to_next, &__from_next,
|
||||
__from_chunk_end - __from_next,
|
||||
__to_end - __to_next, &__state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
// In case of error, in order to stop at the exact place we
|
||||
// have to start again from the beginning with a series of
|
||||
// mbrtowc.
|
||||
for (;; ++__to_next, __from += __conv)
|
||||
{
|
||||
__conv = mbrtowc(__to_next, __from, __from_end - __from,
|
||||
&__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1)
|
||||
|| __conv == static_cast<size_t>(-2))
|
||||
break;
|
||||
}
|
||||
__from_next = __from;
|
||||
__state = __tmp_state;
|
||||
__ret = error;
|
||||
}
|
||||
else if (__from_next && __from_next < __from_chunk_end)
|
||||
{
|
||||
// It is unclear what to return in this case (see DR 382).
|
||||
__to_next += __conv;
|
||||
__ret = partial;
|
||||
}
|
||||
else
|
||||
{
|
||||
__from_next = __from_chunk_end;
|
||||
__to_next += __conv;
|
||||
}
|
||||
|
||||
if (__from_next < __from_end && __ret == ok)
|
||||
{
|
||||
if (__to_next < __to_end)
|
||||
{
|
||||
// XXX Probably wrong for stateful encodings
|
||||
__tmp_state = __state;
|
||||
++__from_next;
|
||||
*__to_next++ = L'\0';
|
||||
}
|
||||
else
|
||||
__ret = partial;
|
||||
}
|
||||
}
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
|
||||
if (__conv == __len)
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_encoding() const throw()
|
||||
{
|
||||
// XXX This implementation assumes that the encoding is
|
||||
// stateless and is either single-byte or variable-width.
|
||||
int __ret = 0;
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_codecvt);
|
||||
#endif
|
||||
if (MB_CUR_MAX == 1)
|
||||
__ret = 1;
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_max_length() const throw()
|
||||
{
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_codecvt);
|
||||
#endif
|
||||
// XXX Probably wrong for stateful encodings.
|
||||
int __ret = MB_CUR_MAX;
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::
|
||||
do_length(state_type& __state, const extern_type* __from,
|
||||
const extern_type* __end, size_t __max) const
|
||||
{
|
||||
int __ret = 0;
|
||||
state_type __tmp_state(__state);
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_codecvt);
|
||||
#endif
|
||||
|
||||
// mbsnrtowcs is *very* fast but stops if encounters NUL characters:
|
||||
// in case we advance past it and then continue, in a loop.
|
||||
// NB: mbsnrtowcs is a GNU extension
|
||||
|
||||
// A dummy internal buffer is needed in order for mbsnrtocws to consider
|
||||
// its fourth parameter (it wouldn't with NULL as first parameter).
|
||||
wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
|
||||
* __max));
|
||||
while (__from < __end && __max)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = ok;
|
||||
}
|
||||
else if (__conv > 0 && __conv < __len)
|
||||
{
|
||||
__from_next = __from;
|
||||
__to_next = __to + __conv;
|
||||
__ret = partial;
|
||||
}
|
||||
else
|
||||
__ret = error;
|
||||
const extern_type* __from_chunk_end;
|
||||
__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
|
||||
__end
|
||||
- __from));
|
||||
if (!__from_chunk_end)
|
||||
__from_chunk_end = __end;
|
||||
|
||||
const extern_type* __tmp_from = __from;
|
||||
size_t __conv = mbsnrtowcs(__to, &__from,
|
||||
__from_chunk_end - __from,
|
||||
__max, &__state);
|
||||
if (__conv == static_cast<size_t>(-1))
|
||||
{
|
||||
// In case of error, in order to stop at the exact place we
|
||||
// have to start again from the beginning with a series of
|
||||
// mbrtowc.
|
||||
for (__from = __tmp_from;; __from += __conv)
|
||||
{
|
||||
__conv = mbrtowc(NULL, __from, __end - __from,
|
||||
&__tmp_state);
|
||||
if (__conv == static_cast<size_t>(-1)
|
||||
|| __conv == static_cast<size_t>(-2))
|
||||
break;
|
||||
}
|
||||
__state = __tmp_state;
|
||||
__ret += __from - __tmp_from;
|
||||
break;
|
||||
}
|
||||
if (!__from)
|
||||
__from = __from_chunk_end;
|
||||
|
||||
__ret += __from - __tmp_from;
|
||||
__max -= __conv;
|
||||
|
||||
if (__from < __end && __max)
|
||||
{
|
||||
// XXX Probably wrong for stateful encodings
|
||||
__tmp_state = __state;
|
||||
++__from;
|
||||
++__ret;
|
||||
--__max;
|
||||
}
|
||||
}
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
|
||||
return __ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -54,7 +54,7 @@ namespace std
|
||||
size_t __n) const
|
||||
{ return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
int
|
||||
collate<wchar_t>::_M_compare(const wchar_t* __one,
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::ctype implementation details, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -43,15 +43,18 @@ namespace std
|
||||
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);
|
||||
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
|
||||
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
|
||||
_M_table = _M_c_locale_ctype->__ctype_b;
|
||||
{
|
||||
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
|
||||
{
|
||||
this->_S_destroy_c_locale(this->_M_c_locale_ctype);
|
||||
this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
|
||||
this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
|
||||
this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
|
||||
this->_M_table = this->_M_c_locale_ctype->__ctype_b;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
ctype<wchar_t>::__wmask_type
|
||||
ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
|
||||
{
|
||||
@ -95,7 +98,7 @@ namespace std
|
||||
__ret = 0;
|
||||
}
|
||||
return __ret;
|
||||
};
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
@ -136,12 +139,12 @@ namespace std
|
||||
bool __ret = false;
|
||||
const size_t __bitmasksize = 11;
|
||||
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||
{
|
||||
const mask __bit = static_cast<mask>(_ISbit(__bitcur));
|
||||
if (__m & __bit)
|
||||
__ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
|
||||
_M_c_locale_ctype);
|
||||
}
|
||||
if (__m & _M_bit[__bitcur]
|
||||
&& __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
|
||||
{
|
||||
__ret = true;
|
||||
break;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
@ -149,19 +152,15 @@ namespace std
|
||||
ctype<wchar_t>::
|
||||
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
|
||||
{
|
||||
for (;__lo < __hi; ++__vec, ++__lo)
|
||||
for (; __lo < __hi; ++__vec, ++__lo)
|
||||
{
|
||||
// Highest bitmask in ctype_base == 10, but extra in "C"
|
||||
// library for blank.
|
||||
const size_t __bitmasksize = 11;
|
||||
mask __m = 0;
|
||||
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||
{
|
||||
const mask __bit = static_cast<mask>(_ISbit(__bitcur));
|
||||
if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
|
||||
_M_c_locale_ctype))
|
||||
__m |= __bit;
|
||||
}
|
||||
if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
|
||||
__m |= _M_bit[__bitcur];
|
||||
*__vec = __m;
|
||||
}
|
||||
return __hi;
|
||||
@ -188,41 +187,31 @@ namespace std
|
||||
wchar_t
|
||||
ctype<wchar_t>::
|
||||
do_widen(char __c) const
|
||||
{
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_ctype);
|
||||
#endif
|
||||
wchar_t __ret = btowc(__c);
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
return __ret;
|
||||
}
|
||||
{ return _M_widen[static_cast<unsigned char>(__c)]; }
|
||||
|
||||
const char*
|
||||
ctype<wchar_t>::
|
||||
do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
|
||||
{
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_ctype);
|
||||
#endif
|
||||
mbstate_t __state;
|
||||
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
|
||||
mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<wchar_t>::
|
||||
do_narrow(wchar_t __wc, char __dfault) const
|
||||
{
|
||||
{
|
||||
if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
|
||||
return _M_narrow[__wc];
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_ctype);
|
||||
#endif
|
||||
int __c = wctob(__wc);
|
||||
const int __c = wctob(__wc);
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
@ -237,27 +226,64 @@ namespace std
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_ctype);
|
||||
#endif
|
||||
size_t __offset = 0;
|
||||
while (true)
|
||||
{
|
||||
const wchar_t* __start = __lo + __offset;
|
||||
size_t __len = __hi - __start;
|
||||
|
||||
mbstate_t __state;
|
||||
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
|
||||
size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
|
||||
if (__con != __len && __start != 0)
|
||||
{
|
||||
__offset = __start - __lo;
|
||||
__dest[__offset++] = __dfault;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (_M_narrow_ok)
|
||||
while (__lo < __hi)
|
||||
{
|
||||
if (*__lo >= 0 && *__lo < 128)
|
||||
*__dest = _M_narrow[*__lo];
|
||||
else
|
||||
{
|
||||
const int __c = wctob(*__lo);
|
||||
*__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
|
||||
}
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
else
|
||||
while (__lo < __hi)
|
||||
{
|
||||
const int __c = wctob(*__lo);
|
||||
*__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
return __hi;
|
||||
}
|
||||
#endif // _GLIBCPP_USE_WCHAR_T
|
||||
|
||||
void
|
||||
ctype<wchar_t>::_M_initialize_ctype()
|
||||
{
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_M_c_locale_ctype);
|
||||
#endif
|
||||
wint_t __i;
|
||||
for (__i = 0; __i < 128; ++__i)
|
||||
{
|
||||
const int __c = wctob(__i);
|
||||
if (__c == EOF)
|
||||
break;
|
||||
else
|
||||
_M_narrow[__i] = static_cast<char>(__c);
|
||||
}
|
||||
if (__i == 128)
|
||||
_M_narrow_ok = true;
|
||||
else
|
||||
_M_narrow_ok = false;
|
||||
for (size_t __j = 0;
|
||||
__j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
|
||||
_M_widen[__j] = btowc(__j);
|
||||
|
||||
for (size_t __k = 0; __k <= 11; ++__k)
|
||||
{
|
||||
_M_bit[__k] = static_cast<mask>(_ISbit(__k));
|
||||
_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
|
||||
}
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
}
|
||||
#endif // _GLIBCXX_USE_WCHAR_T
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace std
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
wstring
|
||||
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::messages implementation details, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -36,24 +36,19 @@
|
||||
// Non-virtual member functions.
|
||||
template<typename _CharT>
|
||||
messages<_CharT>::messages(size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
_M_name_messages = _S_c_name;
|
||||
#endif
|
||||
_M_c_locale_messages = _S_c_locale;
|
||||
}
|
||||
: facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
|
||||
_M_name_messages(_S_get_c_name())
|
||||
{ }
|
||||
|
||||
template<typename _CharT>
|
||||
messages<_CharT>::messages(__c_locale __cloc,
|
||||
const char* __s, size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
messages<_CharT>::messages(__c_locale __cloc, const char* __s,
|
||||
size_t __refs)
|
||||
: facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
|
||||
_M_name_messages(__s)
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
_M_name_messages = new char[strlen(__s) + 1];
|
||||
strcpy(_M_name_messages, __s);
|
||||
#endif
|
||||
_M_c_locale_messages = _S_clone_c_locale(__cloc);
|
||||
char* __tmp = new char[std::strlen(__s) + 1];
|
||||
std::strcpy(__tmp, __s);
|
||||
_M_name_messages = __tmp;
|
||||
}
|
||||
|
||||
template<typename _CharT>
|
||||
@ -69,10 +64,8 @@
|
||||
template<typename _CharT>
|
||||
messages<_CharT>::~messages()
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
if (_S_c_name != _M_name_messages)
|
||||
if (_M_name_messages != _S_get_c_name())
|
||||
delete [] _M_name_messages;
|
||||
#endif
|
||||
_S_destroy_c_locale(_M_c_locale_messages);
|
||||
}
|
||||
|
||||
@ -97,12 +90,15 @@
|
||||
messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
|
||||
: messages<_CharT>(__refs)
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
if (_S_c_name != _M_name_messages)
|
||||
delete [] _M_name_messages;
|
||||
_M_name_messages = new char[strlen(__s) + 1];
|
||||
strcpy(_M_name_messages, __s);
|
||||
#endif
|
||||
_S_destroy_c_locale(_M_c_locale_messages);
|
||||
_S_create_c_locale(_M_c_locale_messages, __s);
|
||||
if (this->_M_name_messages != locale::facet::_S_get_c_name())
|
||||
delete [] this->_M_name_messages;
|
||||
char* __tmp = new char[std::strlen(__s) + 1];
|
||||
std::strcpy(__tmp, __s);
|
||||
this->_M_name_messages = __tmp;
|
||||
|
||||
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
|
||||
{
|
||||
this->_S_destroy_c_locale(this->_M_c_locale_messages);
|
||||
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::moneypunct implementation details, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -63,22 +63,21 @@ namespace std
|
||||
case 0:
|
||||
case 1:
|
||||
// 1 The sign precedes the value and symbol.
|
||||
__ret.field[0] = sign;
|
||||
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;
|
||||
__ret.field[2] = space;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -93,7 +92,6 @@ namespace std
|
||||
__ret.field[1] = value;
|
||||
__ret.field[2] = symbol;
|
||||
}
|
||||
__ret.field[0] = sign;
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
break;
|
||||
@ -105,15 +103,14 @@ namespace std
|
||||
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[1] = space;
|
||||
__ret.field[3] = sign;
|
||||
}
|
||||
else
|
||||
@ -135,78 +132,70 @@ namespace std
|
||||
break;
|
||||
case 3:
|
||||
// 3 The sign immediately precedes the symbol.
|
||||
if (__space)
|
||||
if (__precedes)
|
||||
{
|
||||
// Have space.
|
||||
if (__precedes)
|
||||
__ret.field[0] = sign;
|
||||
__ret.field[1] = symbol;
|
||||
if (__space)
|
||||
{
|
||||
__ret.field[0] = sign;
|
||||
__ret.field[1] = symbol;
|
||||
__ret.field[2] = space;
|
||||
__ret.field[3] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
__ret.field[0] = value;
|
||||
__ret.field[2] = value;
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
__ret.field[0] = value;
|
||||
if (__space)
|
||||
{
|
||||
__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;
|
||||
}
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// 4 The sign immediately follows the symbol.
|
||||
if (__space)
|
||||
// 4 The sign immediately follows the symbol.
|
||||
if (__precedes)
|
||||
{
|
||||
// Have space.
|
||||
if (__precedes)
|
||||
__ret.field[0] = symbol;
|
||||
__ret.field[1] = sign;
|
||||
if (__space)
|
||||
{
|
||||
__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;
|
||||
__ret.field[2] = value;
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Have none.
|
||||
if (__precedes)
|
||||
__ret.field[0] = value;
|
||||
if (__space)
|
||||
{
|
||||
__ret.field[0] = symbol;
|
||||
__ret.field[1] = sign;
|
||||
__ret.field[2] = value;
|
||||
__ret.field[1] = space;
|
||||
__ret.field[2] = symbol;
|
||||
__ret.field[3] = sign;
|
||||
}
|
||||
else
|
||||
{
|
||||
__ret.field[0] = value;
|
||||
__ret.field[1] = symbol;
|
||||
__ret.field[2] = sign;
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
__ret.field[3] = none;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -220,43 +209,63 @@ namespace std
|
||||
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
|
||||
const char*)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<char, true>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "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;
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = "";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = "";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = "";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
_M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
|
||||
}
|
||||
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);
|
||||
_M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
|
||||
__cloc));
|
||||
_M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
|
||||
__cloc));
|
||||
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
_M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
|
||||
_M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
|
||||
|
||||
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
|
||||
if (!__nposn)
|
||||
_M_negative_sign = "()";
|
||||
_M_data->_M_negative_sign = "()";
|
||||
else
|
||||
_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
|
||||
_M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
|
||||
__cloc);
|
||||
_M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
|
||||
|
||||
// _Intl == true
|
||||
_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
|
||||
_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
|
||||
_M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
|
||||
_M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
|
||||
_M_data->_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);
|
||||
_M_data->_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);
|
||||
_M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
|
||||
__nposn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,55 +274,74 @@ namespace std
|
||||
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
|
||||
const char*)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<char, false>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "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;
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = "";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = "";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = "";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
_M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
|
||||
}
|
||||
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);
|
||||
_M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
|
||||
__cloc));
|
||||
_M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
|
||||
__cloc));
|
||||
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
_M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
|
||||
_M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
|
||||
|
||||
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
|
||||
if (!__nposn)
|
||||
_M_negative_sign = "()";
|
||||
_M_data->_M_negative_sign = "()";
|
||||
else
|
||||
_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
|
||||
_M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
|
||||
__cloc);
|
||||
_M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
|
||||
|
||||
// _Intl == false
|
||||
_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
|
||||
_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
|
||||
_M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
|
||||
_M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
|
||||
_M_data->_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);
|
||||
_M_data->_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);
|
||||
_M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
|
||||
__nposn);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
moneypunct<char, true>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
template<>
|
||||
moneypunct<char, false>::~moneypunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
|
||||
@ -323,18 +351,33 @@ namespace std
|
||||
const char* __name)
|
||||
#endif
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<wchar_t, true>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "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;
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
// Use ctype::widen code without the facet...
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
|
||||
_M_data->_M_atoms[__i] = btowc(uc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -347,64 +390,93 @@ namespace std
|
||||
setlocale(LC_ALL, __name);
|
||||
#endif
|
||||
|
||||
_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);
|
||||
union __s_and_w { const char *__s; unsigned int __w; } __u;
|
||||
__u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
|
||||
_M_data->_M_decimal_point = static_cast<wchar_t>(__u.__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);
|
||||
__u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
|
||||
_M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
|
||||
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
|
||||
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);
|
||||
|
||||
mbstate_t __state;
|
||||
size_t __len = strlen(__cpossign);
|
||||
if (__len)
|
||||
wchar_t* __wcs_ps = 0;
|
||||
wchar_t* __wcs_ns = 0;
|
||||
const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
|
||||
try
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
wchar_t* __wcs = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
|
||||
_M_positive_sign = __wcs;
|
||||
mbstate_t __state;
|
||||
size_t __len = strlen(__cpossign);
|
||||
if (__len)
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
__wcs_ps = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
|
||||
_M_data->_M_positive_sign = __wcs_ps;
|
||||
}
|
||||
else
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
|
||||
|
||||
__len = strlen(__cnegsign);
|
||||
if (!__nposn)
|
||||
_M_data->_M_negative_sign = L"()";
|
||||
else if (__len)
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
__wcs_ns = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
|
||||
_M_data->_M_negative_sign = __wcs_ns;
|
||||
}
|
||||
else
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
|
||||
|
||||
// _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_data->_M_curr_symbol = __wcs;
|
||||
}
|
||||
else
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
|
||||
}
|
||||
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)
|
||||
catch (...)
|
||||
{
|
||||
++__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));
|
||||
delete _M_data;
|
||||
_M_data = 0;
|
||||
delete __wcs_ps;
|
||||
delete __wcs_ns;
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#else
|
||||
setlocale(LC_ALL, __old);
|
||||
free(__old);
|
||||
#endif
|
||||
__throw_exception_again;
|
||||
}
|
||||
|
||||
_M_data->_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);
|
||||
_M_data->_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);
|
||||
_M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
|
||||
__nposn);
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
@ -416,26 +488,41 @@ namespace std
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
const char*)
|
||||
void
|
||||
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
const char*)
|
||||
#else
|
||||
const char* __name)
|
||||
const char* __name)
|
||||
#endif
|
||||
{
|
||||
if (!__cloc)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __moneypunct_cache<wchar_t, false>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "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;
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = 0;
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = 0;
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = 0;
|
||||
_M_data->_M_frac_digits = 0;
|
||||
_M_data->_M_pos_format = money_base::_S_default_pattern;
|
||||
_M_data->_M_neg_format = money_base::_S_default_pattern;
|
||||
|
||||
// Use ctype::widen code without the facet...
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < money_base::_S_end; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
|
||||
_M_data->_M_atoms[__i] = btowc(uc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -448,64 +535,93 @@ namespace std
|
||||
setlocale(LC_ALL, __name);
|
||||
#endif
|
||||
|
||||
_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);
|
||||
union __s_and_w { const char *__s; unsigned int __w; } __u;
|
||||
__u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
|
||||
_M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
|
||||
|
||||
__u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
|
||||
_M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
|
||||
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
|
||||
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);
|
||||
|
||||
mbstate_t __state;
|
||||
size_t __len;
|
||||
__len = strlen(__cpossign);
|
||||
if (__len)
|
||||
wchar_t* __wcs_ps = 0;
|
||||
wchar_t* __wcs_ns = 0;
|
||||
const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
|
||||
try
|
||||
{
|
||||
mbstate_t __state;
|
||||
size_t __len;
|
||||
__len = strlen(__cpossign);
|
||||
if (__len)
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
__wcs_ps = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
|
||||
_M_data->_M_positive_sign = __wcs_ps;
|
||||
}
|
||||
else
|
||||
_M_data->_M_positive_sign = L"";
|
||||
_M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
|
||||
|
||||
__len = strlen(__cnegsign);
|
||||
if (!__nposn)
|
||||
_M_data->_M_negative_sign = L"()";
|
||||
else if (__len)
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
__wcs_ns = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
|
||||
_M_data->_M_negative_sign = __wcs_ns;
|
||||
}
|
||||
else
|
||||
_M_data->_M_negative_sign = L"";
|
||||
_M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
|
||||
|
||||
// _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_data->_M_curr_symbol = __wcs;
|
||||
}
|
||||
else
|
||||
_M_data->_M_curr_symbol = L"";
|
||||
_M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
++__len;
|
||||
memset(&__state, 0, sizeof(mbstate_t));
|
||||
wchar_t* __wcs = new wchar_t[__len];
|
||||
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
|
||||
_M_positive_sign = __wcs;
|
||||
delete _M_data;
|
||||
_M_data = 0;
|
||||
delete __wcs_ps;
|
||||
delete __wcs_ns;
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#else
|
||||
setlocale(LC_ALL, __old);
|
||||
free(__old);
|
||||
#endif
|
||||
__throw_exception_again;
|
||||
}
|
||||
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));
|
||||
_M_data->_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);
|
||||
_M_data->_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);
|
||||
_M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
|
||||
__nposn);
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
@ -519,23 +635,27 @@ namespace std
|
||||
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;
|
||||
if (_M_data->_M_positive_sign_size)
|
||||
delete [] _M_data->_M_positive_sign;
|
||||
if (_M_data->_M_negative_sign_size
|
||||
&& wcscmp(_M_data->_M_negative_sign, L"()") != 0)
|
||||
delete [] _M_data->_M_negative_sign;
|
||||
if (_M_data->_M_curr_symbol_size)
|
||||
delete [] _M_data->_M_curr_symbol;
|
||||
delete _M_data;
|
||||
}
|
||||
|
||||
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;
|
||||
if (_M_data->_M_positive_sign_size)
|
||||
delete [] _M_data->_M_positive_sign;
|
||||
if (_M_data->_M_negative_sign_size
|
||||
&& wcscmp(_M_data->_M_negative_sign, L"()") != 0)
|
||||
delete [] _M_data->_M_negative_sign;
|
||||
if (_M_data->_M_curr_symbol_size)
|
||||
delete [] _M_data->_M_curr_symbol;
|
||||
delete _M_data;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::numpunct implementation details, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -42,66 +42,120 @@ namespace std
|
||||
void
|
||||
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<char>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "C" locale
|
||||
_M_decimal_point = '.';
|
||||
_M_thousands_sep = ',';
|
||||
_M_grouping = "";
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point = '.';
|
||||
_M_data->_M_thousands_sep = ',';
|
||||
|
||||
for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
|
||||
_M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
|
||||
|
||||
for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
|
||||
_M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
|
||||
}
|
||||
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 = "";
|
||||
_M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
|
||||
__cloc));
|
||||
_M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
|
||||
__cloc));
|
||||
|
||||
// Check for NULL, which implies no grouping.
|
||||
if (_M_data->_M_thousands_sep == '\0')
|
||||
_M_data->_M_grouping = "";
|
||||
else
|
||||
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
|
||||
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
}
|
||||
|
||||
// NB: There is no way to extact this info from posix locales.
|
||||
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
|
||||
_M_truename = "true";
|
||||
_M_data->_M_truename = "true";
|
||||
_M_data->_M_truename_size = strlen(_M_data->_M_truename);
|
||||
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
|
||||
_M_falsename = "false";
|
||||
_M_data->_M_falsename = "false";
|
||||
_M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<char>::~numpunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<wchar_t>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "C" locale
|
||||
_M_decimal_point = L'.';
|
||||
_M_thousands_sep = L',';
|
||||
_M_grouping = "";
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_grouping_size = 0;
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point = L'.';
|
||||
_M_data->_M_thousands_sep = L',';
|
||||
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__c_locale __old = __uselocale(_S_get_c_locale());
|
||||
#endif
|
||||
// Use ctype::widen code without the facet...
|
||||
unsigned char uc;
|
||||
for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
|
||||
{
|
||||
uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
|
||||
_M_data->_M_atoms_out[__i] = btowc(uc);
|
||||
}
|
||||
|
||||
for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
|
||||
{
|
||||
uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
|
||||
_M_data->_M_atoms_in[__j] = btowc(uc);
|
||||
}
|
||||
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
__uselocale(__old);
|
||||
#endif
|
||||
}
|
||||
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 = "";
|
||||
union __s_and_w { const char *__s; unsigned int __w; } __u;
|
||||
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
|
||||
_M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
|
||||
|
||||
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
|
||||
_M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
|
||||
|
||||
if (_M_data->_M_thousands_sep == L'\0')
|
||||
_M_data->_M_grouping = "";
|
||||
else
|
||||
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
|
||||
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
|
||||
_M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
|
||||
}
|
||||
|
||||
// NB: There is no way to extact this info from posix locales.
|
||||
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
|
||||
_M_truename = L"true";
|
||||
_M_data->_M_truename = L"true";
|
||||
_M_data->_M_truename_size = wcslen(_M_data->_M_truename);
|
||||
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
|
||||
_M_falsename = L"false";
|
||||
_M_data->_M_falsename = L"false";
|
||||
_M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<wchar_t>::~numpunct()
|
||||
{ }
|
||||
{ delete _M_data; }
|
||||
#endif
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -60,130 +60,133 @@ namespace std
|
||||
void
|
||||
__timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __timepunct_cache<char>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "C" locale
|
||||
_M_c_locale_timepunct = _S_c_locale;
|
||||
_M_c_locale_timepunct = _S_get_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 = "";
|
||||
_M_data->_M_date_format = "%m/%d/%y";
|
||||
_M_data->_M_date_era_format = "%m/%d/%y";
|
||||
_M_data->_M_time_format = "%H:%M:%S";
|
||||
_M_data->_M_time_era_format = "%H:%M:%S";
|
||||
_M_data->_M_date_time_format = "";
|
||||
_M_data->_M_date_time_era_format = "";
|
||||
_M_data->_M_am = "AM";
|
||||
_M_data->_M_pm = "PM";
|
||||
_M_data->_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";
|
||||
_M_data->_M_day1 = "Sunday";
|
||||
_M_data->_M_day2 = "Monday";
|
||||
_M_data->_M_day3 = "Tuesday";
|
||||
_M_data->_M_day4 = "Wednesday";
|
||||
_M_data->_M_day5 = "Thursday";
|
||||
_M_data->_M_day6 = "Friday";
|
||||
_M_data->_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";
|
||||
_M_data->_M_aday1 = "Sun";
|
||||
_M_data->_M_aday2 = "Mon";
|
||||
_M_data->_M_aday3 = "Tue";
|
||||
_M_data->_M_aday4 = "Wed";
|
||||
_M_data->_M_aday5 = "Thu";
|
||||
_M_data->_M_aday6 = "Fri";
|
||||
_M_data->_M_aday7 = "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";
|
||||
_M_data->_M_month01 = "January";
|
||||
_M_data->_M_month02 = "February";
|
||||
_M_data->_M_month03 = "March";
|
||||
_M_data->_M_month04 = "April";
|
||||
_M_data->_M_month05 = "May";
|
||||
_M_data->_M_month06 = "June";
|
||||
_M_data->_M_month07 = "July";
|
||||
_M_data->_M_month08 = "August";
|
||||
_M_data->_M_month09 = "September";
|
||||
_M_data->_M_month10 = "October";
|
||||
_M_data->_M_month11 = "November";
|
||||
_M_data->_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";
|
||||
_M_data->_M_amonth01 = "Jan";
|
||||
_M_data->_M_amonth02 = "Feb";
|
||||
_M_data->_M_amonth03 = "Mar";
|
||||
_M_data->_M_amonth04 = "Apr";
|
||||
_M_data->_M_amonth05 = "May";
|
||||
_M_data->_M_amonth06 = "Jun";
|
||||
_M_data->_M_amonth07 = "Jul";
|
||||
_M_data->_M_amonth08 = "Aug";
|
||||
_M_data->_M_amonth09 = "Sep";
|
||||
_M_data->_M_amonth10 = "Oct";
|
||||
_M_data->_M_amonth11 = "Nov";
|
||||
_M_data->_M_amonth12 = "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);
|
||||
_M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
|
||||
_M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
|
||||
_M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
|
||||
_M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
|
||||
_M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
|
||||
_M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
|
||||
_M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
|
||||
_M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
|
||||
_M_data->_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);
|
||||
_M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
|
||||
_M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
|
||||
_M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
|
||||
_M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
|
||||
_M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
|
||||
_M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
|
||||
_M_data->_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);
|
||||
_M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
|
||||
_M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
|
||||
_M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
|
||||
_M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
|
||||
_M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
|
||||
_M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
|
||||
_M_data->_M_aday7 = __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);
|
||||
_M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
|
||||
_M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
|
||||
_M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
|
||||
_M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
|
||||
_M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
|
||||
_M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
|
||||
_M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
|
||||
_M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
|
||||
_M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
|
||||
_M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
|
||||
_M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
|
||||
_M_data->_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);
|
||||
_M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
|
||||
_M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
|
||||
_M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
|
||||
_M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
|
||||
_M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
|
||||
_M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
|
||||
_M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
|
||||
_M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
|
||||
_M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
|
||||
_M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
|
||||
_M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
|
||||
_M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
__timepunct<wchar_t>::
|
||||
@ -205,126 +208,129 @@ namespace std
|
||||
void
|
||||
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __timepunct_cache<wchar_t>;
|
||||
|
||||
if (!__cloc)
|
||||
{
|
||||
// "C" locale
|
||||
_M_c_locale_timepunct = _S_c_locale;
|
||||
_M_c_locale_timepunct = _S_get_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"";
|
||||
_M_data->_M_date_format = L"%m/%d/%y";
|
||||
_M_data->_M_date_era_format = L"%m/%d/%y";
|
||||
_M_data->_M_time_format = L"%H:%M:%S";
|
||||
_M_data->_M_time_era_format = L"%H:%M:%S";
|
||||
_M_data->_M_date_time_format = L"";
|
||||
_M_data->_M_date_time_era_format = L"";
|
||||
_M_data->_M_am = L"AM";
|
||||
_M_data->_M_pm = L"PM";
|
||||
_M_data->_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";
|
||||
_M_data->_M_day1 = L"Sunday";
|
||||
_M_data->_M_day2 = L"Monday";
|
||||
_M_data->_M_day3 = L"Tuesday";
|
||||
_M_data->_M_day4 = L"Wednesday";
|
||||
_M_data->_M_day5 = L"Thursday";
|
||||
_M_data->_M_day6 = L"Friday";
|
||||
_M_data->_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";
|
||||
_M_data->_M_aday1 = L"Sun";
|
||||
_M_data->_M_aday2 = L"Mon";
|
||||
_M_data->_M_aday3 = L"Tue";
|
||||
_M_data->_M_aday4 = L"Wed";
|
||||
_M_data->_M_aday5 = L"Thu";
|
||||
_M_data->_M_aday6 = L"Fri";
|
||||
_M_data->_M_aday7 = 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";
|
||||
_M_data->_M_month01 = L"January";
|
||||
_M_data->_M_month02 = L"February";
|
||||
_M_data->_M_month03 = L"March";
|
||||
_M_data->_M_month04 = L"April";
|
||||
_M_data->_M_month05 = L"May";
|
||||
_M_data->_M_month06 = L"June";
|
||||
_M_data->_M_month07 = L"July";
|
||||
_M_data->_M_month08 = L"August";
|
||||
_M_data->_M_month09 = L"September";
|
||||
_M_data->_M_month10 = L"October";
|
||||
_M_data->_M_month11 = L"November";
|
||||
_M_data->_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";
|
||||
_M_data->_M_amonth01 = L"Jan";
|
||||
_M_data->_M_amonth02 = L"Feb";
|
||||
_M_data->_M_amonth03 = L"Mar";
|
||||
_M_data->_M_amonth04 = L"Apr";
|
||||
_M_data->_M_amonth05 = L"May";
|
||||
_M_data->_M_amonth06 = L"Jun";
|
||||
_M_data->_M_amonth07 = L"Jul";
|
||||
_M_data->_M_amonth08 = L"Aug";
|
||||
_M_data->_M_amonth09 = L"Sep";
|
||||
_M_data->_M_amonth10 = L"Oct";
|
||||
_M_data->_M_amonth11 = L"Nov";
|
||||
_M_data->_M_amonth12 = 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));
|
||||
_M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
|
||||
_M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
|
||||
_M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
|
||||
_M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
|
||||
_M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
|
||||
_M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
|
||||
_M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
|
||||
_M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
|
||||
_M_data->_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));
|
||||
_M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
|
||||
_M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
|
||||
_M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
|
||||
_M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
|
||||
_M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
|
||||
_M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
|
||||
_M_data->_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));
|
||||
_M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
|
||||
_M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
|
||||
_M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
|
||||
_M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
|
||||
_M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
|
||||
_M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
|
||||
_M_data->_M_aday7 = 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));
|
||||
_M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
|
||||
_M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
|
||||
_M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
|
||||
_M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
|
||||
_M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
|
||||
_M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
|
||||
_M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
|
||||
_M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
|
||||
_M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
|
||||
_M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
|
||||
_M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
|
||||
_M_data->_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));
|
||||
_M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
|
||||
_M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
|
||||
_M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
|
||||
_M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
|
||||
_M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
|
||||
_M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
|
||||
_M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
|
||||
_M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
|
||||
_M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
|
||||
_M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
|
||||
_M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
|
||||
_M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2004 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
|
||||
@ -36,33 +36,33 @@
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
_M_name_timepunct = _S_c_name;
|
||||
#endif
|
||||
_M_initialize_timepunct();
|
||||
}
|
||||
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
|
||||
_M_name_timepunct(_S_get_c_name())
|
||||
{ _M_initialize_timepunct(); }
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(__c_locale __cloc,
|
||||
const char* __s,
|
||||
__timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
|
||||
: facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
|
||||
_M_name_timepunct(_S_get_c_name())
|
||||
{ _M_initialize_timepunct(); }
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
|
||||
size_t __refs)
|
||||
: locale::facet(__refs)
|
||||
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
|
||||
_M_name_timepunct(__s)
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
_M_name_timepunct = new char[strlen(__s) + 1];
|
||||
strcpy(_M_name_timepunct, __s);
|
||||
#endif
|
||||
char* __tmp = new char[std::strlen(__s) + 1];
|
||||
std::strcpy(__tmp, __s);
|
||||
_M_name_timepunct = __tmp;
|
||||
_M_initialize_timepunct(__cloc);
|
||||
}
|
||||
|
||||
template<typename _CharT>
|
||||
__timepunct<_CharT>::~__timepunct()
|
||||
{
|
||||
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
|
||||
if (_S_c_name != _M_name_timepunct)
|
||||
if (_M_name_timepunct != _S_get_c_name())
|
||||
delete [] _M_name_timepunct;
|
||||
#endif
|
||||
delete _M_data;
|
||||
_S_destroy_c_locale(_M_c_locale_timepunct);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ namespace std
|
||||
_M_falsename = "false";
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
|
||||
@ -91,7 +91,7 @@ namespace std
|
||||
_M_neg_format = money_base::_S_default_pattern;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
void
|
||||
moneypunct<wchar_t>::_M_initialize_moneypunct(__c_locale)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support (codecvt) -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003, 2004 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
|
||||
@ -36,8 +36,8 @@
|
||||
// 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
|
||||
// Define this here so codecvt.cc can have _S_max_size definition.
|
||||
#define _GLIBCXX_USE___ENC_TRAITS 1
|
||||
|
||||
// Extension to use icov for dealing with character encodings,
|
||||
// including conversions and comparisons between various character
|
||||
@ -81,10 +81,11 @@
|
||||
|
||||
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)
|
||||
: _M_in_desc(0), _M_out_desc(0), _M_ext_bom(__ebom), _M_int_bom(__ibom)
|
||||
{
|
||||
strncpy(_M_int_enc, __int, _S_max_size);
|
||||
strncpy(_M_ext_enc, __ext, _S_max_size);
|
||||
_M_init();
|
||||
}
|
||||
|
||||
// 21.1.2 traits typedefs
|
||||
@ -92,12 +93,17 @@
|
||||
// typedef STATE_T state_type
|
||||
// requires: state_type shall meet the requirements of
|
||||
// CopyConstructible types (20.1.3)
|
||||
// NB: This does not preseve the actual state of the conversion
|
||||
// descriptor member, but it does duplicate the encoding
|
||||
// information.
|
||||
__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;
|
||||
_M_destroy();
|
||||
_M_init();
|
||||
}
|
||||
|
||||
// Need assignment operator as well.
|
||||
@ -106,21 +112,15 @@
|
||||
{
|
||||
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;
|
||||
_M_destroy();
|
||||
_M_init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
~__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);
|
||||
}
|
||||
{ _M_destroy(); }
|
||||
|
||||
void
|
||||
_M_init()
|
||||
@ -130,13 +130,31 @@
|
||||
{
|
||||
_M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
|
||||
if (_M_in_desc == __err)
|
||||
__throw_runtime_error("creating iconv input descriptor failed.");
|
||||
__throw_runtime_error(__N("__enc_traits::_M_init "
|
||||
"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.");
|
||||
__throw_runtime_error(__N("__enc_traits::_M_init "
|
||||
"creating iconv output descriptor failed"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_M_destroy()
|
||||
{
|
||||
const __desc_type __err = reinterpret_cast<iconv_t>(-1);
|
||||
if (_M_in_desc && _M_in_desc != __err)
|
||||
{
|
||||
iconv_close(_M_in_desc);
|
||||
_M_in_desc = 0;
|
||||
}
|
||||
if (_M_out_desc && _M_out_desc != __err)
|
||||
{
|
||||
iconv_close(_M_out_desc);
|
||||
_M_out_desc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +189,7 @@
|
||||
|
||||
const char*
|
||||
_M_get_external_enc()
|
||||
{ return _M_ext_enc; }
|
||||
{ return _M_ext_enc; }
|
||||
};
|
||||
|
||||
// Partial specialization
|
||||
@ -230,7 +248,7 @@
|
||||
do_always_noconv() const throw();
|
||||
|
||||
virtual int
|
||||
do_length(const state_type&, const extern_type* __from,
|
||||
do_length(state_type&, const extern_type* __from,
|
||||
const extern_type* __end, size_t __max) const;
|
||||
|
||||
virtual int
|
||||
@ -447,15 +465,15 @@
|
||||
template<typename _InternT, typename _ExternT>
|
||||
int
|
||||
codecvt<_InternT, _ExternT, __enc_traits>::
|
||||
do_length(const state_type&, const extern_type* __from,
|
||||
do_length(state_type&, const extern_type* __from,
|
||||
const extern_type* __end, size_t __max) const
|
||||
{ return min(__max, static_cast<size_t>(__end - __from)); }
|
||||
{ return std::min(__max, static_cast<size_t>(__end - __from)); }
|
||||
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// 74. Garbled text for codecvt::do_max_length
|
||||
// _GLIBCXX_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
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace std
|
||||
return string(catgets(__nlc, __setid, __msgid, __dfault.c_str()));
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template<>
|
||||
wstring
|
||||
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Low-level functions for atomic operations: AIX version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2004 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
|
||||
@ -27,33 +27,35 @@
|
||||
// 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 <bits/atomicity.h>
|
||||
|
||||
/* 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. */
|
||||
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;
|
||||
The definition of _Atomic_word must match the type pointed to by
|
||||
atomic_p in <sys/atomic_op.h>. */
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#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)
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
(void) fetch_and_add (__mem, __val);
|
||||
}
|
||||
_Atomic_word
|
||||
__attribute__ ((__unused__))
|
||||
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
return ::fetch_and_add (const_cast<atomic_p>(__mem), __val);
|
||||
}
|
||||
|
||||
#endif /* atomicity.h */
|
||||
void
|
||||
__attribute__ ((__unused__))
|
||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||
{
|
||||
(void) ::fetch_and_add (const_cast<atomic_p>(__mem), __val);
|
||||
}
|
||||
} // namespace __gnu_cxx
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 1999 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2003 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
|
||||
@ -48,8 +48,8 @@
|
||||
static const mask xdigit = _ISXDIGIT;
|
||||
static const mask space = _ISSPACE;
|
||||
static const mask print = _ISPRINT;
|
||||
static const mask graph = _ISGRAPH;
|
||||
static const mask graph = _ISALPHA | _ISDIGIT | _ISPUNCT;
|
||||
static const mask cntrl = _ISCNTRL;
|
||||
static const mask punct = _ISPUNCT;
|
||||
static const mask alnum = _ISALNUM;
|
||||
static const mask alnum = _ISALPHA | _ISDIGIT;
|
||||
};
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2003 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
|
||||
@ -52,7 +52,7 @@
|
||||
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 graph = _CTYPE_A | _CTYPE_D | _CTYPE_P;
|
||||
static const mask cntrl = _CTYPE_C;
|
||||
static const mask punct = _CTYPE_P;
|
||||
static const mask alnum = _CTYPE_A | _CTYPE_D;
|
||||
@ -65,7 +65,7 @@
|
||||
static const mask xdigit = _X;
|
||||
static const mask space = _S;
|
||||
static const mask print = _R;
|
||||
static const mask graph = _G;
|
||||
static const mask graph = _A | _D | _P;
|
||||
static const mask cntrl = _C;
|
||||
static const mask punct = _P;
|
||||
static const mask alnum = _A | _D;
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -28,17 +28,17 @@
|
||||
// the GNU General Public License.
|
||||
|
||||
|
||||
#ifndef _GLIBCPP_OS_DEFINES
|
||||
#define _GLIBCPP_OS_DEFINES 1
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
||||
#define _GLIBCPP_USE_C99_CHECK 1
|
||||
#define _GLIBCPP_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
|
||||
#define _GLIBCPP_USE_C99_LONG_LONG_CHECK 1
|
||||
#define _GLIBCPP_USE_C99_LONG_LONG_DYNAMIC (_GLIBCPP_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
|
||||
#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
|
||||
#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
|
||||
#define _GLIBCXX_USE_C99_CHECK 1
|
||||
#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
|
||||
#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
|
||||
#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
|
||||
#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
|
||||
#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003 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
|
||||
@ -32,21 +32,35 @@
|
||||
//
|
||||
|
||||
// Information as gleaned from /usr/include/ctype.h
|
||||
|
||||
|
||||
extern "C" const u_int8_t _C_ctype_[];
|
||||
|
||||
const ctype_base::mask*
|
||||
ctype<char>::classic_table() throw()
|
||||
{ return 0; }
|
||||
{ return _C_ctype_ + 1; }
|
||||
|
||||
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)
|
||||
{ }
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{ }
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2003 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
|
||||
@ -49,8 +49,8 @@
|
||||
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
|
||||
static const mask alnum = __dj_ISALPHA | __dj_ISDIGIT; // Alphanumeric
|
||||
static const mask graph = __dj_ISALPHA | __dj_ISDIGIT | __dj_ISPUNCT; // Graphical
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
|
||||
_M_table(__table ? __table : __dj_ctype_flags)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
|
||||
_M_table(__table ? __table : __dj_ctype_flags)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -28,8 +28,8 @@
|
||||
// the GNU General Public License.
|
||||
|
||||
|
||||
#ifndef _GLIBCPP_OS_DEFINES
|
||||
#define _GLIBCPP_OS_DEFINES 1
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2003 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
|
||||
@ -48,10 +48,10 @@
|
||||
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 graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct
|
||||
static const mask cntrl = 1 << 8;
|
||||
static const mask punct = 1 << 9;
|
||||
static const mask alnum = 1 << 10;
|
||||
static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit
|
||||
};
|
||||
|
||||
|
||||
|
@ -49,16 +49,14 @@
|
||||
return _M_table[static_cast<unsigned char>(__c)] & __m;
|
||||
else
|
||||
{
|
||||
bool __ret = true;
|
||||
bool __any_match = false;
|
||||
const size_t __bitmasksize = 10;
|
||||
bool __ret = false;
|
||||
const size_t __bitmasksize = 15;
|
||||
size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
|
||||
for (;__ret && __bitcur <= __bitmasksize; ++__bitcur)
|
||||
for (; __bitcur <= __bitmasksize; ++__bitcur)
|
||||
{
|
||||
mask __bit = static_cast<mask>(1 << __bitcur);
|
||||
const mask __bit = static_cast<mask>(1 << __bitcur);
|
||||
if (__m & __bit)
|
||||
{
|
||||
__any_match = true;
|
||||
bool __testis;
|
||||
switch (__bit)
|
||||
{
|
||||
@ -99,10 +97,10 @@
|
||||
__testis = false;
|
||||
break;
|
||||
}
|
||||
__ret &= __testis;
|
||||
__ret |= __testis;
|
||||
}
|
||||
}
|
||||
return __ret & __any_match;
|
||||
return __ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +114,7 @@
|
||||
else
|
||||
{
|
||||
// Highest bitmask in ctype_base == 10.
|
||||
const size_t __bitmasksize = 10;
|
||||
const size_t __bitmasksize = 15;
|
||||
for (;__low < __high; ++__vec, ++__low)
|
||||
{
|
||||
mask __m = 0;
|
||||
@ -124,7 +122,7 @@
|
||||
size_t __i = 0;
|
||||
for (;__i <= __bitmasksize; ++__i)
|
||||
{
|
||||
mask __bit = static_cast<mask>(1 << __i);
|
||||
const mask __bit = static_cast<mask>(1 << __i);
|
||||
if (this->is(__bit, *__low))
|
||||
__m |= __bit;
|
||||
}
|
||||
|
@ -40,16 +40,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -28,8 +28,8 @@
|
||||
// the GNU General Public License.
|
||||
|
||||
|
||||
#ifndef _GLIBCPP_OS_DEFINES
|
||||
#define _GLIBCPP_OS_DEFINES 1
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
|
||||
// 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
|
||||
@ -48,8 +49,8 @@
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask graph = _ISgraph;
|
||||
static const mask graph = _ISalpha | _ISdigit | _ISpunct;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask alnum = _ISalnum;
|
||||
static const mask alnum = _ISalpha | _ISdigit;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
@ -34,13 +34,10 @@
|
||||
|
||||
// Information as gleaned from /usr/include/ctype.h
|
||||
|
||||
#if _GLIBCPP_C_LOCALE_GNU
|
||||
#if _GLIBCXX_C_LOCALE_GNU
|
||||
const ctype_base::mask*
|
||||
ctype<char>::classic_table() throw()
|
||||
{
|
||||
locale::classic();
|
||||
return _S_c_locale->__ctype_b;
|
||||
}
|
||||
{ return _S_get_c_locale()->__ctype_b; }
|
||||
#else
|
||||
const ctype_base::mask*
|
||||
ctype<char>::classic_table() throw()
|
||||
@ -59,20 +56,24 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#if _GLIBCPP_C_LOCALE_GNU
|
||||
#if _GLIBCXX_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)
|
||||
: facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)),
|
||||
_M_del(__table != 0 && __del),
|
||||
_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),
|
||||
_M_widen_ok(0), _M_narrow_ok(0)
|
||||
{
|
||||
_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;
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
}
|
||||
#else
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
|
||||
: facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
|
||||
_M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
|
||||
{
|
||||
char* __old=strdup(setlocale(LC_CTYPE, NULL));
|
||||
setlocale(LC_CTYPE, "C");
|
||||
@ -87,22 +88,27 @@
|
||||
#endif
|
||||
setlocale(LC_CTYPE, __old);
|
||||
free(__old);
|
||||
_M_c_locale_ctype = _S_c_locale;
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if _GLIBCPP_C_LOCALE_GNU
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
|
||||
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
|
||||
#if _GLIBCXX_C_LOCALE_GNU
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
|
||||
_M_del(__table != 0 && __del),
|
||||
_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),
|
||||
_M_widen_ok(0), _M_narrow_ok(0)
|
||||
{
|
||||
_M_c_locale_ctype = _S_c_locale;
|
||||
_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;
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
}
|
||||
#else
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
|
||||
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
|
||||
_M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
|
||||
{
|
||||
char* __old=strdup(setlocale(LC_CTYPE, NULL));
|
||||
setlocale(LC_CTYPE, "C");
|
||||
@ -117,7 +123,8 @@
|
||||
#endif
|
||||
setlocale(LC_CTYPE, __old);
|
||||
free(__old);
|
||||
_M_c_locale_ctype = _S_c_locale;
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Specific definitions for GNU/Linux -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003 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
|
||||
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
@ -38,30 +38,8 @@
|
||||
|
||||
#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.
|
||||
#if defined __GLIBC__ && __GLIBC__ >= 2
|
||||
#define __NO_STRING_INLINES
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2003 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
|
||||
@ -48,8 +48,8 @@
|
||||
static const mask xdigit = _ISXDIGIT;
|
||||
static const mask space = _ISSPACE;
|
||||
static const mask print = _ISPRINT;
|
||||
static const mask graph = _ISGRAPH;
|
||||
static const mask graph = _ISALPHA | _ISDIGIT | _ISPUNCT;
|
||||
static const mask cntrl = _ISCNTRL;
|
||||
static const mask punct = _ISPUNCT;
|
||||
static const mask alnum = _ISALNUM;
|
||||
static const mask alnum = _ISALPHA | _ISDIGIT;
|
||||
};
|
||||
|
@ -40,16 +40,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : (const mask *) __SB_masks)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : (const mask *) __SB_masks)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Specific definitions for HPUX -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2002, 2004 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
|
||||
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
@ -58,7 +58,7 @@
|
||||
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
|
||||
We also force _GLIBCXX_USE_LONG_LONG here so that we don't have
|
||||
to bastardize configure to deal with this sillyness. */
|
||||
namespace std
|
||||
{
|
||||
@ -75,12 +75,12 @@ namespace std
|
||||
#endif
|
||||
}
|
||||
|
||||
#define _GLIBCPP_USE_LONG_LONG 1
|
||||
#define _GLIBCXX_USE_LONG_LONG 1
|
||||
|
||||
// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
|
||||
// mode. We need to pad the vtable structure to achieve this.
|
||||
#if !defined(_LP64) && defined (__ia64__)
|
||||
#define _GLIBCPP_VTABLE_PADDING 8
|
||||
#define _GLIBCXX_VTABLE_PADDING 8
|
||||
typedef long int __padding_type;
|
||||
#endif
|
||||
|
||||
@ -91,16 +91,9 @@ typedef long int __padding_type;
|
||||
#define _LIBUNWIND_STD_ABI 1
|
||||
#endif
|
||||
|
||||
/* We need explicit instantiation of the atomicity lock on HPPA if
|
||||
there is no weak support. */
|
||||
#if !defined(_GLIBCPP_SUPPORTS_WEAK) && defined (__hppa__)
|
||||
#define _GLIBCPP_INST_ATOMICITY_LOCK 1
|
||||
#endif
|
||||
|
||||
/* Don't use pragma weak in gthread headers. HP-UX rejects programs
|
||||
with unsatisfied external references even if all of those references
|
||||
are weak; gthread relies on such unsatisfied references being resolved
|
||||
to null pointers when weak symbol support is on. */
|
||||
#define _GLIBCPP_GTHREAD_USE_WEAK 0
|
||||
|
||||
#define _GLIBCXX_GTHREAD_USE_WEAK 0
|
||||
#endif
|
||||
|
35
contrib/libstdc++/config/os/irix/atomic_word.h
Normal file
35
contrib/libstdc++/config/os/irix/atomic_word.h
Normal file
@ -0,0 +1,35 @@
|
||||
// Low-level type for atomic operations -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2004 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 _GLIBCXX_ATOMIC_WORD_H
|
||||
#define _GLIBCXX_ATOMIC_WORD_H 1
|
||||
|
||||
typedef long _Atomic_word;
|
||||
|
||||
#endif
|
42
contrib/libstdc++/config/os/irix/atomicity.h
Normal file
42
contrib/libstdc++/config/os/irix/atomicity.h
Normal file
@ -0,0 +1,42 @@
|
||||
// Low-level functions for atomic operations: IRIX version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2004 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.
|
||||
|
||||
#include <mutex.h>
|
||||
#include <bits/atomicity.h>
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
_Atomic_word
|
||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ return (_Atomic_word) test_then_add((unsigned long*) const_cast<_Atomic_word*>(__mem), __val); }
|
||||
|
||||
void
|
||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||
{ __exchange_and_add(__mem, __val); }
|
||||
} // namespace __gnu_cxx
|
@ -40,16 +40,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(!__table ? classic_table() : __table)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(!__table ? classic_table() : __table)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2003 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
|
||||
@ -48,8 +48,8 @@
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask graph = _ISgraph;
|
||||
static const mask graph = _ISalpha | _ISdigit | _ISpunct;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask alnum = _ISalnum;
|
||||
static const mask alnum = _ISalpha | _ISdigit;
|
||||
};
|
||||
|
@ -39,18 +39,28 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(!__table ?
|
||||
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(!__table ?
|
||||
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
@ -51,5 +51,8 @@
|
||||
// GCC does not use thunks on IRIX.
|
||||
#define _G_USING_THUNKS 0
|
||||
|
||||
// FINOREAD takes an "off_t *" as argument.
|
||||
#define _GLIBCXX_FIONREAD_TAKES_OFF_T
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -43,16 +43,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Specific definitions for generic platforms -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 2001, 2002, 2003 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
|
||||
@ -28,10 +28,21 @@
|
||||
// the GNU General Public License.
|
||||
|
||||
|
||||
#ifndef _GLIBCPP_OS_DEFINES
|
||||
# define _GLIBCPP_OS_DEFINES
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
# define _GLIBCXX_OS_DEFINES
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
||||
// Define as 0, if you want, to enable inlining of gthread functions.
|
||||
// By default, don't pollute libstdc++ with win32api names.
|
||||
#if !defined (__GTHREAD_HIDE_WIN32API)
|
||||
# define __GTHREAD_HIDE_WIN32API 1
|
||||
#endif
|
||||
|
||||
// Don't let win32api windef.h define min and max as macros
|
||||
// if included after stl_algobase.h.
|
||||
#undef NOMINMAX
|
||||
#define NOMINMAX 1
|
||||
|
||||
#endif
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -39,14 +39,24 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2003 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
|
||||
@ -49,8 +49,8 @@
|
||||
static const mask xdigit = _ISXDIGIT;
|
||||
static const mask space = _ISSPACE;
|
||||
static const mask print = _ISPRINT;
|
||||
static const mask graph = _ISGRAPH;
|
||||
static const mask graph = _ISALPHA | _ISDIGIT | _ISPUNCT;
|
||||
static const mask cntrl = _ISCNTRL;
|
||||
static const mask punct = _ISPUNCT;
|
||||
static const mask alnum = _ISALNUM;
|
||||
static const mask alnum = _ISALPHA | _ISDIGIT;
|
||||
};
|
||||
|
@ -39,16 +39,26 @@
|
||||
|
||||
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
|
||||
size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
|
||||
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
|
||||
: facet(__refs), _M_del(__table != 0 && __del),
|
||||
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
|
||||
_M_table(__table ? __table : classic_table())
|
||||
{ }
|
||||
{
|
||||
memset(_M_widen, 0, sizeof(_M_widen));
|
||||
_M_widen_ok = 0;
|
||||
memset(_M_narrow, 0, sizeof(_M_narrow));
|
||||
_M_narrow_ok = 0;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
|
@ -27,8 +27,8 @@
|
||||
// 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
|
||||
#ifndef _GLIBCXX_OS_DEFINES
|
||||
#define _GLIBCXX_OS_DEFINES 1
|
||||
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user