X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Fsrc%2Flocale-inst.cc;fp=libstdc%2B%2B-v3%2Fsrc%2Flocale-inst.cc;h=0418c6fa0f18ce96c79a176faf36cbf9e3d166df;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=8f2c86381779e0f23eab04b87c5cfcf3f26a78c1;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 8f2c8638..0418c6fa 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -1,11 +1,12 @@ // Locale support -*- C++ -*- -// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +// 2009 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) +// Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, @@ -13,451 +14,348 @@ // 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. +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. -// 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. +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . // // ISO C++ 14882: 22.1 Locales // -#include -#include -#include -#include #include -namespace std -{ - // moneypunct, money_get, and money_put - template class moneypunct; - template class moneypunct; - template class moneypunct_byname; - template class moneypunct_byname; - template class money_get >; - template class money_put >; - -#ifdef _GLIBCPP_USE_WCHAR_T - template class moneypunct; - template class moneypunct; - template class moneypunct_byname; - template class moneypunct_byname; - template class money_get >; - template class money_put >; +// Instantiation configuration. +#ifndef C +# define C char +# define C_is_char #endif - // numpunct, numpunct_byname, num_get, and num_put - template class numpunct; - template class numpunct_byname; - template class num_get >; - template class num_put >; - template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, char, char, char, - long) const; +_GLIBCXX_BEGIN_NAMESPACE(std) + // moneypunct, money_get, and money_put + template class moneypunct; + template class moneypunct; + template struct __moneypunct_cache; + template struct __moneypunct_cache; + template class moneypunct_byname; + template class moneypunct_byname; +_GLIBCXX_BEGIN_LDBL_NAMESPACE + template class money_get >; + template class money_put >; template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, char, char, char, - unsigned long) const; + istreambuf_iterator + money_get >:: + _M_extract(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, string&) const; -#ifdef _GLIBCPP_USE_LONG_LONG template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, char, char, char, - long long) const; + istreambuf_iterator + money_get >:: + _M_extract(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, string&) const; template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, char, char, char, - unsigned long long) const; -#endif + ostreambuf_iterator + money_put >:: + _M_insert(ostreambuf_iterator, ios_base&, C, + const string_type&) const; template - ostreambuf_iterator - num_put >:: - _M_convert_float(ostreambuf_iterator, ios_base&, char, char, - double) const; + ostreambuf_iterator + money_put >:: + _M_insert(ostreambuf_iterator, ios_base&, C, + const string_type&) const; +_GLIBCXX_END_LDBL_NAMESPACE - template - ostreambuf_iterator - num_put >:: - _M_convert_float(ostreambuf_iterator, ios_base&, char, char, - long double) const; - -#ifdef _GLIBCPP_USE_WCHAR_T - template class numpunct; - template class numpunct_byname; - template class num_get >; - template class num_put >; + // numpunct, numpunct_byname, num_get, and num_put + template class numpunct; + template struct __numpunct_cache; + template class numpunct_byname; +_GLIBCXX_BEGIN_LDBL_NAMESPACE + template class num_get >; + template class num_put >; + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + long&) const; + + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + unsigned short&) const; + + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + unsigned int&) const; + + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + unsigned long&) const; + +#ifdef _GLIBCXX_USE_LONG_LONG + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + long long&) const; + + template + istreambuf_iterator + num_get >:: + _M_extract_int(istreambuf_iterator, istreambuf_iterator, + ios_base&, ios_base::iostate&, + unsigned long long&) const; +#endif template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, wchar_t, char, - char, long) const; + ostreambuf_iterator + num_put >:: + _M_insert_int(ostreambuf_iterator, ios_base&, C, + long) const; template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, wchar_t, char, - char, unsigned long) const; + ostreambuf_iterator + num_put >:: + _M_insert_int(ostreambuf_iterator, ios_base&, C, + unsigned long) const; -#ifdef _GLIBCPP_USE_LONG_LONG +#ifdef _GLIBCXX_USE_LONG_LONG template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, wchar_t, char, - char, long long) const; + ostreambuf_iterator + num_put >:: + _M_insert_int(ostreambuf_iterator, ios_base&, C, + long long) const; template - ostreambuf_iterator - num_put >:: - _M_convert_int(ostreambuf_iterator, ios_base&, wchar_t, char, - char, unsigned long long) const; + ostreambuf_iterator + num_put >:: + _M_insert_int(ostreambuf_iterator, ios_base&, C, + unsigned long long) const; #endif template - ostreambuf_iterator - num_put >:: - _M_convert_float(ostreambuf_iterator, ios_base&, wchar_t, char, - double) const; + ostreambuf_iterator + num_put >:: + _M_insert_float(ostreambuf_iterator, ios_base&, C, char, + double) const; template - ostreambuf_iterator - num_put >:: - _M_convert_float(ostreambuf_iterator, ios_base&, wchar_t, char, - long double) const; -#endif + ostreambuf_iterator + num_put >:: + _M_insert_float(ostreambuf_iterator, ios_base&, C, char, + long double) const; +_GLIBCXX_END_LDBL_NAMESPACE // time_get and time_put - template class __timepunct; - template class time_put >; - template class time_put_byname >; - template class time_get >; - template class time_get_byname >; - -#ifdef _GLIBCPP_USE_WCHAR_T - template class __timepunct; - template class time_put >; - template class time_put_byname >; - template class time_get >; - template class time_get_byname >; -#endif + template class __timepunct; + template struct __timepunct_cache; + template class time_put >; + template class time_put_byname >; + template class time_get >; + template class time_get_byname >; // messages - template class messages; - template class messages_byname; -#ifdef _GLIBCPP_USE_WCHAR_T - template class messages; - template class messages_byname; -#endif + template class messages; + template class messages_byname; // ctype - inline template class __ctype_abstract_base; - template class ctype_byname; -#ifdef _GLIBCPP_USE_WCHAR_T - inline template class __ctype_abstract_base; - template class ctype_byname; -#endif + inline template class __ctype_abstract_base; + template class ctype_byname; // codecvt - inline template class __codecvt_abstract_base; - template class codecvt_byname; -#ifdef _GLIBCPP_USE_WCHAR_T - inline template class __codecvt_abstract_base; - template class codecvt_byname; -#endif + inline template class __codecvt_abstract_base; + template class codecvt_byname; // collate - template class collate; - template class collate_byname; -#ifdef _GLIBCPP_USE_WCHAR_T - template class collate; - template class collate_byname; -#endif + template class collate; + template class collate_byname; // use_facet - // NB: use_facet is specialized - template - const codecvt& - use_facet >(const locale&); - template - const collate& - use_facet >(const locale&); - - template - const numpunct& - use_facet >(const locale&); - - template - const num_put& - use_facet >(const locale&); - - template - const num_get& - use_facet >(const locale&); + const ctype& + use_facet >(const locale&); template - const moneypunct& - use_facet >(const locale&); + const codecvt& + use_facet >(const locale&); template - const moneypunct& - use_facet >(const locale&); - - template - const money_put& - use_facet >(const locale&); - - template - const money_get& - use_facet >(const locale&); + const collate& + use_facet >(const locale&); template - const __timepunct& - use_facet<__timepunct >(const locale&); + const numpunct& + use_facet >(const locale&); template - const time_put& - use_facet >(const locale&); + const num_put& + use_facet >(const locale&); template - const time_get& - use_facet >(const locale&); + const num_get& + use_facet >(const locale&); - template - const messages& - use_facet >(const locale&); - -#ifdef _GLIBCPP_USE_WCHAR_T template - const codecvt& - use_facet >(locale const&); + const moneypunct& + use_facet >(const locale&); template - const collate& - use_facet >(const locale&); - - template - const numpunct& - use_facet >(const locale&); + const moneypunct& + use_facet >(const locale&); template - const num_put& - use_facet >(const locale&); + const money_put& + use_facet >(const locale&); template - const num_get& - use_facet >(const locale&); - - template - const moneypunct& - use_facet >(const locale&); + const money_get& + use_facet >(const locale&); template - const moneypunct& - use_facet >(const locale&); - - template - const money_put& - use_facet >(const locale&); + const __timepunct& + use_facet<__timepunct >(const locale&); template - const money_get& - use_facet >(const locale&); - - template - const __timepunct& - use_facet<__timepunct >(const locale&); + const time_put& + use_facet >(const locale&); template - const time_put& - use_facet >(const locale&); + const time_get& + use_facet >(const locale&); template - const time_get& - use_facet >(const locale&); - - template - const messages& - use_facet >(const locale&); -#endif + const messages& + use_facet >(const locale&); // has_facet template bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet<__timepunct >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet<__timepunct >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); - -#ifdef _GLIBCPP_USE_WCHAR_T - template - bool - has_facet >(const locale&); + has_facet >(const locale&); template bool - has_facet >(const locale&); + has_facet >(const locale&); - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet<__timepunct >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); - - template - bool - has_facet >(const locale&); -#endif - - // locale - template - char* - __add_grouping(char*, char, char const*, char const*, - char const*, char const*); - - template - bool - __verify_grouping(const basic_string&, basic_string&); - - template class __pad >; - -#ifdef _GLIBCPP_USE_WCHAR_T - template - wchar_t* - __add_grouping(wchar_t*, wchar_t, char const*, char const*, - wchar_t const*, wchar_t const*); - template - bool - __verify_grouping(const basic_string&, - basic_string&); - - template class __pad >; -#endif - - template - int - __convert_from_v(char*, const int, const char*, double, - const __c_locale&, int); + // locale functions. template - int - __convert_from_v(char*, const int, const char*, long double, - const __c_locale&, int); + C* + __add_grouping(C*, C, char const*, size_t, + C const*, C const*); - template - int - __convert_from_v(char*, const int, const char*, long, - const __c_locale&, int); + template class __pad >; template int - __convert_from_v(char*, const int, const char*, unsigned long, - const __c_locale&, int); + __int_to_char(C*, unsigned long, const C*, + ios_base::fmtflags, bool); +#ifdef _GLIBCXX_USE_LONG_LONG template int - __convert_from_v(char*, const int, const char*, long long, - const __c_locale&, int); + __int_to_char(C*, unsigned long long, const C*, + ios_base::fmtflags, bool); +#endif - template - int - __convert_from_v(char*, const int, const char*, unsigned long long, - const __c_locale&, int); -} // namespace std +_GLIBCXX_END_NAMESPACE + +// XXX GLIBCXX_ABI Deprecated +#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined C_is_char + +#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ + extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak)) + +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, + _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES3_S3_RSt8ios_basecT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES4_S4_RSt8ios_basecT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES4_S4_RSt8ios_basecT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES3_S3_RSt8ios_basecT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES4_S4_RSt8ios_basecT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES3_S3_RSt8ios_basecT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES4_S4_RSt8ios_baseccT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_, + _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIeEES3_S3_RSt8ios_baseccT_); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs, + _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs, + _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES4_S4_RSt8ios_basecRKSs, + _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES3_S3_RSt8ios_basecRKSs); +_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES4_S4_RSt8ios_basecRKSs, + _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES3_S3_RSt8ios_basecRKSs); + +#endif // _GLIBCXX_LONG_DOUBLE_COMPAT