Commit 1c26d8fd by Benjamin Kosnik Committed by Benjamin Kosnik

locale_facets.h (messages): Move ctor, dtor definitions to..


2003-01-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/locale_facets.h (messages): Move ctor, dtor
	definitions to..
	(__timepunct): Same.
	* config/locale/gnu/messages_members.h (messages): Add dtor, ctor
	definitions. Conditionalize for GNU systems.
	* config/locale/generic/messages_members.h (messages): Add dtor, ctor
	definitions.
	* config/locale/gnu/time_members.h (messages): New. Add dtor, ctor
	definitions. Conditionalize for GNU systems.
	* config/locale/generic/time_members.h (messages): New. Add dtor, ctor
	definitions.
	* include/bits/localefwd.h (locale::facet::_S_c_name): Add.
	* src/locale.cc: Define.
	* src/localename.cc (locale::_Impl::_Impl(facet**, size_t, bool):
	Use it.
	* config/locale/gnu/time_members.h: Use it.
	* config/locale/gnu/messages_members.h: Use it.
	* config/linker-map.gnu: Add locale::facets details.
	* include/Makefile.am (target_headers_extra): Add time_members.h.
	* include/Makefile.in: Regenerate.
	* acinclude.m4: Export CTIME_H.
	* aclocal.m4: Regenerate.
	* configure: Regnerate.

From-SVN: r60952
parent 44f9a8e4
2003-01-06 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (messages): Move ctor, dtor
definitions to..
(__timepunct): Same.
* config/locale/gnu/messages_members.h (messages): Add dtor, ctor
definitions. Conditionalize for GNU systems.
* config/locale/generic/messages_members.h (messages): Add dtor, ctor
definitions.
* config/locale/gnu/time_members.h (messages): New. Add dtor, ctor
definitions. Conditionalize for GNU systems.
* config/locale/generic/time_members.h (messages): New. Add dtor, ctor
definitions.
* include/bits/localefwd.h (locale::facet::_S_c_name): Add.
* src/locale.cc: Define.
* src/localename.cc (locale::_Impl::_Impl(facet**, size_t, bool):
Use it.
* config/locale/gnu/time_members.h: Use it.
* config/locale/gnu/messages_members.h: Use it.
* config/linker-map.gnu: Add locale::facets details.
* include/Makefile.am (target_headers_extra): Add time_members.h.
* include/Makefile.in: Regenerate.
* acinclude.m4: Export CTIME_H.
* aclocal.m4: Regenerate.
* configure: Regnerate.
2003-01-06 Paolo Carlini <pcarlini@unitus.it> 2003-01-06 Paolo Carlini <pcarlini@unitus.it>
* src/codecvt.cc * src/codecvt.cc
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@ CXX = @CXX@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
......
...@@ -1272,6 +1272,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1272,6 +1272,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/generic/messages_members.cc CMESSAGES_CC=config/locale/generic/messages_members.cc
CMONEY_CC=config/locale/generic/monetary_members.cc CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_H=config/locale/generic/time_members.h
CTIME_CC=config/locale/generic/time_members.cc CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;; ;;
...@@ -1306,6 +1307,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1306,6 +1307,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/gnu/messages_members.cc CMESSAGES_CC=config/locale/gnu/messages_members.cc
CMONEY_CC=config/locale/gnu/monetary_members.cc CMONEY_CC=config/locale/gnu/monetary_members.cc
CNUMERIC_CC=config/locale/gnu/numeric_members.cc CNUMERIC_CC=config/locale/gnu/numeric_members.cc
CTIME_H=config/locale/gnu/time_members.h
CTIME_CC=config/locale/gnu/time_members.cc CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;; ;;
...@@ -1322,6 +1324,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1322,6 +1324,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
CMONEY_CC=config/locale/generic/monetary_members.cc CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_H=config/locale/generic/time_members.h
CTIME_CC=config/locale/generic/time_members.cc CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;; ;;
...@@ -1346,6 +1349,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1346,6 +1349,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_SUBST(CMESSAGES_CC) AC_SUBST(CMESSAGES_CC)
AC_SUBST(CMONEY_CC) AC_SUBST(CMONEY_CC)
AC_SUBST(CNUMERIC_CC) AC_SUBST(CNUMERIC_CC)
AC_SUBST(CTIME_H)
AC_SUBST(CTIME_CC) AC_SUBST(CTIME_CC)
AC_SUBST(CLOCALE_CC) AC_SUBST(CLOCALE_CC)
AC_SUBST(CLOCALE_INTERNAL_H) AC_SUBST(CLOCALE_INTERNAL_H)
......
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 Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
...@@ -1284,6 +1284,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1284,6 +1284,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/generic/messages_members.cc CMESSAGES_CC=config/locale/generic/messages_members.cc
CMONEY_CC=config/locale/generic/monetary_members.cc CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_H=config/locale/generic/time_members.h
CTIME_CC=config/locale/generic/time_members.cc CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;; ;;
...@@ -1318,6 +1319,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1318,6 +1319,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/gnu/messages_members.cc CMESSAGES_CC=config/locale/gnu/messages_members.cc
CMONEY_CC=config/locale/gnu/monetary_members.cc CMONEY_CC=config/locale/gnu/monetary_members.cc
CNUMERIC_CC=config/locale/gnu/numeric_members.cc CNUMERIC_CC=config/locale/gnu/numeric_members.cc
CTIME_H=config/locale/gnu/time_members.h
CTIME_CC=config/locale/gnu/time_members.cc CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;; ;;
...@@ -1334,6 +1336,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1334,6 +1336,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
CMONEY_CC=config/locale/generic/monetary_members.cc CMONEY_CC=config/locale/generic/monetary_members.cc
CNUMERIC_CC=config/locale/generic/numeric_members.cc CNUMERIC_CC=config/locale/generic/numeric_members.cc
CTIME_H=config/locale/generic/time_members.h
CTIME_CC=config/locale/generic/time_members.cc CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;; ;;
...@@ -1358,6 +1361,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ ...@@ -1358,6 +1361,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_SUBST(CMESSAGES_CC) AC_SUBST(CMESSAGES_CC)
AC_SUBST(CMONEY_CC) AC_SUBST(CMONEY_CC)
AC_SUBST(CNUMERIC_CC) AC_SUBST(CNUMERIC_CC)
AC_SUBST(CTIME_H)
AC_SUBST(CTIME_CC) AC_SUBST(CTIME_CC)
AC_SUBST(CLOCALE_CC) AC_SUBST(CLOCALE_CC)
AC_SUBST(CLOCALE_INTERNAL_H) AC_SUBST(CLOCALE_INTERNAL_H)
...@@ -2303,7 +2307,7 @@ AC_MSG_RESULT($enable_symvers) ...@@ -2303,7 +2307,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 Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU 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 dnl General Public License. As a special exception to the GNU General
...@@ -2311,8 +2315,6 @@ dnl Public License, this file may be distributed as part of a program ...@@ -2311,8 +2315,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 that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program. 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. # This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro # Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package) # because gettext's gettext.m4 (distributed in the automake package)
...@@ -2373,8 +2375,7 @@ dnl Usage: ...@@ -2373,8 +2375,7 @@ dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define]) dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN([AM_INIT_AUTOMAKE], 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] PACKAGE=[$1]
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)
VERSION=[$2] VERSION=[$2]
...@@ -2390,42 +2391,13 @@ AC_REQUIRE([AM_SANITY_CHECK]) ...@@ -2390,42 +2391,13 @@ AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM]) AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross. dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd` 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(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(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])]) 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. # Check to make sure that the build environment is sane.
# #
......
...@@ -50,7 +50,14 @@ GLIBCPP_3.2 { ...@@ -50,7 +50,14 @@ GLIBCPP_3.2 {
std::[A-Zd-k]*; std::[A-Zd-k]*;
std::length_error*; std::length_error*;
std::logic_error*; std::logic_error*;
std::locale::[A-Za-z]*; 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_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::_[A-Ra-z]*;
std::locale::_S_classic; std::locale::_S_classic;
std::locale::_S_global; std::locale::_S_global;
...@@ -100,6 +107,9 @@ GLIBCPP_3.2 { ...@@ -100,6 +107,9 @@ GLIBCPP_3.2 {
# std::locale destructors # std::locale destructors
_ZNSt6localeD*; _ZNSt6localeD*;
# std::locale::facet destructors
_ZNSt6locale5facetD*;
# std::codecvt<char> members. # std::codecvt<char> members.
_ZNKSt7codecvtIcc11__mbstate_tE*; _ZNKSt7codecvtIcc11__mbstate_tE*;
# std::codecvt<char>::~codecvt # std::codecvt<char>::~codecvt
...@@ -204,8 +214,6 @@ GLIBCPP_3.2.1 { ...@@ -204,8 +214,6 @@ GLIBCPP_3.2.1 {
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_; _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_;
_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_; _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_;
_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE;
# stub functions from libmath # stub functions from libmath
sinf; sinf;
sinl; sinl;
...@@ -242,6 +250,13 @@ GLIBCPP_3.2.1 { ...@@ -242,6 +250,13 @@ GLIBCPP_3.2.1 {
} GLIBCPP_3.2; } GLIBCPP_3.2;
GLIBCPP_3.2.2 {
_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE;
} GLIBCPP_3.2.1;
# Symbols in the support library (libsupc++) have their own tag. # Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.2 { CXXABI_1.2 {
......
// std::messages implementation details, generic version -*- C++ -*- // std::messages implementation details, generic version -*- 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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -35,6 +35,16 @@ ...@@ -35,6 +35,16 @@
// Non-virtual member functions. // Non-virtual member functions.
template<typename _CharT> template<typename _CharT>
messages<_CharT>::messages(size_t __refs)
: locale::facet(__refs)
{ _M_c_locale_messages = _S_c_locale; }
template<typename _CharT>
messages<_CharT>::messages(__c_locale __cloc, const char*, size_t __refs)
: locale::facet(__refs)
{ _M_c_locale_messages = _S_c_locale; }
template<typename _CharT>
typename messages<_CharT>::catalog typename messages<_CharT>::catalog
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char*) const const char*) const
...@@ -42,6 +52,10 @@ ...@@ -42,6 +52,10 @@
// Virtual member functions. // Virtual member functions.
template<typename _CharT> template<typename _CharT>
messages<_CharT>::~messages()
{ _S_destroy_c_locale(_M_c_locale_messages); }
template<typename _CharT>
typename messages<_CharT>::catalog typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>&, const locale&) const messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
{ return 0; } { return 0; }
...@@ -56,3 +70,12 @@ ...@@ -56,3 +70,12 @@
void void
messages<_CharT>::do_close(catalog) const messages<_CharT>::do_close(catalog) const
{ } { }
// messages_byname
template<typename _CharT>
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);
}
// std::time_get, std::time_put implementation, GNU version -*- C++ -*- // std::time_get, std::time_put implementation, generic version -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// //
......
// std::time_get, std::time_put implementation, generic version -*- C++ -*-
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.2.5.1.2 - time_get functions
// ISO C++ 14882: 22.2.5.3.2 - time_put functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
: locale::facet(__refs)
{
_M_name_timepunct = _S_c_name;
_M_initialize_timepunct();
}
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs)
: locale::facet(__refs)
{
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
_M_initialize_timepunct(__cloc);
}
template<typename _CharT>
__timepunct<_CharT>::~__timepunct()
{
if (_S_c_name != _M_name_timepunct)
delete [] _M_name_timepunct;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
// std::messages implementation details, GNU version -*- C++ -*- // std::messages implementation details, GNU version -*- 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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -28,13 +28,36 @@ ...@@ -28,13 +28,36 @@
// the GNU General Public License. // the GNU General Public License.
// //
// ISO C++ 14882: 22.2.7.1.2 messages virtual functions // ISO C++ 14882: 22.2.7.1.2 messages functions
// //
// Written by Benjamin Kosnik <bkoz@redhat.com> // Written by Benjamin Kosnik <bkoz@redhat.com>
// Non-virtual member functions. // Non-virtual member functions.
template<typename _CharT> 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;
}
template<typename _CharT>
messages<_CharT>::messages(__c_locale __cloc,
const char* __s __attribute__ ((__unused__)),
size_t __refs)
: locale::facet(__refs)
{
#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);
}
template<typename _CharT>
typename messages<_CharT>::catalog typename messages<_CharT>::catalog
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char* __dir) const const char* __dir) const
...@@ -43,6 +66,17 @@ ...@@ -43,6 +66,17 @@
return this->do_open(__s, __loc); return this->do_open(__s, __loc);
} }
// Virtual member functions.
template<typename _CharT>
messages<_CharT>::~messages()
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
if (_S_c_name != _M_name_messages)
delete [] _M_name_messages;
#endif
_S_destroy_c_locale(_M_c_locale_messages);
}
template<typename _CharT> template<typename _CharT>
typename messages<_CharT>::catalog typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __s, messages<_CharT>::do_open(const basic_string<char>& __s,
...@@ -58,3 +92,18 @@ ...@@ -58,3 +92,18 @@
void void
messages<_CharT>::do_close(catalog) const messages<_CharT>::do_close(catalog) const
{ } { }
// messages_byname
template<typename _CharT>
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);
}
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.2.5.1.2 - time_get functions
// ISO C++ 14882: 22.2.5.3.2 - time_put functions
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
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();
}
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc,
const char* __s __attribute__ ((__unused__)),
size_t __refs)
: locale::facet(__refs)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
#endif
_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)
delete [] _M_name_timepunct;
#endif
_S_destroy_c_locale(_M_c_locale_timepunct);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -324,6 +324,7 @@ target_headers_extra = \ ...@@ -324,6 +324,7 @@ target_headers_extra = \
${target_builddir}/c++io.h \ ${target_builddir}/c++io.h \
${target_builddir}/c++locale.h \ ${target_builddir}/c++locale.h \
${target_builddir}/messages_members.h \ ${target_builddir}/messages_members.h \
${target_builddir}/time_members.h \
${target_builddir}/codecvt_specializations.h ${target_builddir}/codecvt_specializations.h
thread_target_headers = \ thread_target_headers = \
...@@ -414,6 +415,7 @@ stamp-target: ${target_headers} ${target_headers_noinst} stamp-${target_alias} ...@@ -414,6 +415,7 @@ stamp-target: ${target_headers} ${target_headers_noinst} stamp-${target_alias}
@LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\ @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\ @LN_S@ ${glibcpp_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
@LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\ @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CTIME_H@ time_members.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\ @LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
echo `date` > stamp-target ; \ echo `date` > stamp-target ; \
fi fi
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@ DEBUG_FLAGS = @DEBUG_FLAGS@
...@@ -439,6 +440,7 @@ target_headers_extra = \ ...@@ -439,6 +440,7 @@ target_headers_extra = \
${target_builddir}/c++io.h \ ${target_builddir}/c++io.h \
${target_builddir}/c++locale.h \ ${target_builddir}/c++locale.h \
${target_builddir}/messages_members.h \ ${target_builddir}/messages_members.h \
${target_builddir}/time_members.h \
${target_builddir}/codecvt_specializations.h ${target_builddir}/codecvt_specializations.h
...@@ -646,6 +648,7 @@ stamp-target: ${target_headers} ${target_headers_noinst} stamp-${target_alias} ...@@ -646,6 +648,7 @@ stamp-target: ${target_headers} ${target_headers_noinst} stamp-${target_alias}
@LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\ @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\ @LN_S@ ${glibcpp_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
@LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\ @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CTIME_H@ time_members.h || true ;\
@LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\ @LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
echo `date` > stamp-target ; \ echo `date` > stamp-target ; \
fi fi
......
...@@ -1011,22 +1011,10 @@ namespace std ...@@ -1011,22 +1011,10 @@ namespace std
public: public:
explicit explicit
__timepunct(size_t __refs = 0) __timepunct(size_t __refs = 0);
: locale::facet(__refs)
{
_M_name_timepunct = new char[2];
strcpy(_M_name_timepunct, "C");
_M_initialize_timepunct();
}
explicit explicit
__timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0) __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
: locale::facet(__refs)
{
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
_M_initialize_timepunct(__cloc);
}
void void
_M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
...@@ -1123,11 +1111,7 @@ namespace std ...@@ -1123,11 +1111,7 @@ namespace std
protected: protected:
virtual virtual
~__timepunct() ~__timepunct();
{
delete [] _M_name_timepunct;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
// For use at construction time only. // For use at construction time only.
void void
...@@ -1169,6 +1153,8 @@ namespace std ...@@ -1169,6 +1153,8 @@ namespace std
template<typename _CharT> template<typename _CharT>
const _CharT* __timepunct<_CharT>::_S_timezones[14]; const _CharT* __timepunct<_CharT>::_S_timezones[14];
// Include host and configuration specific timepunct functions.
#include <bits/time_members.h>
template<typename _CharT, typename _InIter> template<typename _CharT, typename _InIter>
class time_get : public locale::facet, public time_base class time_get : public locale::facet, public time_base
...@@ -1628,32 +1614,17 @@ namespace std ...@@ -1628,32 +1614,17 @@ namespace std
// Underlying "C" library locale information saved from // Underlying "C" library locale information saved from
// initialization, needed by messages_byname as well. // initialization, needed by messages_byname as well.
__c_locale _M_c_locale_messages; __c_locale _M_c_locale_messages;
#if 1
// Only needed if glibc < 2.3
char* _M_name_messages; char* _M_name_messages;
#endif
public: public:
static locale::id id; static locale::id id;
explicit explicit
messages(size_t __refs = 0) messages(size_t __refs = 0);
: locale::facet(__refs)
{
_M_name_messages = new char[2];
strcpy(_M_name_messages, "C");
_M_c_locale_messages = _S_c_locale;
}
// Non-standard. // Non-standard.
explicit explicit
messages(__c_locale __cloc, const char* __s, size_t __refs = 0) messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
: locale::facet(__refs)
{
_M_name_messages = new char[strlen(__s) + 1];
strcpy(_M_name_messages, __s);
_M_c_locale_messages = _S_clone_c_locale(__cloc);
}
catalog catalog
open(const basic_string<char>& __s, const locale& __loc) const open(const basic_string<char>& __s, const locale& __loc) const
...@@ -1673,11 +1644,7 @@ namespace std ...@@ -1673,11 +1644,7 @@ namespace std
protected: protected:
virtual virtual
~messages() ~messages();
{
delete [] _M_name_messages;
_S_destroy_c_locale(_M_c_locale_messages);
}
virtual catalog virtual catalog
do_open(const basic_string<char>&, const locale&) const; do_open(const basic_string<char>&, const locale&) const;
...@@ -1751,9 +1718,6 @@ namespace std ...@@ -1751,9 +1718,6 @@ namespace std
messages<wchar_t>::do_get(catalog, int, int, const wstring&) const; messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
#endif #endif
// Include host and configuration specific messages virtual functions.
#include <bits/messages_members.h>
template<typename _CharT> template<typename _CharT>
class messages_byname : public messages<_CharT> class messages_byname : public messages<_CharT>
{ {
...@@ -1762,15 +1726,7 @@ namespace std ...@@ -1762,15 +1726,7 @@ namespace std
typedef basic_string<_CharT> string_type; typedef basic_string<_CharT> string_type;
explicit explicit
messages_byname(const char* __s, size_t __refs = 0) messages_byname(const char* __s, size_t __refs = 0);
: messages<_CharT>(__refs)
{
delete [] _M_name_messages;
_M_name_messages = new char[strlen(__s) + 1];
strcpy(_M_name_messages, __s);
_S_destroy_c_locale(_M_c_locale_messages);
_S_create_c_locale(_M_c_locale_messages, __s);
}
protected: protected:
virtual virtual
...@@ -1778,6 +1734,9 @@ namespace std ...@@ -1778,6 +1734,9 @@ namespace std
{ } { }
}; };
// Include host and configuration specific messages functions.
#include <bits/messages_members.h>
// Subclause convenience interfaces, inlines. // Subclause convenience interfaces, inlines.
// NB: These are inline because, when used in a loop, some compilers // NB: These are inline because, when used in a loop, some compilers
......
...@@ -264,7 +264,7 @@ namespace std ...@@ -264,7 +264,7 @@ namespace std
// The "C" reference locale // The "C" reference locale
static _Impl* _S_classic; static _Impl* _S_classic;
// Current global reference locale // Current global locale
static _Impl* _S_global; static _Impl* _S_global;
// Number of standard categories. For C++, these categories are // Number of standard categories. For C++, these categories are
...@@ -419,10 +419,12 @@ namespace std ...@@ -419,10 +419,12 @@ namespace std
_Atomic_word _M_references; _Atomic_word _M_references;
protected: protected:
// Contains data from the underlying "C" library for default "C" // Contains data from the underlying "C" library for the classic locale.
// or "POSIX" locale.
static __c_locale _S_c_locale; static __c_locale _S_c_locale;
// String literal for the name of the classic locale.
static char _S_c_name[2];
explicit explicit
facet(size_t __refs = 0) throw(); facet(size_t __refs = 0) throw();
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@ CXX = @CXX@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@ CXX = @CXX@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
......
# 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. # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
...@@ -84,6 +84,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -84,6 +84,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@ DEBUG_FLAGS = @DEBUG_FLAGS@
...@@ -163,11 +164,13 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ ...@@ -163,11 +164,13 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
# These bits are all figured out from configure. Look in acinclude.m4 # These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ CONFIG_CXXFLAGS = \
@EXTRA_CXX_FLAGS@ @SECTION_FLAGS@
# Warning flags to use. # Warning flags to use.
WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once WARN_CXXFLAGS = \
@WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
...@@ -175,16 +178,46 @@ GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ ...@@ -175,16 +178,46 @@ GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
INCLUDES = $(GCC_INCLUDES) $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES) INCLUDES = \
$(GCC_INCLUDES) $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES)
headers = exception new typeinfo cxxabi.h exception_defines.h
headers = \
exception new typeinfo cxxabi.h exception_defines.h
c_sources = cxa_demangle.c dyn-string.c
c_sources = \
sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_aux_runtime.cc eh_catch.cc eh_exception.cc eh_globals.cc eh_personality.cc eh_term_handler.cc eh_terminate.cc eh_throw.cc eh_type.cc eh_unex_handler.cc guard.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc vec.cc vterminate.cc cxa_demangle.c \
dyn-string.c
sources = \
del_op.cc \
del_opnt.cc \
del_opv.cc \
del_opvnt.cc \
eh_alloc.cc \
eh_aux_runtime.cc \
eh_catch.cc \
eh_exception.cc \
eh_globals.cc \
eh_personality.cc \
eh_term_handler.cc \
eh_terminate.cc \
eh_throw.cc \
eh_type.cc \
eh_unex_handler.cc \
guard.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc \
new_opv.cc \
new_opvnt.cc \
pure.cc \
tinfo.cc \
tinfo2.cc \
vec.cc \
vterminate.cc
libsupc___la_SOURCES = $(sources) $(c_sources) libsupc___la_SOURCES = $(sources) $(c_sources)
...@@ -198,11 +231,15 @@ LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS) ...@@ -198,11 +231,15 @@ LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS)
# Use special rules for pulling things out of libiberty. These # Use special rules for pulling things out of libiberty. These
# objects should be compiled with the "C" compiler, not the C++ # objects should be compiled with the "C" compiler, not the C++
# compiler, and also should not use the C++ includes. # compiler, and also should not use the C++ includes.
C_COMPILE = $(CC) $(DEFS) $(GCC_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) C_COMPILE = \
$(CC) $(DEFS) $(GCC_INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
# LTCOMPILE is copied from LTCXXCOMPILE below. # LTCOMPILE is copied from LTCXXCOMPILE below.
LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) $(DEFS) $(GCC_INCLUDES) $(LIBSUPCXX_PICFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) \
$(DEFS) $(GCC_INCLUDES) $(LIBSUPCXX_PICFLAGS) \
$(AM_CPPFLAGS) $(CPPFLAGS)
# AM_CXXFLAGS needs to be in each subdirectory so that it can be # AM_CXXFLAGS needs to be in each subdirectory so that it can be
...@@ -210,7 +247,12 @@ LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) $ ...@@ -210,7 +247,12 @@ LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) $
# set this option because CONFIG_CXXFLAGS has to be after # set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug) # as the occasion call for it. (ie, --enable-debug)
AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_CXXFLAGS = \
-fno-implicit-templates \
$(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
# libstdc++ libtool notes # libstdc++ libtool notes
...@@ -234,7 +276,9 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) ...@@ -234,7 +276,9 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
# #
# We have to put --tag disable-shared after --tag CXX lest things # We have to put --tag disable-shared after --tag CXX lest things
# CXX undo the affect of disable-shared. # CXX undo the affect of disable-shared.
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
--mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if # 3) We'd have a problem when building the shared libstdc++ object if
...@@ -243,7 +287,9 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=c ...@@ -243,7 +287,9 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=c
# course is problematic at this point. So, we get the top-level # course is problematic at this point. So, we get the top-level
# directory to configure libstdc++-v3 to use gcc as the C++ # directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver. # compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
--mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
CONFIG_HEADER = ../config.h CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
...@@ -284,7 +330,7 @@ DIST_COMMON = Makefile.am Makefile.in ...@@ -284,7 +330,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = gtar
GZIP_ENV = --best GZIP_ENV = --best
SOURCES = $(libsupc__convenience_la_SOURCES) $(libsupc___la_SOURCES) SOURCES = $(libsupc__convenience_la_SOURCES) $(libsupc___la_SOURCES)
OBJECTS = $(libsupc__convenience_la_OBJECTS) $(libsupc___la_OBJECTS) OBJECTS = $(libsupc__convenience_la_OBJECTS) $(libsupc___la_OBJECTS)
...@@ -408,7 +454,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) ...@@ -408,7 +454,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
awk ' { files[$$0] = 1; } \ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags: mostlyclean-tags:
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@ CXX = @CXX@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
......
...@@ -84,6 +84,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -84,6 +84,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@ DEBUG_FLAGS = @DEBUG_FLAGS@
...@@ -145,7 +146,7 @@ glibcpp_builddir = @glibcpp_builddir@ ...@@ -145,7 +146,7 @@ glibcpp_builddir = @glibcpp_builddir@
toolexecdir = @glibcpp_toolexecdir@ toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@ toolexeclibdir = @glibcpp_toolexeclibdir@
toolexeclib_LTLIBRARIES = libstdc++.la toolexeclib_LTLIBRARIES = libstdc++.la
@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_arg = -Wl,--version-script=libstdc++-symbol.ver @GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_arg = @GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@-Wl,--version-script=libstdc++-symbol.ver
@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@version_arg = @GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@version_arg =
# Compile flags that should be constant throughout the build, both for # Compile flags that should be constant throughout the build, both for
...@@ -154,11 +155,13 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ ...@@ -154,11 +155,13 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
# These bits are all figured out from configure. Look in acinclude.m4 # These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ CONFIG_CXXFLAGS = \
@EXTRA_CXX_FLAGS@ @SECTION_FLAGS@
# Warning flags to use. # Warning flags to use.
WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once WARN_CXXFLAGS = \
@WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
...@@ -168,33 +171,79 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ ...@@ -168,33 +171,79 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@ LIBIO_INCLUDES = @LIBIO_INCLUDES@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = -nostdinc++ $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES) INCLUDES = \
-nostdinc++ \
$(GLIBCPP_INCLUDES) \
$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
$(TOPLEVEL_INCLUDES)
# Source files linked in via configuration/make substitution for a # Source files linked in via configuration/make substitution for a
# particular target. # 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 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/make substitution for a # Source files linked in via configuration/make substitution for a
# particular target, but with ad hoc naming rules. # particular target, but with ad hoc naming rules.
target_sources_extra = basic_file.cc c++locale.cc target_sources_extra = \
basic_file.cc \
c++locale.cc
# Sources present in the src directory. # Sources present in the src directory.
sources = bitset.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 wstring-inst.cc ${target_sources} ${target_sources_extra} sources = \
bitset.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 \
wstring-inst.cc \
${target_sources} \
${target_sources_extra}
VPATH = $(top_srcdir)/src:$(top_srcdir) VPATH = $(top_srcdir)/src:$(top_srcdir)
libstdc___la_SOURCES = $(sources) libstdc___la_SOURCES = $(sources)
libstdc___la_LIBADD = $(top_builddir)/libmath/libmath.la @libio_la@ $(top_builddir)/libsupc++/libsupc++convenience.la libstdc___la_LIBADD = \
$(top_builddir)/libmath/libmath.la @libio_la@ \
$(top_builddir)/libsupc++/libsupc++convenience.la
libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD) libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = -version-info @libtool_VERSION@ ${version_arg} -lm @LIBUNWIND_FLAG@ libstdc___la_LDFLAGS = \
-version-info @libtool_VERSION@ ${version_arg} \
-lm @LIBUNWIND_FLAG@
# Use special rules for the deprecated source files so that they find # Use special rules for the deprecated source files so that they find
...@@ -206,7 +255,12 @@ GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include ...@@ -206,7 +255,12 @@ GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include
# set this option because CONFIG_CXXFLAGS has to be after # set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. # as the occasion call for it.
AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_CXXFLAGS = \
-fno-implicit-templates \
$(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
# libstdc++ libtool notes # libstdc++ libtool notes
...@@ -227,7 +281,8 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) ...@@ -227,7 +281,8 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
# attempt to infer which configuration to use # attempt to infer which configuration to use
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if # 3) We'd have a problem when building the shared libstdc++ object if
...@@ -236,7 +291,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $( ...@@ -236,7 +291,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(
# course is problematic at this point. So, we get the top-level # course is problematic at this point. So, we get the top-level
# directory to configure libstdc++-v3 to use gcc as the C++ # directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver. # compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
debugdir = debug debugdir = debug
......
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -449,6 +449,8 @@ namespace std ...@@ -449,6 +449,8 @@ namespace std
__c_locale __c_locale
locale::facet::_S_c_locale; locale::facet::_S_c_locale;
char locale::facet::_S_c_name[2];
locale::facet:: locale::facet::
~facet() { } ~facet() { }
......
...@@ -209,7 +209,10 @@ namespace std ...@@ -209,7 +209,10 @@ namespace std
: _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS) : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS)
{ {
// Initialize the underlying locale model. // Initialize the underlying locale model.
locale::facet::_S_create_c_locale(locale::facet::_S_c_locale, "C"); locale::facet::_S_c_name[0] = 'C';
locale::facet::_S_c_name[1] = '\0';
locale::facet::_S_create_c_locale(locale::facet::_S_c_locale,
locale::facet::_S_c_name);
_M_facets = new(&facet_vec) facet*[_M_facets_size]; _M_facets = new(&facet_vec) facet*[_M_facets_size];
for (size_t __i = 0; __i < _M_facets_size; ++__i) for (size_t __i = 0; __i < _M_facets_size; ++__i)
...@@ -220,7 +223,7 @@ namespace std ...@@ -220,7 +223,7 @@ namespace std
__i < _S_categories_size + _S_extra_categories_size; ++__i) __i < _S_categories_size + _S_extra_categories_size; ++__i)
{ {
_M_names[__i] = new (&facet_name[__i]) char[2]; _M_names[__i] = new (&facet_name[__i]) char[2];
strcpy(_M_names[__i], "C"); strcpy(_M_names[__i], locale::facet::_S_c_name);
} }
// This is needed as presently the C++ version of "C" locales // This is needed as presently the C++ version of "C" locales
......
...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@ ...@@ -85,6 +85,7 @@ CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@ CPP = @CPP@
CSTDIO_H = @CSTDIO_H@ CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@ DEBUG_FLAGS = @DEBUG_FLAGS@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment