Gcc 3.2.1-prerelease C++ support bits from the FSF anoncvs repo gcc-3_2-branch on 16-Sep-2002 13:23:11 EDT.

This commit is contained in:
Alexander Kabaev 2002-09-17 04:04:04 +00:00
parent acabf91c96
commit 20250742da
43 changed files with 8598 additions and 1659 deletions

View File

@ -1,3 +1,169 @@
2002-09-12 Benjamin Kosnik <bkoz@redhat.com>
* libmath/Makefile.am (LIBTOOL): Use --tag CC always for this
directory.
* libmath/Makefile.in: Regenerate.
* src/Makefile.am: Tweak comment.
* src/Makefile.in: Regenerate.
* config/locale/gnu/c_locale.h: Remove warnings.
Inject __uselocale into __gnu_cxx.
* config/locale/generic/c_locale.h: Match.
2002-09-12 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.tcc (__convert_from_v): Remove.
* config/locale/gnu/c_locale.h (__convert_from_v): Add.
* config/locale/generic/c_locale.h (__convert_from_v): Add.
2002-09-12 Paolo Carlini <pcarlini@unitus.it>
* include/bits/locale_facets.tcc (__convert_from_v):
Use __uselocale instead of setlocale for glibc 2.3+.
2002-09-12 Benjamin Kosnik <bkoz@redhat.com>
* src/Makefile.am (sources): Edit.
(target_sources): New.
(target_sources_extra): New.
* src/Makefile.in: Regenerate.
* acinclude.m4: Set CCODECVT_CC.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* src/locale.cc: Move ctype definitions...
* src/ctype.cc: ...here. New file.
* src/locale.cc: Move codecvt definitions...
* src/codecvt.cc: ...here.
* config/generic/codecvt_members.cc: ...and here.
* config/gnu/codecvt_members.cc: ...and here.
* include/bits/codecvt.h: Tweak.
* include/bits/locale_facets: Tweak.
* src/bitset.cc: Correct license text.
* src/concept-inst.cc: Same.
* src/strstream.cc: Same.
* src/vterminate.cc: Same.
2002-09-10 Danny Smith <dannysmith@users.sourceforge.net>
* include/bits/locale_facets.tcc (__convert_from_v):
Replace strdup with ISO malloc and strcpy.
2002-09-09 Benjamin Kosnik <bkoz@redhat.com>
* src/misc-inst.cc: Remove some instantiations.
* testsuite/abi_check.cc: Make output results more verbose.
* config/os/gnu-linux/ctype_base.h: Remove shadow headers injections.
2002-09-07 Jakub Jelinek <jakub@redhat.com>
* config/locale/generic/messages_members.cc: Add specialization for
messages<wchar_t>.
* config/locale/ieee_1003.1-20021/messages_members.cc: Likewise.
2002-09-06 Jakub Jelinek <jakub@redhat.com>
* configure.target: Use cpu_include_dir="config/cpu/sparc" for all
sparc targets.
* config/cpu/sparc/bits/atomicity.h: New file.
* config/cpu/sparc/sparc32/bits/atomicity.h: Removed.
* config/cpu/sparc/sparc64/bits/atomicity.h: Removed.
2002-09-06 Jakub Jelinek <jakub@redhat.com>
* config/os/gnu-linux/bits/ctype_noninline.h
[_GLIBCPP_USE_SHADOW_HEADERS]: Remove using _C_legacy::__ctype_*.
(ctype<char>::classic_table): If _GLIBCPP_C_LOCALE_GNU, return
_S_c_locale->__ctype_b, otherwise temporarily switch to "C" locale
and return __ctype_b.
(ctype<char>::ctype(__c_locale, const mask*, bool, size_t)): If not
_GLIBCPP_C_LOCALE_GNU, temporarily switch to "C" locale and
initialize using __ctype_{b,tolower,toupper}.
(ctype<char>::ctype(const mask*, bool, size_t)): If
_GLIBCPP_C_LOCALE_GNU, initialize using
_S_c_locale->__ctype_{b,tolower,toupper}, otherwise temporarily
switch to "C" locale and initialize using __ctype_{b,tolower,toupper}.
2002-09-05 Loren J. Rittle <ljrittle@acm.org>
Move from mainline.
* src/Makefile.am (AUTOMAKE_OPTIONS): Use cygnus-style generation.
* testsuite/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
* src/Makefile.in: Regenerate (explicitly with --cygnus option).
* testsuite/Makefile.in: Likewise.
2002-09-05 Paolo Carlini <pcarlini@unitus.it>
Roland McGrath <roland@redhat.com>
PR libstdc++/7811
* src/locale.cc (locale::locale(__s)): Use getenv instead
of setenv for the environment locale.
* testsuite/22_locale/ctor_copy_dtor.cc (test03): New.
2002-09-05 Jakub Jelinek <jakub@redhat.com>
* config/abi/ia64-unknown-linux-gnu: Add.
* config/abi/ia64-unknown-linux-gnu/baseline_symbols.txt: New file.
* config/abi/alphaev67-unknown-linux-gnu: Add.
* config/abi/alphaev67-unknown-linux-gnu/baseline_symbols.txt: New file.
2002-09-05 Phil Edwards <pme@gcc.gnu.org>
* testsuite/Makefile.am: Use LD_RUN_PATH when linking abi_check.
Fix spelling in comment.
* testsuite/Makefile.in: Regenerate.
* testsuite/abi_check.cc: Use string literals to build 'cmd' rather
than 'quote' and 'bslash'.
2002-09-05 Jakub Jelinek <jakub@redhat.com>
* config/locale/gnu/ctype_members.cc (ctype<wchar_t>::do_widen(char)):
Switch to _M_c_locale_ctype around btowc call.
(ctype<wchar_t>::do_widen(const char*, const char *, wchar_t*)):
Switch to _M_c_locale_ctype around mbsrtowcs call.
(ctype<wchar_t>::do_narrow(char)): Switch to _M_c_locale_ctype around
wctob call.
(ctype<wchar_t>::do_narrow(const char*, const char *, wchar_t*)):
Switch to _M_c_locale_ctype around wcsrtombs call.
2002-09-05 Jakub Jelinek <jakub@redhat.com>
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t, true>::_M_initialize_moneypunct,
moneypunct<wchar_t, false>::_M_initialize_moneypunct): Use
__uselocale instead of setlocale for glibc 2.3.
2002-09-05 Jakub Jelinek <jakub@redhat.com>
* config/locale/generic/c++locale_internal.h: New header.
* config/locale/gnu/c++locale_internal.h: New header.
* config/locale/gnu/c_locale.cc: Include it.
* config/locale/gnu/collate_members.cc: Include it.
* config/locale/gnu/ctype_members.cc: Include it.
* config/locale/gnu/messages_members.cc: Include it.
* config/locale/gnu/monetary_members.cc: Include it.
* config/locale/gnu/numeric_members.cc: Include it.
* config/locale/gnu/time_members.cc: Include it.
(_M_put): Reorder __strftime_l and __wcsftime_l arguments to match
glibc.
(_M_initialize_timepunct): Initialize _M_c_locale_timepunct for
C locale.
* acinclude.m4: Include string.h when testing strcoll_l.
For glibc 2.3 provide __-prefixed prototypes.
(CLOCALE_INTERNAL_H): Set, add AC_LINK_FILES line.
* aclocal.m4, configure: Rebuilt.
2002-09-05 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h: Add declaration of specialization
here.
* config/locale/gnu/messages_members.cc: Add specialization for
messages<wchar_t>.
* config/locale/gnu/messages_members.h: Remove generic definition
of do_get.
2002-08-26 Phil Edwards <pme@gcc.gnu.org>
* Makefile.am (check-abi): Specify current directory.

View File

@ -1,4 +1,4 @@
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@ -155,7 +155,44 @@ MULTICLEAN = true
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"NM=$(NM)" \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
@ -167,7 +204,7 @@ mkcheck.in testsuite_flags.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:

View File

@ -1131,6 +1131,12 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_TRY_RUN([
#define _GNU_SOURCE 1
#include <locale.h>
#include <string.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
extern __typeof(newlocale) __newlocale;
extern __typeof(duplocale) __duplocale;
extern __typeof(strcoll_l) __strcoll_l;
#endif
int main()
{
const char __one[] = "Äuglein Augmen";
@ -1172,6 +1178,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/generic/c_locale.h
CLOCALE_CC=config/locale/generic/c_locale.cc
CCODECVT_H=config/locale/generic/codecvt_specializations.h
CCODECVT_CC=config/locale/generic/codecvt_members.cc
CCOLLATE_CC=config/locale/generic/collate_members.cc
CCTYPE_CC=config/locale/generic/ctype_members.cc
CMESSAGES_H=config/locale/generic/messages_members.h
@ -1179,6 +1186,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
xgnu)
AC_MSG_RESULT(gnu)
@ -1204,6 +1212,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/gnu/c_locale.h
CLOCALE_CC=config/locale/gnu/c_locale.cc
CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
CCODECVT_CC=config/locale/gnu/codecvt_members.cc
CCOLLATE_CC=config/locale/gnu/collate_members.cc
CCTYPE_CC=config/locale/gnu/ctype_members.cc
CMESSAGES_H=config/locale/gnu/messages_members.h
@ -1211,6 +1220,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/gnu/monetary_members.cc
CNUMERIC_CC=config/locale/gnu/numeric_members.cc
CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
xieee_1003.1-2001)
AC_MSG_RESULT(generic)
@ -1218,6 +1228,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
CCODECVT_CC=config/locale/generic/codecvt_members.cc
CCOLLATE_CC=config/locale/generic/collate_members.cc
CCTYPE_CC=config/locale/generic/ctype_members.cc
CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
@ -1225,6 +1236,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
*)
echo "$enable_clocale is an unknown locale package" 1>&2
@ -1237,17 +1249,23 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
glibcpp_localedir=${glibcpp_builddir}/po/share/locale
AC_SUBST(glibcpp_localedir)
# For the time being, transform ctype_noninline.h to ctype_members_char.cc
# CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h
AC_SUBST(USE_NLS)
AC_SUBST(CLOCALE_H)
AC_SUBST(CCODECVT_H)
AC_SUBST(CMESSAGES_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric.cc)
AC_LINK_FILES($CTIME_CC, src/time.cc)
AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc)
# AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc)
AC_LINK_FILES($CTIME_CC, src/time_members.cc)
AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
])

View File

@ -1,4 +1,4 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@ -1143,6 +1143,12 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_TRY_RUN([
#define _GNU_SOURCE 1
#include <locale.h>
#include <string.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
extern __typeof(newlocale) __newlocale;
extern __typeof(duplocale) __duplocale;
extern __typeof(strcoll_l) __strcoll_l;
#endif
int main()
{
const char __one[] = "Äuglein Augmen";
@ -1184,6 +1190,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/generic/c_locale.h
CLOCALE_CC=config/locale/generic/c_locale.cc
CCODECVT_H=config/locale/generic/codecvt_specializations.h
CCODECVT_CC=config/locale/generic/codecvt_members.cc
CCOLLATE_CC=config/locale/generic/collate_members.cc
CCTYPE_CC=config/locale/generic/ctype_members.cc
CMESSAGES_H=config/locale/generic/messages_members.h
@ -1191,6 +1198,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
xgnu)
AC_MSG_RESULT(gnu)
@ -1216,6 +1224,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/gnu/c_locale.h
CLOCALE_CC=config/locale/gnu/c_locale.cc
CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
CCODECVT_CC=config/locale/gnu/codecvt_members.cc
CCOLLATE_CC=config/locale/gnu/collate_members.cc
CCTYPE_CC=config/locale/gnu/ctype_members.cc
CMESSAGES_H=config/locale/gnu/messages_members.h
@ -1223,6 +1232,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/gnu/monetary_members.cc
CNUMERIC_CC=config/locale/gnu/numeric_members.cc
CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
xieee_1003.1-2001)
AC_MSG_RESULT(generic)
@ -1230,6 +1240,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
CCODECVT_CC=config/locale/generic/codecvt_members.cc
CCOLLATE_CC=config/locale/generic/collate_members.cc
CCTYPE_CC=config/locale/generic/ctype_members.cc
CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
@ -1237,6 +1248,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
*)
echo "$enable_clocale is an unknown locale package" 1>&2
@ -1249,17 +1261,23 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
glibcpp_localedir=${glibcpp_builddir}/po/share/locale
AC_SUBST(glibcpp_localedir)
# For the time being, transform ctype_noninline.h to ctype_members_char.cc
# CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h
AC_SUBST(USE_NLS)
AC_SUBST(CLOCALE_H)
AC_SUBST(CCODECVT_H)
AC_SUBST(CMESSAGES_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric.cc)
AC_LINK_FILES($CTIME_CC, src/time.cc)
AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc)
AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc)
# AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc)
AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc)
AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc)
AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc)
AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc)
AC_LINK_FILES($CTIME_CC, src/time_members.cc)
AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
])
@ -2205,7 +2223,7 @@ AC_MSG_RESULT($enable_symvers)
])
# isc-posix.m4 serial 2 (gettext-0.11.2)
# isc-posix.m4 serial 1 (gettext-0.10.40)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@ -2213,8 +2231,6 @@ dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
# This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package)
@ -2275,8 +2291,7 @@ dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
@ -2292,42 +2307,13 @@ AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
# Copyright 2002 Free Software Foundation, Inc.
# This program 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 program 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 program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.4-p6])])
#
# Check to make sure that the build environment is sane.
#

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
// Low-level functions for atomic operations: Sparc version -*- C++ -*-
// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#ifdef __arch64__
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");
}
#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");
}
#endif /* __arch32__ */
#endif /* atomicity.h */

View File

@ -0,0 +1,30 @@
// Locale internal implementation header -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
// The generic locale code doesn't need to do anything here (yet)

View File

@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -38,4 +38,32 @@
namespace std
{
typedef int* __c_locale;
template<typename _Tv>
int
__convert_from_v(char* __out, const int __size, 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");
int __ret;
#ifdef _GLIBCPP_USE_C99
if (__prec >= 0)
__ret = snprintf(__out, __size, __fmt, __prec, __v);
else
__ret = snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
__ret = sprintf(__out, __fmt, __prec, __v);
else
__ret = sprintf(__out, __fmt, __v);
#endif
setlocale(LC_ALL, __sav);
free(__sav);
return __ret;
}
}

View File

@ -0,0 +1,101 @@
// std::codecvt implementation details, generic version -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.2.1.5 - Template class codecvt
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
// Specializations.
#ifdef _GLIBCPP_USE_WCHAR_T
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
size_t __conv = wcsrtombs(__to, &__from, __len, &__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;
}
else
__ret = error;
return __ret;
}
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
size_t __conv = mbsrtowcs(__to, &__from, __len, &__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;
}
else
__ret = error;
return __ret;
}
#endif
}

View File

@ -42,4 +42,11 @@ namespace std
string
messages<char>::do_get(catalog, int, int, const string& __dfault) const
{ return __dfault; }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
{ return __dfault; }
#endif
}

View File

@ -0,0 +1,59 @@
// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
// Written by Jakub Jelinek <jakub@redhat.com>
#include <clocale>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
extern "C" __typeof(iswctype_l) __iswctype_l;
extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
extern "C" __typeof(strcoll_l) __strcoll_l;
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;
extern "C" __typeof(wcscoll_l) __wcscoll_l;
extern "C" __typeof(wcsftime_l) __wcsftime_l;
extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
extern "C" __typeof(wctype_l) __wctype_l;
extern "C" __typeof(newlocale) __newlocale;
extern "C" __typeof(freelocale) __freelocale;
extern "C" __typeof(duplocale) __duplocale;
extern "C" __typeof(uselocale) __uselocale;
#endif // GLIBC 2.3 and later

View File

@ -36,6 +36,7 @@
#include <locale>
#include <stdexcept>
#include <langinfo.h>
#include "c++locale_internal.h"
namespace std
{

View File

@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -40,7 +40,53 @@
#define _GLIBCPP_C_LOCALE_GNU 1
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
namespace __gnu_cxx
{
extern "C" __typeof(uselocale) __uselocale;
}
#endif
namespace std
{
typedef __locale_t __c_locale;
template<typename _Tv>
int
__convert_from_v(char* __out, const int __size, const char* __fmt,
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_Tv __v, const __c_locale& __cloc, int __prec = -1)
{
__c_locale __old = __gnu_cxx::__uselocale(__cloc);
#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");
#endif
int __ret;
#ifdef _GLIBCPP_USE_C99
if (__prec >= 0)
__ret = snprintf(__out, __size, __fmt, __prec, __v);
else
__ret = snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
__ret = sprintf(__out, __fmt, __prec, __v);
else
__ret = sprintf(__out, __fmt, __v);
#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__gnu_cxx::__uselocale(__old);
#else
setlocale(LC_ALL, __sav);
free(__sav);
#endif
return __ret;
}
}

View File

@ -0,0 +1,113 @@
// std::codecvt implementation details, GNU version -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.2.1.5 - Template class codecvt
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
// Specializations.
#ifdef _GLIBCPP_USE_WCHAR_T
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_codecvt);
#endif
size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
#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;
}
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_codecvt);
#endif
size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
#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;
}
#endif
}

View File

@ -1,6 +1,6 @@
// std::collate implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{

View File

@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
@ -165,15 +166,30 @@ namespace std
wchar_t
ctype<wchar_t>::
do_widen(char __c) const
{ return btowc(__c); }
{
#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;
}
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
return __hi;
}
@ -181,7 +197,13 @@ namespace std
ctype<wchar_t>::
do_narrow(wchar_t __wc, char __dfault) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_ctype);
#endif
int __c = wctob(__wc);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
return (__c == EOF ? __dfault : static_cast<char>(__c));
}
@ -190,6 +212,9 @@ namespace std
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_ctype);
#endif
size_t __offset = 0;
while (true)
{
@ -207,6 +232,9 @@ namespace std
else
break;
}
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
return __hi;
}
#endif // _GLIBCPP_USE_WCHAR_T

View File

@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
@ -56,4 +57,25 @@ namespace std
return string(__msg);
#endif
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
{
# if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
__uselocale(__old);
return _M_convert_from_char(__msg);
# else
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
setlocale(LC_ALL, __old);
free(__old);
return _M_convert_from_char(__msg);
# endif
}
#endif
}

View File

@ -54,26 +54,6 @@
return 0;
}
template<typename _CharT>
typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog, int, int,
const string_type& __dfault) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
__uselocale(__old);
return _M_convert_from_char(__msg);
#else
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_messages);
char* __msg = gettext(_M_convert_to_char(__dfault));
setlocale(LC_ALL, __old);
free(__old);
return _M_convert_from_char(__msg);
#endif
}
template<typename _CharT>
void
messages<_CharT>::do_close(catalog) const

View File

@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
@ -334,9 +335,13 @@ namespace std
else
{
// Named locale.
// XXX Fix me. Switch to named locale so that mbsrtowcs will work.
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(__cloc);
#else
// Switch to named locale so that mbsrtowcs will work.
char* __old = strdup(setlocale(LC_ALL, NULL));
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);
@ -399,9 +404,12 @@ namespace std
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
// XXX
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
setlocale(LC_ALL, __old);
free(__old);
#endif
}
}
@ -426,9 +434,13 @@ namespace std
else
{
// Named locale.
// XXX Fix me. Switch to named locale so that mbsrtowcs will work.
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(__cloc);
#else
// Switch to named locale so that mbsrtowcs will work.
char* __old = strdup(setlocale(LC_ALL, NULL));
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);
@ -490,9 +502,12 @@ namespace std
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
// XXX
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#else
setlocale(LC_ALL, __old);
free(__old);
#endif
}
}

View File

@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{

View File

@ -35,6 +35,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
#include "c++locale_internal.h"
namespace std
{
@ -52,7 +53,7 @@ namespace std
const tm* __tm) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__strftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
__strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
#else
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
@ -69,6 +70,9 @@ namespace std
if (__cloc == _S_c_locale)
{
// "C" locale
_M_c_locale_timepunct = _S_c_locale;
_M_date_format = "%m/%d/%y";
_M_date_era_format = "%m/%d/%y";
_M_time_format = "%H:%M:%S";
@ -202,7 +206,7 @@ namespace std
const tm* __tm) const
{
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__wcsftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
__wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
#else
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
@ -219,6 +223,9 @@ namespace std
if (__cloc == _S_c_locale)
{
// "C" locale
_M_c_locale_timepunct = _S_c_locale;
_M_date_format = L"%m/%d/%y";
_M_date_era_format = L"%m/%d/%y";
_M_time_format = L"%H:%M:%S";

View File

@ -46,4 +46,16 @@ namespace std
nl_catd __nlc = reinterpret_cast<nl_catd>(__c);
return string(catgets(__nlc, __setid, __msgid, __dfault.c_str()));
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
{
nl_catd __nlc = reinterpret_cast<nl_catd>(__c);
char* __msg = catgets(__nlc, __setid, __msgid,
_M_convert_to_char(__dfault));
return _M_convert_from_char(__msg);
}
#endif
}

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -33,20 +33,6 @@
// Information as gleaned from /usr/include/ctype.h
#if _GLIBCPP_USE_SHADOW_HEADERS
using _C_legacy::_ISspace;
using _C_legacy::_ISprint;
using _C_legacy::_IScntrl;
using _C_legacy::_ISupper;
using _C_legacy::_ISlower;
using _C_legacy::_ISalpha;
using _C_legacy::_ISdigit;
using _C_legacy::_ISpunct;
using _C_legacy::_ISxdigit;
using _C_legacy::_ISalnum;
using _C_legacy::_ISgraph;
#endif
struct ctype_base
{
// Non-standard typedefs.

View File

@ -34,15 +34,31 @@
// Information as gleaned from /usr/include/ctype.h
#if _GLIBCPP_USE_SHADOW_HEADERS
using _C_legacy::__ctype_toupper;
using _C_legacy::__ctype_tolower;
using _C_legacy::__ctype_b;
#endif
#if _GLIBCPP_C_LOCALE_GNU
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return __ctype_b; }
{
if (!_S_c_locale)
_S_create_c_locale(_S_c_locale, "C");
return _S_c_locale->__ctype_b;
}
#else
const ctype_base::mask*
ctype<char>::classic_table() throw()
{
const ctype_base::mask* __ret;
char* __old = strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__ret = *__ctype_b_loc();
#else
__ret = __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
return __ret;
}
#endif
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
@ -57,17 +73,54 @@
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = _S_c_locale; }
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
#else
_M_toupper = __ctype_toupper;
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_c_locale;
}
#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),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = _S_c_locale; }
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
_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;
}
#else
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
_M_toupper = *__ctype_toupper_loc();
_M_tolower = *__ctype_tolower_loc();
_M_table = __table ? __table : *__ctype_b_loc();
#else
_M_toupper = __ctype_toupper;
_M_tolower = __ctype_tolower;
_M_table = __table ? __table : __ctype_b;
#endif
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_c_locale;
}
#endif
char
ctype<char>::do_toupper(char __c) const

File diff suppressed because it is too large Load Diff

View File

@ -61,11 +61,8 @@ case "${target_cpu}" in
s390 | s390x)
cpu_include_dir="config/cpu/s390"
;;
sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64"
;;
sparc*)
cpu_include_dir="config/cpu/sparc/sparc32"
sparc* | ultrasparc)
cpu_include_dir="config/cpu/sparc"
;;
x86_64*)
cpu_include_dir="config/cpu/x86-64"

View File

@ -34,7 +34,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
#define __GLIBCPP__ 20020831
#define __GLIBCPP__ 20020916
// This is necessary until GCC supports separate template
// compilation.

View File

@ -1,6 +1,6 @@
// Locale support (codecvt) -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -164,7 +164,7 @@
typedef _ExternT extern_type;
typedef _StateT state_type;
// Data Members:
public:
static locale::id id;
explicit
@ -219,7 +219,7 @@
typedef char extern_type;
typedef mbstate_t state_type;
// Data Members:
public:
static locale::id id;
explicit
@ -271,7 +271,7 @@
typedef char extern_type;
typedef mbstate_t state_type;
// Data Members:
public:
static locale::id id;
explicit
@ -320,8 +320,9 @@
{
public:
explicit
codecvt_byname(const char*, size_t __refs = 0)
codecvt_byname(const char* __s, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__refs) { }
protected:
virtual
~codecvt_byname() { }

View File

@ -847,7 +847,6 @@ namespace std
: locale::facet(__refs)
{ _M_c_locale_collate = _S_c_locale; }
// Non-standard.
explicit
collate(__c_locale __cloc, size_t __refs = 0)
: locale::facet(__refs)
@ -1739,6 +1738,12 @@ namespace std
string
messages<char>::do_get(catalog, int, int, const string&) const;
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
#endif
// Include host and configuration specific messages virtual functions.
#include <bits/messages_members.h>

View File

@ -1969,41 +1969,10 @@ namespace std
// Convert numeric value of type _Tv to string and return length of string.
// If snprintf is available use it, otherwise fall back to the unsafe sprintf
// which, in general, can be dangerous and should be avoided.
#ifdef _GLIBCPP_USE_C99
template<typename _Tv>
int
__convert_from_v(char* __out, const int __size, const char* __fmt,
_Tv __v, const __c_locale&, int __prec = -1)
{
int __ret;
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
if (__prec >= 0)
__ret = snprintf(__out, __size, __fmt, __prec, __v);
else
__ret = snprintf(__out, __size, __fmt, __v);
setlocale(LC_ALL, __old);
free(__old);
return __ret;
}
#else
template<typename _Tv>
int
__convert_from_v(char* __out, const int, const char* __fmt, _Tv __v,
const __c_locale&, int __prec = -1)
{
int __ret;
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
if (__prec >= 0)
__ret = sprintf(__out, __fmt, __prec, __v);
else
__ret = sprintf(__out, __fmt, __v);
setlocale(LC_ALL, __old);
free(__old);
return __ret;
}
#endif
_Tv __v, const __c_locale&, int __prec = -1);
// Construct correctly padded string, as per 22.2.2.2.2
// Assumes

View File

@ -34,12 +34,11 @@ libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = stubs.c
LINK = \
$(LIBTOOL) --tag CC --mode=link "$(CCLD)" \
$(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
$(TOPLEVEL_INCLUDES)
# Only compiling "C" sources in this directory.
LIBTOOL = @LIBTOOL@ --tag CC

View File

@ -92,7 +92,6 @@ LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
MAINT = @MAINT@
@ -144,17 +143,15 @@ libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = stubs.c
LINK = \
$(LIBTOOL) --tag CC --mode=link "$(CCLD)" \
$(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
$(TOPLEVEL_INCLUDES)
# Only compiling "C" sources in this directory.
LIBTOOL = @LIBTOOL@ --tag CC
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
@ -170,6 +167,7 @@ CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in

View File

@ -22,12 +22,12 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
AUTOMAKE_OPTIONS = 1.3 gnits
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
# Cross compiler support.
CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
@ -60,17 +60,54 @@ INCLUDES = \
$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
$(TOPLEVEL_INCLUDES)
# Source files linked in via configuration magic for a particular target.
target_sources = \
codecvt_members.cc \
collate_members.cc \
ctype_members.cc \
messages_members.cc \
monetary_members.cc \
numeric_members.cc \
time_members.cc
# Source files linked in via configuration magic for a particular
# target, but with ad hoc naming rules.
target_sources_extra = \
basic_file.cc \
c++locale.cc
# Sources present in the src directory.
sources = \
globals.cc limits.cc \
basic_file.cc complex_io.cc ios.cc strstream.cc \
bitset.cc \
functexcept.cc stdexcept.cc vterminate.cc \
c++locale.cc locale.cc localename.cc codecvt.cc \
collate.cc ctype.cc messages.cc monetary.cc numeric.cc time.cc \
concept-inst.cc locale-inst.cc misc-inst.cc stl-inst.cc \
string-inst.cc wstring-inst.cc valarray-inst.cc ext-inst.cc \
fstream.cc fstream-inst.cc io-inst.cc istream-inst.cc \
ostream-inst.cc streambuf-inst.cc sstream-inst.cc
codecvt.cc \
complex_io.cc \
concept-inst.cc \
ctype.cc \
ext-inst.cc \
fstream.cc \
fstream-inst.cc \
functexcept.cc \
globals.cc \
io-inst.cc \
ios.cc \
istream-inst.cc \
limits.cc \
locale.cc \
locale-inst.cc \
localename.cc \
misc-inst.cc \
ostream-inst.cc \
sstream-inst.cc \
stdexcept.cc \
stl-inst.cc \
streambuf-inst.cc \
string-inst.cc \
strstream.cc \
valarray-inst.cc \
vterminate.cc \
wstring-inst.cc \
${target_sources} \
${target_sources_extra}
VPATH = $(top_srcdir)/src:$(top_srcdir)

View File

@ -125,12 +125,12 @@ libio_la = @libio_la@
libtool_VERSION = @libtool_VERSION@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 gnits
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
# Cross compiler support.
CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
@ -166,17 +166,56 @@ INCLUDES = \
$(TOPLEVEL_INCLUDES)
# Source files linked in via configuration magic for a particular target.
target_sources = \
codecvt_members.cc \
collate_members.cc \
ctype_members.cc \
messages_members.cc \
monetary_members.cc \
numeric_members.cc \
time_members.cc
# Source files linked in via configuration magic for a particular
# target, but with ad hoc naming rules.
target_sources_extra = \
basic_file.cc \
c++locale.cc
# Sources present in the src directory.
sources = \
globals.cc limits.cc \
basic_file.cc complex_io.cc ios.cc strstream.cc \
bitset.cc \
functexcept.cc stdexcept.cc vterminate.cc \
c++locale.cc locale.cc localename.cc codecvt.cc \
collate.cc ctype.cc messages.cc monetary.cc numeric.cc time.cc \
concept-inst.cc locale-inst.cc misc-inst.cc stl-inst.cc \
string-inst.cc wstring-inst.cc valarray-inst.cc ext-inst.cc \
fstream.cc fstream-inst.cc io-inst.cc istream-inst.cc \
ostream-inst.cc streambuf-inst.cc sstream-inst.cc
codecvt.cc \
complex_io.cc \
concept-inst.cc \
ctype.cc \
ext-inst.cc \
fstream.cc \
fstream-inst.cc \
functexcept.cc \
globals.cc \
io-inst.cc \
ios.cc \
istream-inst.cc \
limits.cc \
locale.cc \
locale-inst.cc \
localename.cc \
misc-inst.cc \
ostream-inst.cc \
sstream-inst.cc \
stdexcept.cc \
stl-inst.cc \
streambuf-inst.cc \
string-inst.cc \
strstream.cc \
valarray-inst.cc \
vterminate.cc \
wstring-inst.cc \
${target_sources} \
${target_sources_extra}
VPATH = $(top_srcdir)/src:$(top_srcdir)
@ -254,13 +293,15 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libstdc___la_OBJECTS = globals.lo limits.lo basic_file.lo complex_io.lo \
ios.lo strstream.lo bitset.lo functexcept.lo stdexcept.lo vterminate.lo \
c++locale.lo locale.lo localename.lo codecvt.lo collate.lo ctype.lo \
messages.lo monetary.lo numeric.lo time.lo concept-inst.lo \
locale-inst.lo misc-inst.lo stl-inst.lo string-inst.lo wstring-inst.lo \
valarray-inst.lo ext-inst.lo fstream.lo fstream-inst.lo io-inst.lo \
istream-inst.lo ostream-inst.lo streambuf-inst.lo sstream-inst.lo
libstdc___la_OBJECTS = bitset.lo codecvt.lo complex_io.lo \
concept-inst.lo ctype.lo ext-inst.lo fstream.lo fstream-inst.lo \
functexcept.lo globals.lo io-inst.lo ios.lo istream-inst.lo limits.lo \
locale.lo locale-inst.lo localename.lo misc-inst.lo ostream-inst.lo \
sstream-inst.lo stdexcept.lo stl-inst.lo streambuf-inst.lo \
string-inst.lo strstream.lo valarray-inst.lo vterminate.lo \
wstring-inst.lo codecvt_members.lo collate_members.lo ctype_members.lo \
messages_members.lo monetary_members.lo numeric_members.lo \
time_members.lo basic_file.lo c++locale.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)

View File

@ -2,22 +2,21 @@
// Copyright (C) 2001, 2002 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC 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)
// 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.
//
// GNU CC is distributed in the hope that it will be useful,
// 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 GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 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.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate

View File

@ -31,6 +31,13 @@
namespace std
{
// Definitions for locale::id of standard facets that are specialized.
locale::id codecvt<char, char, mbstate_t>::id;
#ifdef _GLIBCPP_USE_WCHAR_T
locale::id codecvt<wchar_t, char, mbstate_t>::id;
#endif
#ifdef _GLIBCPP_USE___ENC_TRAITS
// Definitions for static const data members of __enc_traits.
const int __enc_traits::_S_max_size;
@ -42,7 +49,8 @@ namespace std
{ }
codecvt<char, char, mbstate_t>::
~codecvt() { }
~codecvt()
{ }
codecvt_base::result
codecvt<char, char, mbstate_t>::
@ -106,39 +114,12 @@ namespace std
// codecvt<wchar_t, char, mbstate_t> required specialization
codecvt<wchar_t, char, mbstate_t>::
codecvt(size_t __refs)
: __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs) { }
: __codecvt_abstract_base<wchar_t, char, mbstate_t>(__refs)
{ }
codecvt<wchar_t, char, mbstate_t>::
~codecvt() { }
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
size_t __conv = wcsrtombs(__to, &__from, __len, &__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;
}
else
__ret = error;
return __ret;
}
~codecvt()
{ }
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
@ -149,35 +130,6 @@ namespace std
return noconv;
}
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
size_t __len = min(__from_end - __from, __to_end - __to);
size_t __conv = mbsrtowcs(__to, &__from, __len, &__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;
}
else
__ret = error;
return __ret;
}
int
codecvt<wchar_t, char, mbstate_t>::
do_encoding() const throw()

View File

@ -2,22 +2,21 @@
// Copyright (C) 2001, 2002 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC 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)
// 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.
//
// GNU CC is distributed in the hope that it will be useful,
// 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 GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 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.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate

View File

@ -0,0 +1,153 @@
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <locale>
namespace std
{
// XXX At some point, just rename this file to ctype_members_char.cc
// and compile it as a separate file instead of including it here.
// Platform-specific initialization code for ctype tables.
#include <bits/ctype_noninline.h>
// Definitions for locale::id of standard facets that are specialized.
locale::id ctype<char>::id;
#ifdef _GLIBCPP_USE_WCHAR_T
locale::id ctype<wchar_t>::id;
#endif
template<>
const ctype<char>&
use_facet<ctype<char> >(const locale& __loc)
{
size_t __i = ctype<char>::id._M_id();
const locale::_Impl* __tmp = __loc._M_impl;
return static_cast<const ctype<char>&>(*(__tmp->_M_facets[__i]));
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
const ctype<wchar_t>&
use_facet<ctype<wchar_t> >(const locale& __loc)
{
size_t __i = ctype<wchar_t>::id._M_id();
const locale::_Impl* __tmp = __loc._M_impl;
return static_cast<const ctype<wchar_t>&>(*(__tmp->_M_facets[__i]));
}
#endif
// Definitions for static const data members of ctype_base.
const ctype_base::mask ctype_base::space;
const ctype_base::mask ctype_base::print;
const ctype_base::mask ctype_base::cntrl;
const ctype_base::mask ctype_base::upper;
const ctype_base::mask ctype_base::lower;
const ctype_base::mask ctype_base::alpha;
const ctype_base::mask ctype_base::digit;
const ctype_base::mask ctype_base::punct;
const ctype_base::mask ctype_base::xdigit;
const ctype_base::mask ctype_base::alnum;
const ctype_base::mask ctype_base::graph;
const size_t ctype<char>::table_size;
ctype<char>::~ctype()
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
if (_M_del)
delete[] this->table();
}
// These are dummy placeholders as these virtual functions are never called.
bool
ctype<char>::do_is(mask, char_type) const
{ return false; }
const char*
ctype<char>::do_is(const char_type* __c, const char_type*, mask*) const
{ return __c; }
const char*
ctype<char>::do_scan_is(mask, const char_type* __c, const char_type*) const
{ return __c; }
const char*
ctype<char>::do_scan_not(mask, const char_type* __c, const char_type*) const
{ return __c; }
char
ctype<char>::do_widen(char __c) const
{ return __c; }
const char*
ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
{
memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
char
ctype<char>::do_narrow(char __c, char /*__dfault*/) const
{ return __c; }
const char*
ctype<char>::do_narrow(const char* __lo, const char* __hi,
char /*__dfault*/, char* __dest) const
{
memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
#ifdef _GLIBCPP_USE_WCHAR_T
ctype<wchar_t>::ctype(size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
{ _M_c_locale_ctype = _S_c_locale; }
ctype<wchar_t>::ctype(__c_locale __cloc, size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
{ _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
ctype<wchar_t>::~ctype()
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
}
template<>
ctype_byname<wchar_t>::ctype_byname(const char* __s, size_t __refs)
: ctype<wchar_t>(__refs)
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
}
#endif
} // namespace std

View File

@ -59,15 +59,6 @@ namespace std
locale::_Impl* locale::_S_global;
const size_t locale::_S_num_categories;
// Definitions for locale::id of standard facets that are specialized.
locale::id ctype<char>::id;
locale::id codecvt<char, char, mbstate_t>::id;
#ifdef _GLIBCPP_USE_WCHAR_T
locale::id ctype<wchar_t>::id;
locale::id codecvt<wchar_t, char, mbstate_t>::id;
#endif
// Definitions for static const data members of locale::id
_Atomic_word locale::id::_S_highwater; // init'd to 0 by linker
@ -202,7 +193,15 @@ namespace std
if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else if (strcmp(__s, "") == 0)
_M_impl = new _Impl(setlocale(LC_ALL, NULL), 1);
{
char* __env = getenv("LC_ALL");
if (__env)
_M_impl = new _Impl(__env, 1);
else if ((__env = getenv("LANG")))
_M_impl = new _Impl(__env, 1);
else
(_M_impl = _S_classic)->_M_add_reference();
}
else
_M_impl = new _Impl(__s, 1);
}
@ -389,97 +388,6 @@ namespace std
locale::id::id()
{ }
// Definitions for static const data members of ctype_base.
const ctype_base::mask ctype_base::space;
const ctype_base::mask ctype_base::print;
const ctype_base::mask ctype_base::cntrl;
const ctype_base::mask ctype_base::upper;
const ctype_base::mask ctype_base::lower;
const ctype_base::mask ctype_base::alpha;
const ctype_base::mask ctype_base::digit;
const ctype_base::mask ctype_base::punct;
const ctype_base::mask ctype_base::xdigit;
const ctype_base::mask ctype_base::alnum;
const ctype_base::mask ctype_base::graph;
// Platform-specific initialization code for ctype tables.
#include <bits/ctype_noninline.h>
const size_t ctype<char>::table_size;
ctype<char>::~ctype()
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
if (_M_del)
delete[] this->table();
}
// These are dummy placeholders as these virtual functions are never called.
bool
ctype<char>::do_is(mask, char_type) const
{ return false; }
const char*
ctype<char>::do_is(const char_type* __c, const char_type*, mask*) const
{ return __c; }
const char*
ctype<char>::do_scan_is(mask, const char_type* __c, const char_type*) const
{ return __c; }
const char*
ctype<char>::do_scan_not(mask, const char_type* __c, const char_type*) const
{ return __c; }
char
ctype<char>::do_widen(char __c) const
{ return __c; }
const char*
ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
{
memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
char
ctype<char>::do_narrow(char __c, char /*__dfault*/) const
{ return __c; }
const char*
ctype<char>::do_narrow(const char* __lo, const char* __hi,
char /*__dfault*/, char* __dest) const
{
memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
#ifdef _GLIBCPP_USE_WCHAR_T
ctype<wchar_t>::ctype(size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
{ _M_c_locale_ctype = _S_c_locale; }
ctype<wchar_t>::ctype(__c_locale __cloc, size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
{ _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
ctype<wchar_t>::~ctype()
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
}
template<>
ctype_byname<wchar_t>::ctype_byname(const char* __s, size_t __refs)
: ctype<wchar_t>(__refs)
{
if (_M_c_locale_ctype != _S_c_locale)
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
}
#endif
// Definitions for static const data members of time_base
template<>
const char*
@ -503,26 +411,6 @@ namespace std
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };
template<>
const ctype<char>&
use_facet<ctype<char> >(const locale& __loc)
{
size_t __i = ctype<char>::id._M_id();
const locale::_Impl* __tmp = __loc._M_impl;
return static_cast<const ctype<char>&>(*(__tmp->_M_facets[__i]));
}
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
const ctype<wchar_t>&
use_facet<ctype<wchar_t> >(const locale& __loc)
{
size_t __i = ctype<wchar_t>::id._M_id();
const locale::_Impl* __tmp = __loc._M_impl;
return static_cast<const ctype<wchar_t>&>(*(__tmp->_M_facets[__i]));
}
#endif
const char __num_base::_S_atoms[] = "0123456789eEabcdfABCDF";
bool

View File

@ -70,24 +70,7 @@ namespace std
#if 1
// XXX
// 2002-05-24 These are no longer needed and should be deleted.
// algorithm
typedef _Char_traits_match<char, char_traits<char> > char_match;
template
const char*
find_if<const char *, char_match>
(const char *, const char *, char_match, random_access_iterator_tag);
#ifdef _GLIBCPP_USE_WCHAR_T
typedef _Char_traits_match<wchar_t, char_traits<wchar_t> > wchar_match;
template const wchar_t*
find_if<const wchar_t*, wchar_match>
(const wchar_t*, const wchar_t*, wchar_match, random_access_iterator_tag);
#endif
// 2002-05-24 These are no longer needed and should eventually be deleted.
template
string*
__uninitialized_fill_n_aux<string*, size_t, string>

View File

@ -2,22 +2,21 @@
// Copyright (C) 2001, 2002 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC 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)
// 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.
//
// GNU CC is distributed in the hope that it will be useful,
// 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 GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 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.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate

View File

@ -2,22 +2,21 @@
// Copyright (C) 2001, 2002 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC 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)
// 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.
//
// GNU CC is distributed in the hope that it will be useful,
// 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 GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 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.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate