Gcc 3.2.1-prerelease libf2c bits from the FSF anoncvs repo gcc-3_2-branch on 1-Sep-2002 00:00:01 EDT.

This commit is contained in:
Alexander Kabaev 2002-09-01 20:39:13 +00:00
parent bb3c979bf5
commit ca6500fcd0
130 changed files with 10356 additions and 3730 deletions

View File

@ -1,3 +1,913 @@
2002-08-26 Phil Edwards <pme@gcc.gnu.org>
* Makefile.am (check-abi): Specify current directory.
* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Fix shell syntax, use
abi_baseline_triplet in baseline_file.
* Makefile.in, aclocal.m4, configure: Regenerate.
* configure.target: Add abi_baseline_triplet with default.
* testsuite/abi_check.cc: More error checking.
2002-08-25 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Set
GLIBCPP_BUILD_ABI_CHECK based on cross compiling, build, host
variables.
* aclocal.m4: Regenerate.
* testsuite/Makefile.am (noinst_PROGRAMS): Make conditional on
native compiling.
* testsuite/Makefile.in: Regenerate.
2002-08-22 Benjamin Kosnik <bkoz@redhat.com>
Phil Edwards <pme@gcc.gnu.org>
Ulrich Drepper <drepper@redhat.com>
* Makefile.am (check-abi): New rule.
* Makefile.in: Regenerate.
* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Export baseline_file.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* testsuite/Makefile.am (noinst_PROGRAMS): Add abi_check.
(abi_check_SOURCES): Add.
* testsuite/Makefile.in: Regenerate.
* testsuite/abi_check.cc: New file.
* config/abi: Add.
* config/abi/i686-pc-linux-gnu: Add.
* config/abi/i686-pc-linux-gnu/baseline_symbols.txt: New file.
2002-08-19 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (libtool_VERSION): Update to 5:1:0.
* configure: Regenerate.
2002-08-15 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (stdio_filebuf): Explicitly set
_M_buf_size_opt to zero when unbuffering.
* include/bits/fstream.tcc (filebuf::showmanyc): Simplify.
Consistency checks for _M_buf_size_opt.
Revert PR libstdc++/7445
* src/locale.cc (locale::classic): Revert.
* docs/html/17_intro/TODO: Add.
2002-08-15 Danny Smith <dannysmith@users.sourceforge.net>
Benjamin Kosnik <bkoz@redhat.com>
* include/bits/istream.tcc (basic_istream::ignore): Use sbumpc,
not snextc.
* testsuite/27_io/narrow_stream_objects.cc (test10): Add.
2002-08-15 Danny Smith <dannysmith@users.sourceforge.net>
* config/os/newlib/ctype_inline.h (is): Don't offset _M_table.
(scan_is): Use this->is.
(scan_not): Likewise.
2002-08-15 Rick Danos <rdanos@hotmail.com>
PR libstdc++/7461
* config/os/newlib/ctype_noninline.h (classic_table): Add offset.
* config/os/newlib/ctype_inline.h (is): Use static_cast.
2002-08-14 Release Manager
* GCC 3.2 Released.
2002-08-06 Benjamin Kosnik <bkoz@redhat.com>
Revert PR libstdc++/6594
* src/strstream.cc (strstreambuf): Revert.
(strstreambuf::overflow): Same.
(strstreambuf::~strstreambuf): Same.
* testsuite/backward/strstream_members.cc (test02): Add.
* testsuite/19_diagnostics/stdexceptions.cc (test04): Add bool test.
2002-08-01 Benjamin Kosnik <bkoz@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* config/linker-map.gnu: Change CXXABI_1 to CXXABI_1.2,
GLIBCPP_3.1 to GLIBCPP_3.2.
2002-07-31 Benjamin Kosnik <bkoz@redhat.com>
Mark Mitchell <mark@codesourcery.com>
PR libstdc++/7442
* libsupc++/cxxabi.h (class __base_class_type_info::hwm_bit):
Change to __hwm_bit.
(__class_type_info): And here.
2002-07-31 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7442
* libsupc++/cxxabi.h
(__base_class_info): Change to __base_class_type_info. 2.9.5p6c
(__base_class_info::__base): Change to __base_type. 2.9.5p6c
(__base_class_info::offset_shift): Change to __offset_shift. 2.9.5p6c
(__vmi_class_type_info::__base_info): Don't make const, of type
__base_class_type_info, as per 2.9.5p6c
(__pbase_type_info::__qualifier_flags): Change to __flags, as per
2.9.5p7.
(__pbase_type_info::__qualifier_masks): Change to __masks, as per
2.9.5p7.
(__pointer_to_member_type_info::__context_class): Change member to
__context, as per 2.9.5p9.
* libsupc++/tinfo2.cc (__pointer_catch): Change __context_class to
__context.
* libsupc++/tinfo2.cc (__do_catch): Change __qualifier_flags to
__flags.
* libsupc++/tinfo.cc (__do_find_public_src): Change __base to
__base_type.
* libsupc++/tinfo.cc (__do_dyncast): Same.
* libsupc++/tinfo.cc (__do_upcast): Same.
2002-07-31 Simon Whomsley <whomsley@avacadcam.com>
* docs/html/22_locale/howto.html: Fix.
2002-07-31 Alex Kompel <shurik@sequoiap.com>
PR libstdc++/7445
* src/locale.cc (locale::classic): Move locks inside !_S_classic
block.
2002-07-30 Benjamin Kosnik <bkoz@redhat.com>
Gabriel Dos Reis <gdr@nerim.net>
* include/bits/char_traits.h: Remove generic definitions.
* include/bits/streambuf_iterator.h (istreambuf_iterator): Use
eof, not -2.
* include/bits/istream.tcc (istream::readsome): Don't check
against eof, instead use constants.
(istream::sync): Same.
(istream::sentry::sentry): Use eq_int_type.
(istream::get): Same.
* include/bits/ostream.tcc: Change __pad to
__pad<_CharT, _Traits>::_S_pad.
* include/bits/locale_facets.h: Add __pad_traits generic and
ostreambuf_iterator specialization.
* include/bits/locale_facets.tcc: Change __pad into struct __pad
with a _CharT and _Traits template parameter and _S_pad static
member function.
* src/locale-inst.cc: Update __pad instantiations.
* include/std/std_fstream.h: Declare _M_underflow_common
specializations.
* src/fstream.cc: New. Add _M_underflow_common specializations.
* include/bits/fstream.tcc (filebuf::close): Use traits_type.
(filebuf::_M_underflow_common(bool)): Remove generic version, as
sys_ungetc and custom int_types don't get along.
* include/std/std_streambuf.h: Add _M_pos.
* src/Makefile.am (sources): Add fstream.cc.
* src/Makefile.in: Regenerate.
* testsuite/21_strings/capacity.cc: Add char_traits specializations.
* testsuite/22_locale/codecvt_members_unicode_char.cc: Same.
* testsuite/22_locale/codecvt_members_unicode_wchar_t.cc: Same.
* testsuite/22_locale/ctor_copy_dtor.cc: Same.
* testsuite/27_io/filebuf_virtuals.cc (test07): Move to...
* testsuite/27_io/filebuf.cc: ...here.
* testsuite/testsuite_hooks.h: Add gnu_char, gnu_int, char_traits
specialization for both.
* testsuite/27_io/streambuf.cc: Add instantiation test,
testsuite_hooks include.
* testsuite/27_io/istream.cc: Same.
* testsuite/27_io/ostream.cc: Same.
* testsuite/27_io/fstream.cc: Same.
* testsuite/27_io/stringstream.cc: Same.
* testsuite/27_io/filebuf.cc: Same.
* testsuite/27_io/stringbuf.cc: Same.
2002-07-26 Phil Edwards <pme@gcc.gnu.org>
* libsupc++/new (placement delete): Remove unused paramater names.
2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7216
* include/std/std_istream.h (basic_iostream): Add typedefs for
char_type, int_type, pos_type, off_type, and traits_type.
* testsuite/27_io/iostream.cc (test01): Add typedef tests.
* testsuite/27_io/istream.cc: Same.
* testsuite/27_io/ostream.cc: Same.
* testsuite/27_io/filebuf.cc: Same.
* testsuite/27_io/stringbuf.cc: Replace content, move to...
* testsuite/27_io/stringbuf_members.cc: ...here.
* testsuite/27_io/streambuf.cc: Replace content, move to...
* testsuite/27_io/streambuf_members.cc: ...here.
* testsuite/27_io/stringstream.cc: Replace content, move to...
* testsuite/27_io/stringstream_members.cc: ...here.
* testsuite/27_io/ios.cc: New file.
* testsuite/27_io/fstream.cc: New file.
* testsuite/27_io/ifstream.cc: New file.
* testsuite/27_io/ofstream.cc: New file.
* testsuite/27_io/istringstream.cc: New file.
* testsuite/27_io/ostringstream.cc: New file.
2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7220
* include/bits/istream.tcc (istream::ignore): Don't extract on
zero.
* testsuite/27_io/istream_unformatted.cc (test10): Add.
2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7222
* src/locale.cc (locale::locale(const char*)): Use setlocale NULL.
* testsuite/22_locale/ctor_copy_dtor.cc (test02): New.
2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7286
* libsupc++/new: Add placement delete.
* testsuite/18_support/new_delete_placement.cc: New.
2002-07-07 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/7186
* include/bits/stl_deque.h (_Deque_iterator::operator-):
Make non-member, as already happens for the comparison
operators in accord with DR179 (Ready).
* testsuite/23_containers/deque_operators.cc: Add test02.
2002-07-04 Benjamin Kosnik <bkoz@redhat.com>
Jack Reeves <jackw_reeves@hotmail.com>
* include/std/std_streambuf.h (basic_streambuf::_M_buf): Change to
size_t, from int_type.
(basic_streambuf::_M_buf_size_opt): Same.
(basic_streambuf::_S_pback_sizex): Same.
* include/bits/streambuf.tcc: Same.
* include/std/std_streambuf.h (basic_streambuf::snextc): Use
eq_int_type.
(basic_streambuf::uflow): Same.
* include/bits/sstream.tcc (basic_stringbuf::overflow): Use
to_char_type.
* include/bits/basic_ios.tcc (basic_ios::init): Use _CharT().
* include/bits/streambuf.tcc (basic_streambuf::xsgetn): Use
eq_int_type.
(basic_streambuf::xsputn): Same.
(__copy_streambufs): Same.
2002-07-02 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/6642
* include/bits/stl_iterator.h
(__normal_iterator::operator-(const __normal_iterator&)):
Make non-member, as already happens for the comparison
operators in accord with DR179 (Ready).
* testsuite/24_iterators/iterator.cc: Add test from the PR.
2002-07-02 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6410
* include/bits/locale_facets.h (moneypunct::moneypunct): Add const
char* name parameter.
* config/locale/gnu/monetary_members.cc: Use it.
* config/locale/generic/monetary_members.cc: Same.
* src/localename.cc (_Impl::_Impl(const char*, size_t)): Use it.
2002-07-01 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (libtool_VERSION): Bump to 5:0:0.
* configure: Regenerate.
2002-05-19 Paolo Carlini <pcarlini@unitus.it>
* testsuite/23_containers/deque_operators.cc (test01):
Fix minor typo in last commit.
2002-05-18 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/6503
* include/bits/stl_deque.h (_Deque_iterator::operator==,
operator!=, operator<, operator>, operator>=, operator<=):
Make non-member functions, to allow comparing const and
non-const iterators in any order.
* testsuite/23_containers/deque_operators.cc: New testfile.
2002-07-25 Release Manager
* GCC 3.1.1 Released.
2002-07-20 Phil Edwards <pme@gcc.gnu.org>
Bulk documentation merge (copy) from trunk.
* docs/doxygen/TODO, docs/doxygen/run_doxygen, docs/doxygen/tables.html,
docs/doxygen/user.cfg.in, docs/html/Makefile,
docs/html/documentation.html, docs/html/17_intro/porting.html,
docs/html/17_intro/porting.texi, docs/html/23_containers/howto.html,
docs/html/ext/howto.html, docs/html/ext/lwg-active.html,
docs/html/ext/lwg-defects.html, docs/html/faq/index.html,
docs/html/faq/index.txt: Merge from trunk.
2002-07-16 Andreas Schwab <schwab@suse.de>
* libsupc++/new (set_new_handler): Declare to not throw any
exceptions.
* libsupc++/new_handler.cc (set_new_handler): Likewise.
2002-07-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/os/solaris/solaris2.5/bits/ctype_base.h (ctype_base): Fix
print to match vendor <ctype.h>.
2002-07-03 Steev Wilcox <steev@paradigmds.com>
PR libstdc++/7057
* include/ext/stl_hashtable.h: Fix.
* testsuite/ext/hash_map.cc: New.
2002-07-03 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7097
* include/c/std_cwchar.h: Fix.
2002-07-03 Jack Reeves <jackw_reeves@hotmail.com>
Kenny Simpson <theonetruekenny@yahoo.com>
Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/3946
* testsuite/20_util/auto_ptr.cc (test08): New test.
* include/std/std_memory.h (auto_ref_ptr): Make constructor explicit.
(auto_ptr::operator auto_ptr_ref): Fix typo.
General reformatting and doxygenating of the whole file.
2002-07-03 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/7173
* acinclude.m4: Simplify determination of gcc_version, and move
up to GLIBCPP_CONFIGURE.
* configure.in (release_VERSION): Really remove.
(AM_INIT_AUTOMAKE, AM_CONFIG_HEADER): Move after GLIBCPP_CONFIGURE.
* aclocal.m4, configure: Regenerate.
2002-07-02 Phil Edwards <pme@gcc.gnu.org>
* docs/html/configopts.html, docs/html/install.html: Tweaks.
* include/ext/algorithm, include/ext/hash_map, include/ext/hash_set,
include/ext/iterator, include/ext/numeric, include/ext/rb_tree,
include/ext/slist, include/ext/stl_rope.h: Add doxygen hooks.
2002-06-28 Benjamin Kosnik <bkoz@redhat.com>
* include/c_compatibility: New.
* include/c_compatibility/assert.h: New.
* include/c_compatibility/ctype.h: New.
* include/c_compatibility/errno.h: New.
* include/c_compatibility/float.h: New.
* include/c_compatibility/iso646.h: New.
* include/c_compatibility/limits.h: New.
* include/c_compatibility/locale.h: New.
* include/c_compatibility/math.h: New.
* include/c_compatibility/setjmp.h: New.
* include/c_compatibility/signal.h: New.
* include/c_compatibility/stdarg.h: New.
* include/c_compatibility/stddef.h: New.
* include/c_compatibility/stdio.h: New.
* include/c_compatibility/stdlib.h: New.
* include/c_compatibility/string.h: New.
* include/c_compatibility/time.h: New.
* include/c_compatibility/wchar.h: New.
* include/c_compatibility/wctype.h: New.
* include/c/std_cerrno.h: Get out of the way... define errno.
* include/c/std_cmath.h: Add abs, modf overloads.
Undefine C99 isms. Still not sure how to deal with this sanely.
* include/c/std_csetjmp.h: Tweak.
* include/c/std_cwchar.h: Include cstddef for size_t.
* include/c_std/std_cmath.h: Remove extra function.
Pendantic std usage in testsuites.
* testsuite/17_intro/header_cstdlib.cc (test01): Qualify ldiv_t
with std.
* testsuite/17_intro/header_cwchar.cc: Tweak.
* testsuite/22_locale/codecvt_members_char_char.cc (test03): Use
std::setlocale.
* testsuite/22_locale/ctype_to_wchar_t.cc (test05): Same.
* testsuite/22_locale/ctype_to_char.cc (test05): Same.
* testsuite/22_locale/ctype_is_wchar_t.cc (test05): Same.
* testsuite/22_locale/ctype_is_char.cc (test05): Same.
* testsuite/22_locale/codecvt_members_wchar_t_char.cc (test03): Same.
* testsuite/22_locale/time_get_members_wchar_t.cc (test08): Same.
* testsuite/22_locale/time_get_members_char.cc (test08): Same.
* testsuite/22_locale/time_put_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/time_put_members_char.cc (test04): Same.
* testsuite/22_locale/num_put_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/num_put_members_char.cc (test04): Same.
* testsuite/22_locale/numpunct_members_wchar_t.cc (test03): Same.
* testsuite/22_locale/numpunct_members_char.cc (test03): Same.
* testsuite/22_locale/num_get_members_wchar_t.cc: Same.
* testsuite/22_locale/num_get_members_char.cc: Same.
* testsuite/22_locale/money_put_members_wchar_t.cc (test07): Same.
* testsuite/22_locale/money_put_members_char.cc (test07): Same.
* testsuite/22_locale/moneypunct_members_wchar_t.cc (test03): Same.
* testsuite/22_locale/moneypunct_members_char.cc (test03): Same.
* testsuite/22_locale/money_get_members_wchar_t.cc (test08): Same.
* testsuite/22_locale/money_get_members_char.cc (test08): Same.
* testsuite/22_locale/messages_members_char.cc (test03): Same.
* testsuite/22_locale/collate_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/collate_members_char.cc (test04): Same.
* testsuite/26_numerics/fabs_inline.cc: Use std::printf.
* testsuite/27_io/istream_seeks.cc (test02): Qualify abort.
* testsuite/27_io/istream_extractor_arith.cc (test11): Qualify strtol.
2002-06-28 Benjamin Kosnik <bkoz@redhat.com>
* libsupc++/Makefile.am (libsupc__convenience_la_SOURCES): Add
c_sources.
2002-06-28 Benjamin Kosnik <bkoz@redhat.com>
* src/ext-inst.cc (__gnu_cxx): Use instead of std:: for extensions.
Use size_type instead of unsigned long.
2002-06-28 Steve Ellcey <sje@cup.hp.com>
* src/ext-inst.cc (_S_fetch): Add explicit templates for char and
wchar types.
(_S_min_len): Ditto.
2002-06-28 Benjamin Kosnik <bkoz@redhat.com>
* include/Makefile.am: Add rules.
* include/Makefile.in: Regenerate.
* acinclude.m4: Define GLIBCPP_C_HEADERS_COMPATIBILITY.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.target (c_model, c_compatibility): Add.
* libsupc++/Makefile.am (c_sources): New.
(libsupc___la_SOURCES): Add c_sources.
(LTCOMPILE): Remove INCLUDES.
(GCC_INCLUDES): New.
(C_COMPILE): New, like COMPILE but without INCLUDES.
(cxa_demangle.o): Use C_COMPILE.
(dyn-string.o): Use C_COMPILE.
* include/c/std_cstdarg.h: Define __need___va_list.
* include/c/std_cstddef.h: Define need_size_t, need_ptrdiff_t,
need_NULL, need_offsetof.
2002-06-28 Benjamin Kosnik <bkoz@redhat.com>
* include/c/std_cwchar.h: Guard. Add mbstate_t bits.
* include/c/std_cwctype.h: Guard.
* libsupc++/eh_alloc.cc: Tweak include order.
* libsupc++/pure.cc: Use cstdio.
* libsupc++/new_op.cc: Remove malloc forward declaration, as
cstdlib brings it in. Use std::malloc.
* src/Makefile.am (sources): Remove cmath.cc.
* src/Makefile.in: Regenerate.
* src/cmath.cc: Remove.
2002-06-27 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (INTERFACE): Remove.
(release_VERSION): Remove.
* acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Change include placement.
(libstdcxx_interface): Change. Use gcc methods to determine version.
* configure: Regenerate.
* aclocal.m4: Regenerate.
2002-06-27 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4: Fix last checkin.
* aclocal.m4: Regenerate.
* configure: Regenerate.
2002-06-25 DJ Delorie <dj@redhat.com>
* acinclude.m4 (GLIBCPP_CONFIGURE): Split out
GLIBCPP_TOPREL_CONFIGURE.
* aclocal.m4: Likewise.
* configure.in: Call it before AC_CANONICAL_SYSTEM.
* configure: Regenerate.
2002-06-20 David Edelsohn <edelsohn@gnu.org>
* configure.target (CPULIMITSH): Use powerpc directory for rs6000.
2002-06-14 J.T. Conklin <jtc@acorntoolworks.com>
* configure.in (target_alias): Fix.
* configure: Regenerate.
* aclocal.m4: Regenerate.
2002-06-11 J.T. Conklin <jtc@acorntoolworks.com>
Benjamin Kosnik <bkoz@redhat.com>
* configure.target: Set os_include_dir to config/os/qnx/qnx6.1
under *-qnx6.[12]*.
* configure.in: Add support for *-qnx6.[12]*.
* configure: Regenerate.
* config/os/qnx, config/os/qnx/qnx6.1, config/os/qnx/qnx6.1/bits:
New directories.
* config/os/qnx/qnx6.1/bits/ctype_base.h, ctype_inline.h,
ctype_noninline.h, os_defines.h: New files.
2002-06-10 Steve Ellcey <sje@cup.hp.com>
* src/locale-inst.cc (__codecvt_abstract_base):
Put inside _GLIBCPP_USE_WCHAR_T ifdef.
* include/bits/istream.tcc (basic_istream): Ditto.
(ws) Ditto.
(operator>>) Ditto.
* include/bits/ostream.tcc (basic_ostream): Ditto.
(endl): Ditto.
(ends): Ditto.
(flush): Ditto.
(operator<<): Ditto.
2002-06-08 Paolo Carlini <pcarlini@unitus.it>
* testsuite/backwards/strstream_members.cc: New.
2002-06-08 Benjamin Kosnik <bkoz@redhat.com>
* include/backwards/strstream: Format.
* src/strstream.cc: Format.
2002-06-08 Andreas Schwab <schwab@suse.de>
* src/strstream.cc (strstreambuf::overflow): Set _M_buf,
_M_buf_size and _M_buf_size_opt to the new buffer and size.
2002-06-08 Benjamin Kosnik <bkoz@redhat.com>
* config/os/generic/bits/ctype_noninline.h: Tweak format.
2002-06-05 David Edelsohn <edelsohn@gnu.org>
* config/os/aix/bits/ctype_noninline.h (do_toupper,do_tolower):
Call external symbol.
2002-06-05 Paolo Carlini <pcarlini@unitus.it>
* testsuite/22_locale/money_get_members_char.cc
(test02): Add decimal point to long double constants.
* testsuite/22_locale/money_get_members_wchar_t.cc
(test02): Likewise.
* testsuite/22_locale/money_put_members_char.cc
(test02, test03, test06): Likewise.
* testsuite/22_locale/money_put_members_wchar_t.cc:
(test02, test03, test06): Likewise.
* testsuite/22_locale/num_get_members_char.cc:
(test02, test01): Likewise; suffix long long constants with LL.
* testsuite/22_locale/num_get_members_wchar_t.cc:
(test02, test01): Likewise.
* testsuite/22_locale/num_put_members_char.cc:
(test02, test01): Likewise.
* testsuite/22_locale/num_put_members_wchar_t.cc:
(test02, test01): Likewise.
2002-06-04 Paolo Carlini <pcarlini@unitus.it>
Gaby Dos Reis <gdr@codesourcery.com>
* include/bits/basic_string.tcc
(basic_string::_S_construct(forward_iterator_tag):
Fix typo in null pointer check.
* testsuite/21_strings/ctor_copy_dtor.cc: Add test04.
2002-06-03 Marc Espie <espie@openbsd.org>
* config/cpu/m68k/bits/atomicity.h(__exchange_and_add): Fix inline
assembly for old assemblers.
2002-05-31 Marcus Meissner <meissner@suse.de>
PR libstdc++/6886
* include/bits/stl_bvector.h: Use UL suffix for unsigned longs.
* testsuite/23_containers/vector_bool.cc (test02): New test.
2002-05-31 John David Anglin <dave@hiauly1.hia.nrc.ca>
* config/os/gnu-linux/bits/os_defines.h (__glibcpp_long_bits): Define
to 64 for hppa 64-bit port.
(__glibcpp_long_double_bits): Define to 64 for all hppa ports.
2002-05-30 Marc Espie <espie@openbsd.org>
* configure.in: Always check for sys/types.h.
* configure: Regenerate.
2002-05-28 Nick Clifton <nickc@cambridge.redhat.com>
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init):
Rebuild the wrapper file every time this proc is called.
2002-05-28 Loren J. Rittle <ljrittle@acm.org>
libstdc++/6641
* include/bits/c++config (__USE_MALLOC): Report case where
the user improperly defined it on the command line.
2002-05-27 Benjamin Kosnik <bkoz@redhat.com>
* src/misc-inst.cc: Define unnecessary algorithm
instantiations. Break apart instantiations into groupings below.
* src/fstream-inst.cc: New.
* src/io-inst.cc: New.
* src/istream-inst.cc: New.
* src/ostream-inst.cc: New.
* src/streambuf-inst.cc: New.
* src/sstream-inst.cc: New.
* src/Makefile.am (sources): Add files.
* src/Makefile.in: Regenerate.
* acinclude.m4: Work around automake 1.4-p5 bug, change
AM_GNU_GETTEXT in comments to AM-GNU-GETTEXT.
2002-05-27 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6795.
* config/os/solaris/solaris2.6/bits/ctype_noninline.h
(classic_table): Fix.
* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
2002-05-27 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/22_locale/ctype_is_wchar_t.cc: Guard with
_GLIBCPP_USE_WCHAR_T.
* testsuite/22_locale/ctype_narrow_wchar_t.cc: Same.
* testsuite/22_locale/ctype_to_wchar_t.cc: Same.
* testsuite/22_locale/ctype_widen_wchar_t.cc: Same.
2002-05-26 Carlo Wood <carlo@alinoe.com>
Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/6811
* config/locale/ieee_1003.1-2001/codecvt_specializations.h
(__enc_traits::operator=): add missing return statement.
2002-05-24 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/6282
* include/std/std_bitset.h (_Base_biteset<0>): New specialization.
(operator>>): If nothing was extracted, don't fail in the
zero-length case.
* testsuite/23_containers/bitset_ctor.cc (test02): New test.
2002-05-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6701
* testsuite/22_locale/ctype_narrow_char.cc: New.
* testsuite/22_locale/ctype_narrow_wchar_t.cc: New.
* testsuite/22_locale/ctype_widen_char.cc: New.
* testsuite/22_locale/ctype_widen_wchar_t.cc: New.
* testsuite/22_locale/ctype_members_char.cc: Move some bits into...
* testsuite/22_locale/ctype_is_char.cc: ...this.
* testsuite/22_locale/ctype_to_char.cc: ...and this.
* testsuite/22_locale/ctype_members_wchar_t.cc: Move some bits into...
* testsuite/22_locale/ctype_is_wchar_t.cc: ...this.
* testsuite/22_locale/ctype_to_wchar_t.cc: ...and this.
* testsuite/22_locale/ctype_scan_wchar_t.cc: Should pass.
2002-05-24 Dale Peakall <dale@peakall.net>
PR libstdc++/6701
* config/locale/gnu/ctype_members.cc (ctype<wchar_t>::do_narrow): Fix.
* config/locale/generic/ctype_members.cc: Same.
2002-05-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6750
* include/bits/ostream.tcc (ostream::operator<<(const char*)): Fix
for empty string literal.
(ostream::operator<<(const _CharT*)): Same.
(ostream<char>::operator<<(const char*)): Same.
(ostream<char>::operator<<(streambuf*)): Same.
* testsuite/27_io/ostream_inserter_char.cc (test08): Add tests.
* testsuite/27_io/ostream_inserter_other.cc (test02): Modify.
2002-05-23 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* configure.in: Update local install.html, configopts.html paths.
* configure: Regenerate.
* testsuite/testsuite_hooks.h (__set_testsuite_memlimit): Retrieve
current limits before setting.
* acinclude.m4 (enable_symvers): Quote $LD.
* aclocal.m4: Regenerate.
* configure: Likewise.
Fixes PR target/6755.
2002-05-23 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (release_VERSION): Update to 3.1.1.
(libtool_VERSION): Update to 4:1:0.
* configure: Regenerate.
2002-05-21 Phil Edwards <pme@gcc.gnu.org>
* include/bits/stl_pair.h: Tweak comment markup.
2002-05-21 Phil Edwards <pme@gcc.gnu.org>
* include/ext/stdio_filebuf.h: Add header guards. Doxygenate.
2002-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (AC_CHECK_HEADERS): Check for string.h & stdlib.h.
* libsupc++/Makefile.am (LTCOMPILE): Add $(DEFS).
* Makefile.in, config.h.in, configure: Regenerate.
* config/os/irix/irix5.2/bits/ctype_noninline.h (classic_table):
Return __ctype + 1.
(ctype:_M_table): Initialize to classic_table(), not __ctype.
* config/os/irix/irix5.2/bits/os_defines.h
(__glibcpp_long_double_bits, __glibcpp_long_bits): Define.
2002-05-19 Paolo Carlini <pcarlini@unitus.it>
Jakub Jelinek <jakub@redhat.com>
* testsuite/22_locale/money_get_members_char.cc
(test01, test02, test04): Use the de_DE@euro named locale
instead of de_DE to allow for an uniform behaviour with
both old and Euro-era localedata; tweak some tests.
* testsuite/22_locale/money_get_members_wchar_t.cc
(test01, test02, test04): Likewise.
* testsuite/22_locale/money_put_members_char.cc
(test01, test02, test04): Likewise.
* testsuite/22_locale/money_put_members_wchar_t.cc
(test01, test02, test04): Likewise.
2002-05-19 Paolo Carlini <pcarlini@unitus.it>
* testsuite/22_locale/codecvt_members_char_char.cc
(test03): Robustify wrt localedata.
* testsuite/22_locale/codecvt_members_wchar_t_char.cc (test03): Likewise.
* testsuite/22_locale/collate_members_char.cc (test04): Likewise.
* testsuite/22_locale/collate_members_wchar_t.cc (test04): Likewise.
* testsuite/22_locale/ctype_members_char.cc (test05): Likewise.
* testsuite/22_locale/ctype_members_wchar_t.cc (test04): Likewise.
* testsuite/22_locale/messages_members_char.cc (test03): Likewise.
* testsuite/22_locale/money_get_members_char.cc (test08): Likewise.
* testsuite/22_locale/money_get_members_wchar_t.cc (test08): Likewise.
* testsuite/22_locale/money_put_members_char.cc (test07): Likewise.
* testsuite/22_locale/money_put_members_wchar_t.cc (test07): Likewise.
* testsuite/22_locale/moneypunct_members_char.cc (test03): Likewise.
* testsuite/22_locale/moneypunct_members_wchar_t.cc (test03): Likewise.
* testsuite/22_locale/num_get_members_char.cc (test06): Likewise.
* testsuite/22_locale/num_get_members_wchar_t.cc (test06): Likewise.
* testsuite/22_locale/num_put_members_char.cc (test04): Add comment.
* testsuite/22_locale/num_put_members_wchar_t.cc (test04): Likewise.
* testsuite/22_locale/numpunct_members_char.cc (test03): Likewise.
* testsuite/22_locale/numpunct_members_wchar_t.cc (test03): Likewise.
* testsuite/22_locale/time_get_members_char.cc (test08): Likewise.
* testsuite/22_locale/time_get_members_wchar_t.cc (test08): Likewise.
* testsuite/22_locale/time_put_members_char.cc (test04): Likewise.
* testsuite/22_locale/time_put_members_wchar_t.cc (test04): Likewise.
2002-05-19 Paolo Carlini <pcarlini@unitus.it>
Test all the facets for the temporary "C" locale switch issue.
* testsuite/22_locale/codecvt_members_char_char.cc: Add test03.
* testsuite/22_locale/codecvt_members_wchar_t_char.cc: Likewise.
* testsuite/22_locale/collate_members_char.cc: Add test04.
* testsuite/22_locale/collate_members_wchar_t.cc: Likewise.
* testsuite/22_locale/ctype_members_char.cc: Add test05.
* testsuite/22_locale/ctype_members_wchar_t.cc: Add test04.
* testsuite/22_locale/messages_members_char.cc: Add test03.
* testsuite/22_locale/money_get_members_char.cc: Add test08.
* testsuite/22_locale/money_get_members_wchar_t.cc: Likewise.
* testsuite/22_locale/money_put_members_char.cc: Add test07.
* testsuite/22_locale/money_put_members_wchar_t.cc: Likewise.
* testsuite/22_locale/moneypunct_members_char.cc: Add test03.
* testsuite/22_locale/moneypunct_members_wchar_t.cc: Likewise.
* testsuite/22_locale/num_get_members_char.cc: Add test06.
* testsuite/22_locale/num_get_members_wchar_t.cc: Likewise.
* testsuite/22_locale/numpunct_members_char.cc: Add test03.
* testsuite/22_locale/numpunct_members_wchar_t.cc: Likewise.
* testsuite/22_locale/time_get_members_char.cc: Add test08.
* testsuite/22_locale/time_get_members_wchar_t.cc: Likewise.
* testsuite/22_locale/time_put_members_char.cc: Add test04.
* testsuite/22_locale/time_put_members_wchar_t.cc: Likewise.
* testsuite/22_locale/num_put_members_char.cc (test04): Add comment.
* testsuite/22_locale/num_put_members_wchar_t.cc (test04): Likewise.
2002-05-19 Benjamin Kosnik <bkoz@redhat.com>
Paolo Carlini <pcarlini@unitus.it>
* testsuite/22_locale/num_put_members_char.cc: Add test04(),
testing for the locale_facets.tcc entry of the previous commit.
* testsuite/22_locale/num_put_members_wchar_t.cc: Likewise.
2002-05-18 Takeshi Kobayakawa <tskoba@mte.biglobe.ne.jp>
* config/locale/generic/c_locale.cc
(__convert_to_v(float, double, long double)):
Fix the temporary switch to the "C" locale, saving and
restoring in the proper way the current locale.
* config/locale/generic/time_members.cc
(__timepunct<char, wchar_t>::_M_put): Likewise.
* config/locale/gnu/messages_members.cc
(messages<char>::do_get): Likewise.
* config/locale/gnu/messages_members.h
(messages<_CharT>::do_get): Likewise.
* config/locale/gnu/time_members.cc
(__timepunct<char, wchar_t>::_M_put): Likewise.
* include/bits/locale_facets.tcc (__convert_from_v): Likewise.
2002-05-18 Paolo Carlini <pcarlini@unitus.it>
Nathan Myers <ncm@cantrip.org>
Philip Martin <philip@codematters.co.uk>
* include/bits/basic_string.h
(replace(i1, i2, _CharT* k1, _CharT* k2),
replace(i2, i2, const _CharT* k1, const _CharT* k2),
replace(i1, i2, iterator k1, iterator k2,
replace(i1, i2, const_iterator k1, const_iterator k2):
New specializations to optimize for the common cases of
pointers and iterators.
(replace(pos, n1, s, n2)): Tweak.
* include/bits/basic_string.tcc: Tweak comments.
* testsuite/21_strings/replace.cc (test05): New tests.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
* config/os/solaris/solaris2.5/bits/os_defines.h: Remove
_G_USING_THUNKS.
* config/os/solaris/solaris2.6/bits/os_defines.h: Same.
* config/os/solaris/solaris2.7/bits/os_defines.h: Same.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/17_intro/RELEASE-NOTES (New): Update.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6518
* include/bits/ostream.tcc (ostream::operator<<(const char*)): Fix
for null case.
(ostream::operator<<(const _CharT*)): Same.
(ostream<char>::operator<<(const char*)): Same.
* testsuite/27_io/ostream_inserter_char.cc (test07): Add test.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6594
* src/strstream.cc (strstreambuf): Fix leak.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/22_locale/ctype_scan_char.cc: Tweak.
* testsuite/22_locale/ctype_scan_wchar_t.cc: New.
* docs/html/install.html: Fix.
2002-05-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/os/irix/irix5.2/bits/ctype_inline.h: Cast to unsigned
char.
* config/os/irix/irix5.2/bits/ctype_inline.h (scan_is, scan_not):
Fix typo, use this->is() rather than manually (and perhaps
incorrectly) inlining it.
* config/os/irix/irix6.5/bits/ctype_inline.h (scan_is, scan_not):
Likewise.
* testsuite/22_locale/ctype_scan_char.cc: New file.
2002-05-18 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/fstream.tcc
(basic_filebuf::_M_allocate_internal_buffer): Remove extraneous
try/catch blocks.
* src/localename.cc (locale::_Impl::_M_install_facet): Same.
* docs/html/install.html: Tweak, add bits about required locales
for the 22_locale tests when using the gnu model.
* testsuite/27_io/istream_sentry.cc: Tweak.
2002-05-16 Phil Edwards <pme@gcc.gnu.org>
* docs/html/faq/index.html: Update not-a-bug list with basic_file.h.
* docs/html/faq/index.txt: Regenerate.
2002-05-15 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/6648
* include/bits/istream.tcc (istream::getline, ignore):
Upon __idelim (__delim) call sbumpc() not snextc().
* testsuite/27_io/narrow_stream_objects.cc:
Add test08 and test09.
2002-05-14 Release Manager
* GCC 3.1 Released.
2002-05-09 Jakub Jelinek <jakub@redhat.com>
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Append all

View File

@ -44,6 +44,11 @@ check-script-install: $(top_builddir)/mkcheck
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
baseline_file = @baseline_file@
check-abi: $(top_builddir)/testsuite/abi_check
-(cd testsuite; \
./abi_check ${baseline_file})
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; pwd`; \

View File

@ -1,4 +1,4 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@ -68,9 +68,6 @@ AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
AWK = @AWK@
BASIC_FILE_H = @BASIC_FILE_H@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCODECVT_C = @CCODECVT_C@
CCODECVT_H = @CCODECVT_H@
@ -78,30 +75,18 @@ CLOCALE_H = @CLOCALE_H@
CMESSAGES_H = @CMESSAGES_H@
CPP = @CPP@
CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DATADIRNAME = @DATADIRNAME@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIBICONV = @LIBICONV@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
@ -112,22 +97,17 @@ LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
@ -150,7 +130,6 @@ gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
libio_la = @libio_la@
libtool_VERSION = @libtool_VERSION@
release_VERSION = @release_VERSION@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 cygnus
@ -160,6 +139,8 @@ SUBDIRS = include libio libmath libsupc++ src po testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
baseline_file = @baseline_file@
# Multilib support.
MAKEOVERRIDES =
@ -174,44 +155,7 @@ 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
@ -223,7 +167,7 @@ mkcheck.in testsuite_flags.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
@ -498,6 +442,9 @@ check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
cd testsuite; \
@glibcpp_builddir@/mkcheck 1)
check-abi: $(top_builddir)/testsuite/abi_check
-(cd testsuite; \
./abi_check ${baseline_file})
# These rules are messy, but are hella worth it.
doxygen:

View File

@ -1,9 +1,10 @@
dnl
dnl Initialize configure bits.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
dnl Default to --enable-multilib
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
dnl Default to --enable-multilib (this is also passed by default
dnl from the ubercommon-top-level configure)
AC_ARG_ENABLE(multilib,
[ --enable-multilib build hella library versions (default)],
[case "${enableval}" in
@ -33,12 +34,21 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
toplevel_srcdir=\${top_srcdir}/$toprel
AC_SUBST(toplevel_srcdir)
])
dnl
dnl Initialize configure bits.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
#possibly test for the presence of the compiler sources here?
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcpp_builddir=`pwd`
glibcpp_builddir=`${PWDCMD-pwd}`
case $srcdir in
[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
@ -51,7 +61,8 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_PROG_AWK
# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
# be 'cp -p' if linking isn't available.
# be 'cp -p' if linking isn't available. Uncomment the next line to
# force a particular method.
#ac_cv_prog_LN_S='cp -p'
AC_PROG_LN_S
@ -156,6 +167,11 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
LIB_AC_PROG_CXX
# For directory versioning (e.g., headers) and other variables.
AC_MSG_CHECKING([for GCC version number])
gcc_version=`$glibcpp_CXX -dumpversion`
AC_MSG_RESULT($gcc_version)
# For some reason, gettext needs this.
AC_ISC_POSIX
@ -181,17 +197,14 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_EXEEXT
fi
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
# This does for the target what configure.host does for the host. In
# Find platform-specific directories containing configuration info. In
# addition to possibly modifying the same flags, it also sets up symlinks.
GLIBCPP_CHECK_TARGET
])
@ -1172,15 +1185,14 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
# Declare intention to use gettext, and add support for specific
# languages.
# For some reason, ALL_LINGUAS has to be before AM_GNU_GETTEXT
# For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
ALL_LINGUAS="de fr"
# Don't call AM_GNU_GETTEXT here. Instead, assume glibc.
# Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
USE_NLS=yes
fi
# Export the build objects.
for ling in $ALL_LINGUAS; do \
glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
@ -1690,23 +1702,20 @@ changequote([, ])
dnl Option parsed, now set things appropriately
case "$enable_cheaders" in
c_shadow)
CSHADOW_FLAGS="-fno-builtin"
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
;;
c_std)
CSHADOW_FLAGS=""
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
c)
CSHADOW_FLAGS=""
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
;;
esac
AC_SUBST(CSHADOW_FLAGS)
AC_SUBST(C_INCLUDE_DIR)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
])
@ -1804,10 +1813,6 @@ glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
glibcpp_prefixdir=${prefix}
AC_MSG_CHECKING([for interface version number])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface)
# Process the option --with-gxx-include-dir=<path to include-files directory>
AC_MSG_CHECKING([for --with-gxx-include-dir])
AC_ARG_WITH(gxx-include-dir,
@ -1839,26 +1844,21 @@ version_specific_libs=no)dnl
# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
# Default case for install directory for include files.
if test $version_specific_libs = no && test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
fi
# Version-specific runtime libs processing.
if test $version_specific_libs = yes; then
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option
# is selected.
changequote(,)dnl
gcc_version_trigger=${srcdir}/../gcc/version.c
gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
if test x"$gxx_include_dir" = x"no"; then
gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
fi
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
changequote([,])dnl
fi
# Default case for install directory for include files.
if test $version_specific_libs = no &&
test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
@ -2024,6 +2024,14 @@ AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
# Export file names for ABI checking.
baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
AC_SUBST(baseline_file)
# Don't do ABI checking unless native.
AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
test x"$build" = x"$host" && test -z "$with_cross_host")
])
@ -2120,7 +2128,7 @@ enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
if test x$enable_shared = xno ||
test x$LD = x ||
test "x$LD" = x ||
test x$glibcpp_gnu_ld_version = x; then
enable_symvers=no
fi

View File

@ -1,4 +1,4 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@ -13,9 +13,10 @@ dnl PARTICULAR PURPOSE.
dnl
dnl Initialize configure bits.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
dnl Default to --enable-multilib
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
dnl Default to --enable-multilib (this is also passed by default
dnl from the ubercommon-top-level configure)
AC_ARG_ENABLE(multilib,
[ --enable-multilib build hella library versions (default)],
[case "${enableval}" in
@ -45,12 +46,21 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
toplevel_srcdir=\${top_srcdir}/$toprel
AC_SUBST(toplevel_srcdir)
])
dnl
dnl Initialize configure bits.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
#possibly test for the presence of the compiler sources here?
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcpp_builddir=`pwd`
glibcpp_builddir=`${PWDCMD-pwd}`
case $srcdir in
[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
@ -63,7 +73,8 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_PROG_AWK
# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
# be 'cp -p' if linking isn't available.
# be 'cp -p' if linking isn't available. Uncomment the next line to
# force a particular method.
#ac_cv_prog_LN_S='cp -p'
AC_PROG_LN_S
@ -168,6 +179,11 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
LIB_AC_PROG_CXX
# For directory versioning (e.g., headers) and other variables.
AC_MSG_CHECKING([for GCC version number])
gcc_version=`$glibcpp_CXX -dumpversion`
AC_MSG_RESULT($gcc_version)
# For some reason, gettext needs this.
AC_ISC_POSIX
@ -193,17 +209,14 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
AC_EXEEXT
fi
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
/* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
# This does for the target what configure.host does for the host. In
# Find platform-specific directories containing configuration info. In
# addition to possibly modifying the same flags, it also sets up symlinks.
GLIBCPP_CHECK_TARGET
])
@ -1184,15 +1197,14 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
# Declare intention to use gettext, and add support for specific
# languages.
# For some reason, ALL_LINGUAS has to be before AM_GNU_GETTEXT
# For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
ALL_LINGUAS="de fr"
# Don't call AM_GNU_GETTEXT here. Instead, assume glibc.
# Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
USE_NLS=yes
fi
# Export the build objects.
for ling in $ALL_LINGUAS; do \
glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
@ -1702,23 +1714,20 @@ changequote([, ])
dnl Option parsed, now set things appropriately
case "$enable_cheaders" in
c_shadow)
CSHADOW_FLAGS="-fno-builtin"
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
;;
c_std)
CSHADOW_FLAGS=""
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
c)
CSHADOW_FLAGS=""
C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
;;
esac
AC_SUBST(CSHADOW_FLAGS)
AC_SUBST(C_INCLUDE_DIR)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
])
@ -1816,10 +1825,6 @@ glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
glibcpp_prefixdir=${prefix}
AC_MSG_CHECKING([for interface version number])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface)
# Process the option --with-gxx-include-dir=<path to include-files directory>
AC_MSG_CHECKING([for --with-gxx-include-dir])
AC_ARG_WITH(gxx-include-dir,
@ -1851,26 +1856,21 @@ version_specific_libs=no)dnl
# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
# Default case for install directory for include files.
if test $version_specific_libs = no && test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
fi
# Version-specific runtime libs processing.
if test $version_specific_libs = yes; then
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option
# is selected.
changequote(,)dnl
gcc_version_trigger=${srcdir}/../gcc/version.c
gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
if test x"$gxx_include_dir" = x"no"; then
gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
fi
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
changequote([,])dnl
fi
# Default case for install directory for include files.
if test $version_specific_libs = no &&
test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
@ -2036,6 +2036,14 @@ AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
# Look for setenv, so that extended locale tests can be performed.
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
# Export file names for ABI checking.
baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
AC_SUBST(baseline_file)
# Don't do ABI checking unless native.
AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
test x"$build" = x"$host" && test -z "$with_cross_host")
])
@ -2132,7 +2140,7 @@ enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
if test x$enable_shared = xno ||
test x$LD = x ||
test "x$LD" = x ||
test x$glibcpp_gnu_ld_version = x; then
enable_symvers=no
fi
@ -2197,7 +2205,16 @@ AC_MSG_RESULT($enable_symvers)
])
#serial 1
# isc-posix.m4 serial 2 (gettext-0.11.2)
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
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)
@ -2248,539 +2265,6 @@ else
$1_FALSE=
fi])
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 9
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
dnl depending on --{enable,disable}-{shared,static} and on the presence of
dnl AM-DISABLE-SHARED). Otherwise, a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
dnl will be ignored.
dnl LIBDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
dnl
dnl The result of the configuration is one of three cases:
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
dnl and used.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 2) GNU gettext has been found in the system's C library.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 3) No internationalization, always use English msgid.
dnl Catalog format: none
dnl Catalog extension: none
dnl The use of .gmo is historical (it was needed to avoid overwriting the
dnl GNU format catalogs when building on a platform with an X/Open gettext),
dnl but we keep it in order not to force irrelevant filename changes on the
dnl maintainers.
dnl
AC_DEFUN([AM_WITH_NLS],
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
INTLLIBS=
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
[Define to 1 if translation of program messages to the user's native language
is requested.])
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
CATOBJEXT=NONE
dnl Add a version number to the cache macros.
define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libc=yes,
gt_cv_func_gnugettext_libc=no)])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl,
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libintl=yes,
gt_cv_func_gnugettext_libintl=no)
LIBS="$gt_save_LIBS"])
fi
dnl If an already present or preinstalled GNU gettext() is found,
dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
if test "$gt_cv_func_gnugettext_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
&& test "$PACKAGE" != gettext; }; then
AC_DEFINE(HAVE_GETTEXT, 1,
[Define if the GNU gettext() function is already present or preinstalled.])
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
dnl If iconv() is in a separate libiconv library, then anyone
dnl linking with libintl{.a,.so} also needs to link with
dnl libiconv.
INTLLIBS="-lintl $LIBICONV"
fi
gt_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
LIBS="$gt_save_LIBS"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
CATOBJEXT=.gmo
fi
])
if test "$CATOBJEXT" = "NONE"; then
dnl GNU gettext is not found in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
dnl We need to process the po/ directory.
POSUB=po
fi
AC_OUTPUT_COMMANDS(
[for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"
case "$ac_file" in
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
esac
# PO directories have a Makefile.in generated from Makefile.in.in.
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
echo creating "$ac_dir/POTFILES"
sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
echo creating "$ac_dir/Makefile"
sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
fi
;;
esac
done])
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it.
if test "$PACKAGE" = gettext; then
BUILD_INCLUDED_LIBINTL=yes
fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
dnl compile.
dnl bison is only needed for the maintainer (who touches plural.y). But in
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
dnl the rule in general Makefile. Now, some people carelessly touch the
dnl files or have a broken "make" program, hence the plural.c rule will
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
dnl present or too old.
AC_CHECK_PROGS([INTLBISON], [bison])
if test -z "$INTLBISON"; then
ac_verc_fail=yes
else
dnl Found it, now check the version.
AC_MSG_CHECKING([version of bison])
changequote(<<,>>)dnl
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
changequote([,])dnl
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
AC_MSG_RESULT([$ac_prog_version])
fi
if test $ac_verc_fail = yes; then
INTLBISON=:
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(GMOFILES)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
nls_cv_header_libgt=
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
AC_SUBST(DATADIRNAME)
dnl For backward compatibility. Some Makefiles may be using this.
INSTOBJEXT=.mo
AC_SUBST(INSTOBJEXT)
dnl For backward compatibility. Some Makefiles may be using this.
GENCAT=gencat
AC_SUBST(GENCAT)
])
dnl Usage: Just like AM_WITH_NLS, which see.
AC_DEFUN([AM_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([jm_GLIBC21])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
AM_LC_MESSAGES
AM_WITH_NLS([$1],[$2],[$3])
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
fi
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
#serial 2
# Test for the GNU C Library, version 2.1 or newer.
# From Bruno Haible.
AC_DEFUN([jm_GLIBC21],
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
ac_cv_gnu_library_2_1,
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
],
ac_cv_gnu_library_2_1=yes,
ac_cv_gnu_library_2_1=no)
]
)
AC_SUBST(GLIBC21)
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
#serial AM2
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
done
])
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
LIBICONV=
if test "$am_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
AC_SUBST(LIBICONV)
])
#serial AM1
dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 2
AC_DEFUN([AM_LC_MESSAGES],
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
fi])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@ -2791,7 +2275,8 @@ dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
@ -2807,13 +2292,42 @@ 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, $missing_dir)
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $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.
#

View File

@ -711,6 +711,9 @@
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/isa_defs.h> header file. */
#undef HAVE_SYS_ISA_DEFS_H

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
__asm__ __volatile__ ("1: move%.l %0,%1\n\t"
"add%.l %2,%1\n\t"
"cas%.l %0,%1,%3\n\t"
"jbne 1b"
"jne 1b"
: "=d" (__result), "=&d" (__temp)
: "d" (__val), "m" (*__mem), "0" (__result)
: "memory");

View File

@ -21,7 +21,7 @@
## USA.
GLIBCPP_3.1 {
GLIBCPP_3.2 {
global:
@ -97,7 +97,7 @@ GLIBCPP_3.1 {
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1 {
CXXABI_1.2 {
global:
__cxa_*;

View File

@ -120,7 +120,8 @@ namespace std
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
char* __sanity;
errno = 0;
#if defined(_GLIBCPP_USE_C99)
@ -147,6 +148,7 @@ namespace std
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
free(__old);
}
}
@ -158,7 +160,8 @@ namespace std
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
char* __sanity;
errno = 0;
double __d = strtod(__s, &__sanity);
@ -167,6 +170,7 @@ namespace std
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
free(__old);
}
}
@ -178,7 +182,8 @@ namespace std
if (!(__err & ios_base::failbit))
{
// Assumes __s formatted for "C" locale.
const char* __old = setlocale(LC_ALL, "C");
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
#if defined(_GLIBCPP_USE_C99)
char* __sanity;
errno = 0;
@ -202,6 +207,7 @@ namespace std
else
__err |= ios_base::failbit;
setlocale(LC_ALL, __old);
free(__old);
}
}

View File

@ -1,6 +1,6 @@
// std::ctype implementation details, generic 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
@ -183,12 +183,23 @@ namespace std
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __len = __hi - __lo;
size_t __conv = wcsrtombs(__dest, &__lo, __len, &__state);
if (__conv == __len)
*__dest = __dfault;
size_t __offset = 0;
while (true)
{
const wchar_t* __start = __lo + __offset;
size_t __len = __hi - __start;
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
if (__con != __len && __start != 0)
{
__offset = __start - __lo;
__dest[__offset++] = __dfault;
}
else
break;
}
return __hi;
}
#endif // _GLIBCPP_USE_WCHAR_T

View File

@ -45,7 +45,7 @@ namespace std
template<>
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale)
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*)
{
// "C" locale
_M_decimal_point = '.';
@ -61,7 +61,7 @@ namespace std
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale)
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*)
{
// "C" locale
_M_decimal_point = '.';
@ -86,7 +86,8 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale)
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
const char*)
{
// "C" locale
_M_decimal_point = L'.';
@ -102,7 +103,8 @@ namespace std
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale)
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
const char*)
{
// "C" locale
_M_decimal_point = L'.';

View File

@ -51,9 +51,11 @@ namespace std
_M_put(char* __s, size_t __maxlen, const char* __format,
const tm* __tm) const
{
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
strftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
free(__old);
}
template<>
@ -132,9 +134,11 @@ namespace std
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
const tm* __tm) const
{
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
wcsftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
free(__old);
}
template<>

View File

@ -190,12 +190,23 @@ namespace std
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __len = __hi - __lo;
size_t __conv = wcsrtombs(__dest, &__lo, __len, &__state);
if (__conv == __len)
*__dest = __dfault;
size_t __offset = 0;
while (true)
{
const wchar_t* __start = __lo + __offset;
size_t __len = __hi - __start;
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
if (__con != __len && __start != 0)
{
__offset = __start - __lo;
__dest[__offset++] = __dfault;
}
else
break;
}
return __hi;
}
#endif // _GLIBCPP_USE_WCHAR_T

View File

@ -48,9 +48,11 @@ namespace std
__uselocale(__old);
return string(__msg);
#else
const char* __old = setlocale(LC_ALL, _M_name_messages);
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_messages);
const char* __msg = gettext(__dfault.c_str());
setlocale(LC_ALL, __old);
free(__old);
return string(__msg);
#endif
}

View File

@ -65,9 +65,11 @@
__uselocale(__old);
return _M_convert_from_char(__msg);
#else
const char* __old = setlocale(LC_ALL, _M_name_messages);
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
}

View File

@ -216,7 +216,8 @@ namespace std
template<>
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc)
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
if (__cloc == _S_c_locale)
{
@ -260,7 +261,8 @@ namespace std
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc)
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
if (__cloc == _S_c_locale)
{
@ -313,7 +315,8 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc)
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
const char* __name)
{
if (__cloc == _S_c_locale)
{
@ -331,6 +334,10 @@ namespace std
else
{
// Named locale.
// XXX Fix me. Switch to named locale so that mbsrtowcs will work.
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, __name);
_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);
@ -391,12 +398,17 @@ namespace std
char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
// XXX
setlocale(LC_ALL, __old);
free(__old);
}
}
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc)
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
const char* __name)
{
if (__cloc == _S_c_locale)
{
@ -414,6 +426,10 @@ namespace std
else
{
// Named locale.
// XXX Fix me. Switch to named locale so that mbsrtowcs will work.
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, __name);
_M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
_M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
@ -473,6 +489,10 @@ namespace std
char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
// XXX
setlocale(LC_ALL, __old);
free(__old);
}
}

View File

@ -54,9 +54,11 @@ namespace std
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__strftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
#else
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
strftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
free(__old);
#endif
}
@ -202,9 +204,11 @@ namespace std
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__wcsftime_l(__s, __maxlen, _M_c_locale_timepunct, __format, __tm);
#else
const char* __old = setlocale(LC_ALL, _M_name_timepunct);
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
wcsftime(__s, __maxlen, __format, __tm);
setlocale(LC_ALL, __old);
free(__old);
#endif
}

View File

@ -110,6 +110,7 @@
_M_out_desc = 0;
_M_ext_bom = __obj._M_ext_bom;
_M_int_bom = __obj._M_int_bom;
return *this;
}
~__enc_traits()

View File

@ -52,7 +52,7 @@
char
ctype<char>::do_toupper(char __c) const
{ return _toupper(__c); }
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
@ -67,7 +67,7 @@
char
ctype<char>::do_tolower(char __c) const
{ return _tolower(__c); }
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const

View File

@ -42,13 +42,13 @@
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
_M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
_M_table(__table ? __table : classic_table())
{ }
char

View File

@ -65,11 +65,11 @@ typedef __loff_t __off64_t;
#define __NO_STRING_INLINES
#endif
#if defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__))
#if (defined(__hppa__) && defined(__LP64__)) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__))
#define __glibcpp_long_bits 64
#endif
#if defined(__sparc__) && !defined(__arch64__)
#if defined(__hppa__) || (defined(__sparc__) && !defined(__arch64__))
#define __glibcpp_long_double_bits 64
#endif

View File

@ -1,6 +1,6 @@
// Locale support -*- 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
@ -37,14 +37,14 @@
bool
ctype<char>::
is(mask __m, char __c) const
{ return (_M_table)[__c] & __m; }
{ return (_M_table)[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table)[*__low++];
*__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
return __high;
}
@ -52,7 +52,7 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !((_M_table)[*__low] & __m))
while (__low < __high && ! this->is(__m, *__low))
++__low;
return __low;
}
@ -61,12 +61,7 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && ((_M_table + 1)[*__low] & __m) != 0)
while (__low < __high && this->is(__m, *__low))
++__low;
return __low;
}

View File

@ -36,19 +36,19 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
{ return __ctype + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? __ctype : __table)
_M_table(!__table ? classic_table() : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? __ctype : __table)
_M_table(!__table ? classic_table() : __table)
{ }
char

View File

@ -1,6 +1,6 @@
// Specific definitions for IRIX -*- 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
@ -48,7 +48,14 @@
#define __off64_t off64_t
#define __ssize_t ssize_t
// GCC does not use thunks on IRIX.
// GCC does not use thunks on IRIX.
#define _G_USING_THUNKS 0
#define __glibcpp_long_double_bits 64
#if __LONG_MAX__ > 2147483647
#define __glibcpp_long_bits 64
#endif
#endif

View File

@ -52,8 +52,7 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& !((_M_table)[static_cast<unsigned char>(*__low)] & __m))
while (__low < __high && ! this->is(__m, *__low))
++__low;
return __low;
}
@ -62,8 +61,7 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& ((_M_table + 1)[static_cast<unsigned char>(*__low)] & __m) != 0)
while (__low < __high && this->is(__m, *__low))
++__low;
return __low;
}

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -37,14 +37,14 @@
bool
ctype<char>::
is(mask __m, char __c) const
{ return (_M_table + 1)[(unsigned char)(__c)] & __m; }
{ return _M_table[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = (_M_table + 1)[(unsigned char) (*__low++)];
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
@ -52,7 +52,7 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m))
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
@ -61,13 +61,7 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high
&& ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0)
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -35,7 +35,7 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return _ctype_; }
{ return _ctype_ + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)

View File

@ -0,0 +1,55 @@
// Locale support -*- 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.1 Locales
//
// Information as gleaned from /usr/include/ctype.h.
struct ctype_base
{
// Non-standard typedefs.
typedef const unsigned char* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef short mask;
static const mask upper = _UP;
static const mask lower = _LO;
static const mask alpha = _LO | _UP | _XA;
static const mask digit = _DI;
static const mask xdigit = _XD;
static const mask space = _CN | _SP | _XS;
static const mask print = _DI | _LO | _PU | _SP | _UP | _XA;
static const mask graph = _DI | _LO | _PU | _UP | _XA;
static const mask cntrl = _BB;
static const mask punct = _PU;
static const mask alnum = _DI | _LO | _UP | _XA;
};

View File

@ -0,0 +1,67 @@
// Locale support -*- 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.1 Locales
//
// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
// functions go in ctype.cc
bool
ctype<char>::
is(mask __m, char __c) const
{ return _M_table[(unsigned char)(__c)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[*__low++];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}

View File

@ -0,0 +1,79 @@
// Locale support -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
{ }
char
ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
++__low;
}
return __high;
}
char
ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
++__low;
}
return __high;
}

View File

@ -0,0 +1,36 @@
// Specific definitions for QNX 6.1 -*- 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.
#ifndef _GLIBCPP_OS_DEFINES
#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#endif

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// Copyright (C) 1997-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
@ -47,7 +47,7 @@
static const mask digit = 04;
static const mask xdigit = 0200;
static const mask space = 010;
static const mask print = 020 | 01 | 02 | 04 | 0200;
static const mask print = 020 | 01 | 02 | 04 | 0100;
static const mask graph = 020 | 01 | 02 | 04;
static const mask cntrl = 040;
static const mask punct = 020;

View File

@ -35,7 +35,7 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
{ return __ctype; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)

View File

@ -1,6 +1,6 @@
// Specific definitions for Solaris 2.5 -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -39,7 +39,4 @@
#define __off64_t off64_t
#define __ssize_t ssize_t
// Without this all the libio vtbls are offset wrongly.
#define _G_USING_THUNKS 0
#endif

View File

@ -35,7 +35,7 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
{ return 0; }
{ return __ctype_mask; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)

View File

@ -1,6 +1,6 @@
// Specific definitions for Solaris 2.6 -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -39,7 +39,4 @@
#define __off64_t off64_t
#define __ssize_t ssize_t
// Without this all the libio vtbls are offset wrongly.
#define _G_USING_THUNKS 0
#endif

View File

@ -1,6 +1,6 @@
// Specific definitions for Solaris 7,8 -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -39,11 +39,9 @@
#define __off64_t off64_t
#define __ssize_t ssize_t
// Without this all the libio vtbls are offset wrongly.
#define _G_USING_THUNKS 0
#if defined(__sparcv9) || defined(__arch64__)
#define __glibcpp_long_bits 64
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,12 @@ ORIGINAL_LD_FOR_MULTILIBS=$LD
PACKAGE=libstdc++
AC_SUBST(PACKAGE)
# For typical GNU versioning info, format is MAJOR.MINOR.MICRO
release_VERSION=3.1.0
AC_SUBST(release_VERSION)
# For libtool versioning info, format is CURRENT:REVISION:AGE
libtool_VERSION=4:0:0
libtool_VERSION=5:1:0
AC_SUBST(libtool_VERSION)
GLIBCPP_TOPREL_CONFIGURE
# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
# AC 2.5x sets target_alias iff the user specified --target, but we use it
# everywhere, so we set it here just to be sure. In AC 2.13
@ -27,14 +26,14 @@ AC_CANONICAL_SYSTEM
target_alias=${target_alias-$target}
AC_SUBST(target_alias)
AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
AM_CONFIG_HEADER(config.h)
# Runs configure.host and configure.target, as well as finds CC, CXX
# and assorted other critical bits. Have to run this before the
# GLIBCPP_ENABLE_* macros below.
GLIBCPP_CONFIGURE(.)
AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
AM_CONFIG_HEADER(config.h)
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_SUBST(enable_shared)
@ -51,13 +50,15 @@ GLIBCPP_ENABLE_CLOCALE
GLIBCPP_ENABLE_C_MBCHAR([yes])
GLIBCPP_ENABLE_C99([yes])
GLIBCPP_ENABLE_LONG_LONG([yes])
GLIBCPP_ENABLE_CHEADERS([c_std])
GLIBCPP_ENABLE_CHEADERS([$c_model])
GLIBCPP_ENABLE_THREADS
GLIBCPP_ENABLE_CXX_FLAGS([none])
GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
GLIBCPP_ENABLE_CONCEPT_CHECKS
# Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
AC_CHECK_HEADERS(string.h stdlib.h)
if test -n "$with_cross_host" || test x"$build" != x"$host"; then
@ -156,6 +157,28 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
GLIBCPP_CHECK_WCHAR_T_SUPPORT
os_include_dir="config/os/mingw32"
;;
changequote(,)dnl
*-qnx6.[12]*)
changequote([,])dnl
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCPP_CHECK_LINKER_FEATURES
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
GLIBCPP_CHECK_WCHAR_T_SUPPORT
os_include_dir="config/os/qnx/qnx6.1"
AC_DEFINE(HAVE_COSF)
AC_DEFINE(HAVE_COSL)
AC_DEFINE(HAVE_COSHF)
AC_DEFINE(HAVE_COSHL)
AC_DEFINE(HAVE_LOGF)
AC_DEFINE(HAVE_LOGL)
AC_DEFINE(HAVE_LOG10F)
AC_DEFINE(HAVE_LOG10L)
AC_DEFINE(HAVE_SINF)
AC_DEFINE(HAVE_SINL)
AC_DEFINE(HAVE_SINHF)
AC_DEFINE(HAVE_SINHL)
;;
*)
os_include_dir="config/os/newlib"
AC_DEFINE(HAVE_HYPOT)
@ -247,7 +270,7 @@ else
# Check for available headers.
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
GLIBCPP_CHECK_COMPILER_FEATURES
GLIBCPP_CHECK_LINKER_FEATURES
@ -293,9 +316,6 @@ else
multilib_arg=
fi
# Needed so that g++ can find the correct include subdir automatically.
INTERFACE=v3
# Export all the install information
GLIBCPP_EXPORT_INSTALL_INFO
@ -379,11 +399,11 @@ if test ! -f stamp-sanity-warned; then
touch stamp-sanity-warned
echo ""
echo "Please make certain that you read the installation information here:"
echo " faster => ${srcdir}/docs/install.html"
echo " faster => ${srcdir}/docs/html/install.html"
echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
echo ""
echo "and the configuration information here:"
echo " faster => ${srcdir}/docs/configopts.html"
echo " faster => ${srcdir}/docs/html/configopts.html"
echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
echo ""
echo "before proceeding with ${_cv_gnu_make_command}."

View File

@ -16,10 +16,22 @@
# It possibly modifies the following shell variables:
# cpu_include_dir CPU-specific include directory, relative to srcdir
#
# os_include_dir OS-specific include directory, relative to srcdir
#
# c_model the model to use for "C" headers, defaults to c_std.
#
# c_compatibility if "C" compatibility headers are necessary,
# defaults to no.
# DEFAULTS
c_model=c_std
c_compatibility=no
abi_baseline_triplet=${target}
# Set any CPU dependent compiler flags.
# TARGET-SPECIFIC OVERRIDES
# Set any CPU-dependent bits.
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
case "${target_cpu}" in
alpha*)
@ -108,6 +120,10 @@ case "${target_os}" in
hpux*)
os_include_dir="config/os/hpux"
;;
qnx6.[12]*)
os_include_dir="config/os/qnx/qnx6.1"
c_model=c
;;
*)
os_include_dir="config/os/generic"
;;
@ -170,7 +186,7 @@ case "${target}" in
mmix-*-*)
CPULIMITSH=config/cpu/mmix
;;
powerpc-*-*)
powerpc-*-* | rs6000-*-*)
CPULIMITSH=config/cpu/powerpc
;;
s390-*-* | s390x-*-*)

View File

@ -21,7 +21,7 @@
## 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
@ -96,7 +96,7 @@ bits_headers = \
${bits_srcdir}/type_traits.h \
${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_meta.h
${bits_srcdir}/valarray_meta.h
backward_srcdir = ${glibcpp_srcdir}/include/backward
backward_builddir = ./backward
@ -201,15 +201,45 @@ c_base_headers_rename = \
cwchar \
cwctype
# "C" compatibility headers.
c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility
c_compatibility_builddir = .
c_compatibility_headers = \
${c_compatibility_srcdir}/assert.h \
${c_compatibility_srcdir}/ctype.h \
${c_compatibility_srcdir}/errno.h \
${c_compatibility_srcdir}/float.h \
${c_compatibility_srcdir}/iso646.h \
${c_compatibility_srcdir}/limits.h \
${c_compatibility_srcdir}/locale.h \
${c_compatibility_srcdir}/math.h \
${c_compatibility_srcdir}/setjmp.h \
${c_compatibility_srcdir}/signal.h \
${c_compatibility_srcdir}/stdarg.h \
${c_compatibility_srcdir}/stddef.h \
${c_compatibility_srcdir}/stdio.h \
${c_compatibility_srcdir}/stdlib.h \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
${c_compatibility_srcdir}/wctype.h
# Some of the different "C" header models need extra files.
# Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std
if GLIBCPP_C_HEADERS_C_STD
c_base_headers_extra = \
${c_base_srcdir}/cmath.tcc
c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
else
c_base_headers_extra =
endif
if GLIBCPP_C_HEADERS_COMPATIBILITY
c_compatibility_headers_extra = ${c_compatibility_headers}
else
c_compatibility_headers_extra =
endif
std_srcdir = ${glibcpp_srcdir}/include/std
std_builddir = .
std_headers = \
@ -283,8 +313,8 @@ target_headers = \
${target_srcdir}/os_defines.h \
${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h
# These extra_target_headers files are all built with ad hoc naming rules.
extra_target_headers = \
# These target_headers_extra files are all built with ad hoc naming rules.
target_headers_extra = \
${target_builddir}/basic_file.h \
${target_builddir}/c++config.h \
${target_builddir}/c++io.h \
@ -300,7 +330,9 @@ thread_target_headers = \
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \
allstamps = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
stamp-backward stamp-ext \
${target_builddir}/stamp-target
@ -339,6 +371,15 @@ stamp-c_base: ${c_base_headers} ${c_base_headers_extra}
fi ;\
echo `date` > stamp-c_base
stamp-c_compatibility: ${c_compatibility_headers_extra}
@if [ ! -d "${c_compatibility_builddir}" ]; then \
mkdir -p ${c_compatibility_builddir} ;\
fi ;\
if [ ! -z "${c_compatibility_headers_extra}" ]; then \
(cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
fi ;\
echo `date` > stamp-c_compatibility
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
@ -420,7 +461,7 @@ ${target_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcpp_thread_h} \
# components. Yes, with minor differences, this is sheer duplication
# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
# extra_target_headers are taken out of the build tree staging area;
# target_headers_extra are taken out of the build tree staging area;
# the rest are taken from the original source tree.
gxx_include_dir = @gxx_include_dir@
install-data-local:
@ -436,17 +477,18 @@ install-data-local:
$(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
$(mkinstalldirs) ${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers_rename}; do \
$(INSTALL_DATA) ${c_base_builddir}/$${file} \
${gxx_include_dir}/${c_base_builddir}; done
c_base_headers_extra_install=${c_base_headers_extra};\
$(INSTALL_DATA) ${c_base_builddir}/$${file} ${gxx_include_dir}; done
c_base_headers_extra_install='$(c_base_headers_extra)';\
for file in $$c_base_headers_extra_install; do \
$(INSTALL_DATA) $$file ${gxx_include_dir}/${bits_builddir}; done
c_compatibility_headers_install='$(c_compatibility_headers_extra)';\
for file in $$c_compatibility_headers_install; do \
$(INSTALL_DATA) $$file ${gxx_include_dir}; done
$(mkinstalldirs) ${gxx_include_dir}/${std_builddir}
for file in ${std_headers_rename}; do \
$(INSTALL_DATA) ${std_builddir}/$${file} \
${gxx_include_dir}/${std_builddir}; done
$(INSTALL_DATA) ${std_builddir}/$${file} ${gxx_include_dir}; done
$(mkinstalldirs) ${gxx_include_dir}/${target_builddir}
for file in ${target_headers} ${extra_target_headers} \
for file in ${target_headers} ${target_headers_extra} \
${thread_target_headers}; do \
$(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done

View File

@ -68,9 +68,6 @@ AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
AWK = @AWK@
BASIC_FILE_H = @BASIC_FILE_H@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCODECVT_C = @CCODECVT_C@
CCODECVT_H = @CCODECVT_H@
@ -78,29 +75,17 @@ CLOCALE_H = @CLOCALE_H@
CMESSAGES_H = @CMESSAGES_H@
CPP = @CPP@
CPU_LIMITS_INC_SRCDIR = @CPU_LIMITS_INC_SRCDIR@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
CSTDIO_H = @CSTDIO_H@
CXXCPP = @CXXCPP@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DATADIRNAME = @DATADIRNAME@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIBICONV = @LIBICONV@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
@ -111,26 +96,22 @@ LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
baseline_file = @baseline_file@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
@ -145,10 +126,9 @@ glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
ifGNUmake = @ifGNUmake@
libio_la = @libio_la@
libtool_VERSION = @libtool_VERSION@
release_VERSION = @release_VERSION@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 gnits
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
@ -223,7 +203,7 @@ bits_headers = \
${bits_srcdir}/type_traits.h \
${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_meta.h
${bits_srcdir}/valarray_meta.h
backward_srcdir = ${glibcpp_srcdir}/include/backward
@ -332,9 +312,34 @@ c_base_headers_rename = \
cwchar \
cwctype
@GLIBCPP_C_HEADERS_C_STD_TRUE@c_base_headers_extra = @GLIBCPP_C_HEADERS_C_STD_TRUE@\
@GLIBCPP_C_HEADERS_C_STD_TRUE@ ${c_base_srcdir}/cmath.tcc
# "C" compatibility headers.
c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility
c_compatibility_builddir = .
c_compatibility_headers = \
${c_compatibility_srcdir}/assert.h \
${c_compatibility_srcdir}/ctype.h \
${c_compatibility_srcdir}/errno.h \
${c_compatibility_srcdir}/float.h \
${c_compatibility_srcdir}/iso646.h \
${c_compatibility_srcdir}/limits.h \
${c_compatibility_srcdir}/locale.h \
${c_compatibility_srcdir}/math.h \
${c_compatibility_srcdir}/setjmp.h \
${c_compatibility_srcdir}/signal.h \
${c_compatibility_srcdir}/stdarg.h \
${c_compatibility_srcdir}/stddef.h \
${c_compatibility_srcdir}/stdio.h \
${c_compatibility_srcdir}/stdlib.h \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
${c_compatibility_srcdir}/wctype.h
@GLIBCPP_C_HEADERS_C_STD_TRUE@c_base_headers_extra = @GLIBCPP_C_HEADERS_C_STD_TRUE@${c_base_srcdir}/cmath.tcc
@GLIBCPP_C_HEADERS_C_STD_FALSE@c_base_headers_extra =
@GLIBCPP_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = @GLIBCPP_C_HEADERS_COMPATIBILITY_TRUE@${c_compatibility_headers}
@GLIBCPP_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra =
std_srcdir = ${glibcpp_srcdir}/include/std
std_builddir = .
@ -412,8 +417,8 @@ target_headers = \
${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h
# These extra_target_headers files are all built with ad hoc naming rules.
extra_target_headers = \
# These target_headers_extra files are all built with ad hoc naming rules.
target_headers_extra = \
${target_builddir}/basic_file.h \
${target_builddir}/c++config.h \
${target_builddir}/c++io.h \
@ -431,7 +436,9 @@ thread_target_headers = \
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \
allstamps = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
stamp-backward stamp-ext \
${target_builddir}/stamp-target
@ -445,7 +452,7 @@ uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
# components. Yes, with minor differences, this is sheer duplication
# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
# extra_target_headers are taken out of the build tree staging area;
# target_headers_extra are taken out of the build tree staging area;
# the rest are taken from the original source tree.
gxx_include_dir = @gxx_include_dir@
CONFIG_HEADER = ../config.h
@ -585,6 +592,15 @@ stamp-c_base: ${c_base_headers} ${c_base_headers_extra}
fi ;\
echo `date` > stamp-c_base
stamp-c_compatibility: ${c_compatibility_headers_extra}
@if [ ! -d "${c_compatibility_builddir}" ]; then \
mkdir -p ${c_compatibility_builddir} ;\
fi ;\
if [ ! -z "${c_compatibility_headers_extra}" ]; then \
(cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
fi ;\
echo `date` > stamp-c_compatibility
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
@ -668,17 +684,18 @@ install-data-local:
$(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
$(mkinstalldirs) ${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers_rename}; do \
$(INSTALL_DATA) ${c_base_builddir}/$${file} \
${gxx_include_dir}/${c_base_builddir}; done
c_base_headers_extra_install=${c_base_headers_extra};\
$(INSTALL_DATA) ${c_base_builddir}/$${file} ${gxx_include_dir}; done
c_base_headers_extra_install='$(c_base_headers_extra)';\
for file in $$c_base_headers_extra_install; do \
$(INSTALL_DATA) $$file ${gxx_include_dir}/${bits_builddir}; done
c_compatibility_headers_install='$(c_compatibility_headers_extra)';\
for file in $$c_compatibility_headers_install; do \
$(INSTALL_DATA) $$file ${gxx_include_dir}; done
$(mkinstalldirs) ${gxx_include_dir}/${std_builddir}
for file in ${std_headers_rename}; do \
$(INSTALL_DATA) ${std_builddir}/$${file} \
${gxx_include_dir}/${std_builddir}; done
$(INSTALL_DATA) ${std_builddir}/$${file} ${gxx_include_dir}; done
$(mkinstalldirs) ${gxx_include_dir}/${target_builddir}
for file in ${target_headers} ${extra_target_headers} \
for file in ${target_headers} ${target_headers_extra} \
${thread_target_headers}; do \
$(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done

View File

@ -1,6 +1,6 @@
// Backward-compat support -*- 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
@ -57,132 +57,118 @@
namespace std
{
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
public:
// Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
//----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
public:
// Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
public: // Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
public: // Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
strstreambuf(const unsigned char* __get, streamsize __n);
strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
virtual ~strstreambuf();
strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
strstreambuf(const unsigned char* __get, streamsize __n);
public:
void freeze(bool = true);
char* str();
int pcount() const;
virtual ~strstreambuf();
protected:
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual int_type underflow();
virtual _Base* setbuf(char* __buf, streamsize __n);
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
ios_base::openmode __mode
= ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
public: // strstreambuf operations.
void freeze(bool = true);
char* str();
int pcount() const;
private:
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
protected: // Overridden virtual member functions.
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual int_type underflow();
virtual _Base* setbuf(char* __buf, streamsize __n);
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
ios_base::openmode __mode
= ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
private: // Helper functions.
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
private:
// Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
bool _M_dynamic : 1;
bool _M_frozen : 1;
bool _M_constant : 1;
};
private: // Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
// Class istrstream, an istream that manages a strstreambuf.
class istrstream : public basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , streamsize);
istrstream(const char*, streamsize);
virtual ~istrstream();
bool _M_dynamic : 1;
bool _M_frozen : 1;
bool _M_constant : 1;
};
strstreambuf* rdbuf() const;
char* str();
//----------------------------------------------------------------------
// Class istrstream, an istream that manages a strstreambuf.
private:
strstreambuf _M_buf;
};
class istrstream : public basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , streamsize);
istrstream(const char*, streamsize);
virtual ~istrstream();
// Class ostrstream
class ostrstream : public basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
strstreambuf* rdbuf() const;
char* str();
strstreambuf* rdbuf() const;
void freeze(bool = true);
char* str();
int pcount() const;
private:
strstreambuf _M_buf;
};
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class ostrstream
// Class strstream
class strstream : public basic_iostream<char>
{
public:
typedef char char_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
class ostrstream : public basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
strstream();
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
char* str();
int pcount() const;
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class strstream
class strstream : public basic_iostream<char>
{
public:
typedef char char_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
strstream();
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
private:
strstreambuf _M_buf;
};
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
private:
strstreambuf _M_buf;
};
} // namespace std
#endif /* __SGI_STL_STRSTREAM */
// Local Variables:
// mode:C++
// End:
#endif

View File

@ -156,7 +156,7 @@ namespace std
// unformatted input and output with non-required basic_ios
// instantiations is possible even without imbuing the expected
// ctype<char_type> facet.
_M_fill = 0;
_M_fill = _CharT();
_M_fill_init = false;
_M_exception = goodbit;

View File

@ -650,8 +650,11 @@ namespace std
|| less<const _CharT*>()(_M_data() + __size, __s))
return _M_replace_safe(_M_ibegin() + __pos,
_M_ibegin() + __pos + __foldn1, __s, __s + __n2);
else return this->replace(_M_check(__pos), _M_fold(__pos, __n1),
__s, __s + __n2);
// Todo: optimized in-place replace.
else return
_M_replace(_M_ibegin() + __pos, _M_ibegin() + __pos + __foldn1,
__s, __s + __n2,
typename iterator_traits<const _CharT*>::iterator_category());
}
basic_string&
@ -685,6 +688,30 @@ namespace std
{ return _M_replace(__i1, __i2, __k1, __k2,
typename iterator_traits<_InputIterator>::iterator_category()); }
// Specializations for the common case of pointer and iterator:
// useful to avoid the overhead of temporary buffering in _M_replace.
basic_string&
replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1); }
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1); }
basic_string&
replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
private:
template<class _InputIterator>
basic_string&

View File

@ -140,7 +140,7 @@ namespace std
size_type __dnew = static_cast<size_type>(distance(__beg, __end));
// NB: Not required, but considered best practice.
if (__builtin_expect(__beg == _InIter(0), 0))
if (__builtin_expect(__beg == _InIter(), 0))
__throw_logic_error("attempt to create string with null pointer");
if (__beg == __end && __a == _Alloc())
@ -498,13 +498,10 @@ namespace std
// else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
}
// This is the general replace helper, which gets instantiated both
// for input-iterators and forward-iterators. It buffers internally and
// then calls _M_replace_safe. For input-iterators this is almost the
// best we can do, but for forward-iterators many optimizations could be
// conceived: f.i., when source and destination ranges do not overlap
// buffering is not really needed. In order to easily implement them, it
// could become useful to add an _M_replace(forward_iterator_tag)
// This is the general replace helper, which currently gets instantiated both
// for input iterators and reverse iterators. It buffers internally and then
// calls _M_replace_safe.
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIter>
basic_string<_CharT, _Traits, _Alloc>&
@ -518,10 +515,8 @@ namespace std
}
// This is a special replace helper, which does not buffer internally
// and can be used in the "safe" situations involving forward-iterators,
// and can be used in "safe" situations involving forward iterators,
// i.e., when source and destination ranges are known to not overlap.
// Presently, is called by _M_replace, by the various append and by
// the assigns.
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _ForwardIter>
basic_string<_CharT, _Traits, _Alloc>&

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__ 20020513
#define __GLIBCPP__ 20020831
// This is necessary until GCC supports separate template
// compilation.
@ -69,7 +69,15 @@
// that threads are properly configured on your platform before
// assigning blame to the STL container-memory allocator. After doing
// so, please report any possible issues to libstdc++@gcc.gnu.org .
// Do not blindly #define __USE_MALLOC here or on the command line.
// Do not define __USE_MALLOC on the command line. Enforce it here:
#ifdef __USE_MALLOC
#error __USE_MALLOC should only be defined within \
libstdc++-v3/include/bits/c++config before full recompilation of the library.
#endif
// Define __USE_MALLOC after this point in the file in order to aid debugging
// or globally change allocation policy. This breaks the ABI, thus
// completely recompile the library. A patch to better support
// changing the global allocator policy would be probably be accepted.
// The remainder of the prewritten config is mostly automatic; all the
// user hooks are listed above.

View File

@ -1,6 +1,7 @@
// Character Traits for use by standard string and iostream -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
// 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
@ -53,82 +54,53 @@ namespace std
struct char_traits
{
typedef _CharT char_type;
// Unsigned as wint_t in unsigned.
// Unsigned as wint_t is unsigned.
typedef unsigned long int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
assign(char_type& __c1, const char_type& __c2);
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
eq(const char_type& __c1, const char_type& __c2);
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
lt(const char_type& __c1, const char_type& __c2);
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
for (size_t __i = 0; __i < __n; ++__i)
if (!eq(__s1[__i], __s2[__i]))
return lt(__s1[__i], __s2[__i]) ? -1 : 1;
return 0;
}
compare(const char_type* __s1, const char_type* __s2, size_t __n);
static size_t
length(const char_type* __s)
{
const char_type* __p = __s;
while (*__p) ++__p;
return (__p - __s);
}
length(const char_type* __s);
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{
for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
if (*__p == __a) return __p;
return 0;
}
find(const char_type* __s, size_t __n, const char_type& __a);
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
move(char_type* __s1, const char_type* __s2, size_t __n);
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
copy(char_type* __s1, const char_type* __s2, size_t __n);
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{
for (char_type* __p = __s; __p < __s + __n; ++__p)
assign(*__p, __a);
return __s;
}
assign(char_type* __s, size_t __n, char_type __a);
static char_type
to_char_type(const int_type& __c)
{ return char_type(__c); }
to_char_type(const int_type& __c);
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
to_int_type(const char_type& __c);
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
eq_int_type(const int_type& __c1, const int_type& __c2);
static int_type
eof() { return static_cast<int_type>(-1); }
eof();
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
not_eof(const int_type& __c);
};

View File

@ -105,7 +105,7 @@ namespace std
bool
operator!=(const fpos& __pos) const
{ return _M_off != __pos._M_off; }
streamoff
_M_position() const { return _M_off; }

View File

@ -49,12 +49,7 @@ namespace std
_M_buf_size = _M_buf_size_opt;
// Allocate internal buffer.
try { _M_buf = new char_type[_M_buf_size]; }
catch(...)
{
delete [] _M_buf;
__throw_exception_again;
}
_M_buf = new char_type[_M_buf_size];
_M_buf_allocated = true;
}
}
@ -95,9 +90,8 @@ namespace std
{
_M_allocate_internal_buffer();
_M_mode = __mode;
// For time being, set both (in/out) sets of pointers.
_M_set_indeterminate();
if ((__mode & ios_base::ate)
&& this->seekoff(0, ios_base::end, __mode) < 0)
this->close();
@ -117,7 +111,8 @@ namespace std
{
const int_type __eof = traits_type::eof();
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
if (__testput && _M_really_overflow(__eof) == __eof)
if (__testput
&& traits_type::eq_int_type(_M_really_overflow(__eof), __eof))
return __ret;
// NB: Do this here so that re-opened filebufs will be cool...
@ -151,102 +146,7 @@ namespace std
bool __testin = _M_mode & ios_base::in;
if (__testin && this->is_open())
{
if (_M_in_cur < _M_in_end)
__ret = _M_in_end - _M_in_cur;
else
__ret = 0;
}
_M_last_overflowed = false;
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
_M_underflow_common(bool __bump)
{
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
bool __testout = _M_mode & ios_base::out;
if (__testin)
{
// Check for pback madness, and if so swich back to the
// normal buffers and jet outta here before expensive
// fileops happen...
if (_M_pback_init)
{
_M_pback_destroy();
if (_M_in_cur < _M_in_end)
return traits_type::to_int_type(*_M_in_cur);
}
// Sync internal and external buffers.
// NB: __testget -> __testput as _M_buf_unified here.
bool __testget = _M_in_cur && _M_in_beg < _M_in_cur;
bool __testinit = _M_is_indeterminate();
if (__testget)
{
if (__testout)
_M_really_overflow();
else if (_M_in_cur != _M_filepos)
_M_file.seekoff(_M_in_cur - _M_filepos,
ios_base::cur, ios_base::in);
}
if (__testinit || __testget)
{
const locale __loc = this->getloc();
const __codecvt_type& __cvt = use_facet<__codecvt_type>(__loc);
streamsize __elen = 0;
streamsize __ilen = 0;
if (__cvt.always_noconv())
{
__elen = _M_file.xsgetn(reinterpret_cast<char*>(_M_in_beg),
_M_buf_size);
__ilen = __elen;
}
else
{
char* __buf = static_cast<char*>(__builtin_alloca(_M_buf_size));
__elen = _M_file.xsgetn(__buf, _M_buf_size);
const char* __eend;
char_type* __iend;
__res_type __r = __cvt.in(_M_state_cur, __buf,
__buf + __elen, __eend, _M_in_beg,
_M_in_beg + _M_buf_size, __iend);
if (__r == codecvt_base::ok)
__ilen = __iend - _M_in_beg;
else
{
// Unwind.
__ilen = 0;
_M_file.seekoff(-__elen, ios_base::cur, ios_base::in);
}
}
if (0 < __ilen)
{
_M_set_determinate(__ilen);
if (__testout)
_M_out_cur = _M_in_cur;
__ret = traits_type::to_int_type(*_M_in_cur);
if (__bump)
_M_in_cur_move(1);
else if (_M_buf_size == 1)
{
// If we are synced with stdio, we have to unget the
// character we just read so that the file pointer
// doesn't move.
_M_file.sys_ungetc(*_M_in_cur);
_M_set_indeterminate();
}
}
}
}
__ret = _M_in_end - _M_in_cur;
_M_last_overflowed = false;
return __ret;
}
@ -410,7 +310,7 @@ namespace std
{
int_type __ret = traits_type::eof();
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
bool __testunbuffered = _M_file.is_open() && !_M_buf_size;
bool __testunbuffered = _M_file.is_open() && !_M_buf_size_opt;
if (__testput || __testunbuffered)
{

View File

@ -54,13 +54,14 @@ namespace std
__int_type __c = __sb->sgetc();
if (__in._M_check_facet(__in._M_fctype))
while (__c != __eof
&& __in._M_fctype->is(ctype_base::space, __c))
while (!traits_type::eq_int_type(__c, __eof)
&& __in._M_fctype->is(ctype_base::space,
traits_type::to_char_type(__c)))
__c = __sb->snextc();
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//195. Should basic_istream::sentry's constructor ever set eofbit?
if (__c == __eof)
if (traits_type::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
#endif
}
@ -521,7 +522,7 @@ namespace std
{
__c = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
if (__c != __eof)
if (!traits_type::eq_int_type(__c, __eof))
_M_gcount = 1;
else
this->setstate(ios_base::eofbit | ios_base::failbit);
@ -552,7 +553,7 @@ namespace std
const int_type __eof = traits_type::eof();
int_type __bufval = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
if (__bufval != __eof)
if (!traits_type::eq_int_type(__bufval, __eof))
{
_M_gcount = 1;
__c = traits_type::to_char_type(__bufval);
@ -588,13 +589,15 @@ namespace std
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
while (_M_gcount + 1 < __n && __c != __eof && __c != __idelim)
while (_M_gcount + 1 < __n
&& !traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim))
{
*__s++ = traits_type::to_char_type(__c);
__c = __sb->snextc();
++_M_gcount;
}
if (__c == __eof)
if (traits_type::eq_int_type(__c, __eof))
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
@ -627,14 +630,17 @@ namespace std
const int_type __eof = traits_type::eof();
__streambuf_type* __this_sb = this->rdbuf();
int_type __c = __this_sb->sgetc();
char_type __c2 = traits_type::to_char_type(__c);
while (__c != __eof && __c != __idelim
&& (__sb.sputc(traits_type::to_char_type(__c)) != __eof))
while (!traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim)
&& !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
{
++_M_gcount;
__c = __this_sb->snextc();
__c2 = traits_type::to_char_type(__c);
}
if (__c == __eof)
if (traits_type::eq_int_type(__c, __eof))
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
@ -667,19 +673,21 @@ namespace std
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
while (_M_gcount + 1 < __n && __c != __eof && __c != __idelim)
while (_M_gcount + 1 < __n
&& !traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim))
{
*__s++ = traits_type::to_char_type(__c);
__c = __sb->snextc();
++_M_gcount;
}
if (__c == __eof)
if (traits_type::eq_int_type(__c, __eof))
this->setstate(ios_base::eofbit);
else
{
if (__c == __idelim)
if (traits_type::eq_int_type(__c, __idelim))
{
__sb->snextc();
__sb->sbumpc();
++_M_gcount;
}
else
@ -708,27 +716,24 @@ namespace std
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb && __n > 0)
{
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
int_type __c;
__n = min(__n, numeric_limits<streamsize>::max());
while (_M_gcount < __n && __c !=__eof && __c != __delim)
while (_M_gcount < __n
&& !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof))
{
__c = __sb->snextc();
++_M_gcount;
if (traits_type::eq_int_type(__c, __delim))
break;
}
if (__c == __eof)
if (traits_type::eq_int_type(__c, __eof))
this->setstate(ios_base::eofbit);
else if (__c == __delim)
{
__sb->snextc();
++_M_gcount;
}
}
catch(exception& __fail)
{
@ -806,9 +811,8 @@ namespace std
{
try
{
const int_type __eof = traits_type::eof();
streamsize __num = this->rdbuf()->in_avail();
if (__num != static_cast<streamsize>(__eof))
if (__num > 0)
{
__num = min(__num, __n);
if (__num)
@ -843,7 +847,8 @@ namespace std
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __sb->sputbackc(__c) == __eof)
if (!__sb
|| traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
@ -873,7 +878,8 @@ namespace std
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __eof == __sb->sungetc())
if (!__sb
|| traits_type::eq_int_type(__sb->sungetc(), __eof))
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
@ -895,7 +901,7 @@ namespace std
basic_istream<_CharT, _Traits>::
sync(void)
{
int __ret = traits_type::eof();
int __ret = -1;
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
@ -903,10 +909,13 @@ namespace std
try
{
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __ret == __sb->pubsync())
this->setstate(ios_base::badbit);
else
__ret = 0;
if (__sb)
{
if (__sb->pubsync() == -1)
this->setstate(ios_base::badbit);
else
__ret = 0;
}
}
catch(exception& __fail)
{
@ -1186,16 +1195,18 @@ namespace std
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sbumpc();
const __int_type __eof = _Traits::eof();
__testdelim = __c == __idelim;
__testdelim = _Traits::eq_int_type(__c, __idelim);
while (__extracted <= __n && __c != __eof && !__testdelim)
while (__extracted <= __n
&& !_Traits::eq_int_type(__c, __eof)
&& !__testdelim)
{
__str += _Traits::to_char_type(__c);
++__extracted;
__c = __sb->sbumpc();
__testdelim = __c == __idelim;
__testdelim = _Traits::eq_int_type(__c, __idelim);
}
if (__c == __eof)
if (_Traits::eq_int_type(__c, __eof))
__in.setstate(ios_base::eofbit);
}
if (!__extracted && !__testdelim)
@ -1221,8 +1232,10 @@ namespace std
extern template istream& operator>>(istream&, unsigned char*);
extern template istream& operator>>(istream&, signed char*);
#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_istream<wchar_t>;
extern template wistream& ws(wistream&);
extern template wistream& operator>>(wistream&, wchar_t&);
extern template wistream& operator>>(wistream&, wchar_t*);
#endif
} // namespace std

View File

@ -55,6 +55,9 @@ namespace std
# define _GLIBCPP_NUM_FACETS 14
#endif
template<typename _CharT, typename _Traits>
struct __pad;
// 22.2.1.1 Template class ctype
// Include host and configuration specific ctype enums for ctype_base.
#include <bits/ctype_base.h>
@ -652,6 +655,7 @@ namespace std
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;
@ -697,6 +701,23 @@ namespace std
template<typename _CharT, typename _InIter>
locale::id num_get<_CharT, _InIter>::id;
#if 0
// Partial specialization for istreambuf_iterator, so can use traits_type.
template<typename _CharT>
class num_get<_CharT, istreambuf_iterator<_CharT> >;
iter_type
_M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
string& __xtrc) const;
iter_type
_M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
string& __xtrc, int& __base) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
#endif
template<typename _CharT, typename _OutIter>
class num_put : public locale::facet, public __num_base
{
@ -1357,8 +1378,9 @@ namespace std
{ _M_initialize_moneypunct(); }
explicit
moneypunct(__c_locale __cloc, size_t __refs = 0) : locale::facet(__refs)
{ _M_initialize_moneypunct(__cloc); }
moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
: locale::facet(__refs)
{ _M_initialize_moneypunct(__cloc, __s); }
char_type
decimal_point() const
@ -1438,7 +1460,8 @@ namespace std
// For use at construction time only.
void
_M_initialize_moneypunct(__c_locale __cloc = _S_c_locale);
_M_initialize_moneypunct(__c_locale __cloc = _S_c_locale,
const char* __name = NULL);
};
template<typename _CharT, bool _Intl>
@ -1455,11 +1478,11 @@ namespace std
template<>
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc);
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc);
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
@ -1470,11 +1493,13 @@ namespace std
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc);
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
const char*);
template<>
void
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc);
moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
const char*);
#endif
template<typename _CharT, bool _Intl>

View File

@ -94,6 +94,7 @@ namespace std
_M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
ios_base::iostate& __err, string& __xtrc) const
{
typedef char_traits<_CharT> __traits_type;
const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
@ -103,7 +104,8 @@ namespace std
const char_type __minus = __ctype.widen('-');
int __pos = 0;
char_type __c = *__beg;
if ((__c == __plus || __c == __minus) && __beg != __end)
if ((__traits_type::eq(__c, __plus) || __traits_type::eq(__c, __minus))
&& __beg != __end)
{
__xtrc += __ctype.narrow(__c, char());
++__pos;
@ -113,7 +115,7 @@ namespace std
// Next, strip leading zeros.
const char_type __zero = __ctype.widen(_S_atoms[_M_zero]);
bool __found_zero = false;
while (__c == __zero && __beg != __end)
while (__traits_type::eq(__c, __zero) && __beg != __end)
{
__c = *(++__beg);
__found_zero = true;
@ -141,11 +143,10 @@ namespace std
while (__beg != __end)
{
// Only look in digits.
typedef char_traits<_CharT> __traits_type;
const char_type* __p = __traits_type::find(__watoms, 10, __c);
// NB: strchr returns true for __c == 0x0
if (__p && __c)
if (__p && !__traits_type::eq(__c, char_type()))
{
// Try first for acceptable digit; record it if found.
++__pos;
@ -153,7 +154,8 @@ namespace std
++__sep_pos;
__c = *(++__beg);
}
else if (__c == __sep && __check_grouping && !__found_dec)
else if (__traits_type::eq(__c, __sep)
&& __check_grouping && !__found_dec)
{
// NB: Thousands separator at the beginning of a string
// is a no-no, as is two consecutive thousands separators.
@ -169,7 +171,7 @@ namespace std
break;
}
}
else if (__c == __dec && !__found_dec)
else if (__traits_type::eq(__c, __dec) && !__found_dec)
{
// According to the standard, if no grouping chars are seen,
// no grouping check is applied. Therefore __found_grouping
@ -181,7 +183,8 @@ namespace std
__c = *(++__beg);
__found_dec = true;
}
else if ((__c == __watoms[_M_e] || __c == __watoms[_M_E])
else if ((__traits_type::eq(__c, __watoms[_M_e])
|| __traits_type::eq(__c, __watoms[_M_E]))
&& !__found_sci && __pos)
{
// Scientific notation.
@ -190,7 +193,8 @@ namespace std
__c = *(++__beg);
// Remove optional plus or minus sign, if they exist.
if (__c == __plus || __c == __minus)
if (__traits_type::eq(__c, __plus)
|| __traits_type::eq(__c, __minus))
{
++__pos;
__xtrc += __ctype.narrow(__c, char());
@ -228,6 +232,7 @@ namespace std
_M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
ios_base::iostate& __err, string& __xtrc, int& __base) const
{
typedef char_traits<_CharT> __traits_type;
const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
@ -241,10 +246,13 @@ namespace std
else
__base = 10;
// First check for sign.
// First check for sign.
int __pos = 0;
char_type __c = *__beg;
if ((__c == __ctype.widen('+') || __c == __ctype.widen('-'))
const char_type __plus = __ctype.widen('+');
const char_type __minus = __ctype.widen('-');
if ((__traits_type::eq(__c, __plus) || __traits_type::eq(__c, __minus))
&& __beg != __end)
{
__xtrc += __ctype.narrow(__c, char());
@ -259,7 +267,7 @@ namespace std
if (__base == 10)
{
bool __found_zero = false;
while (__c == __zero && __beg != __end)
while (__traits_type::eq(__c, __zero) && __beg != __end)
{
__c = *(++__beg);
__found_zero = true;
@ -270,7 +278,9 @@ namespace std
++__pos;
if (__basefield == 0)
{
if ((__c == __x || __c == __X) && __beg != __end)
if ((__traits_type::eq(__c, __x)
|| __traits_type::eq(__c, __X))
&& __beg != __end)
{
__xtrc += __ctype.narrow(__c, char());
++__pos;
@ -284,12 +294,13 @@ namespace std
}
else if (__base == 16)
{
if (__c == __zero && __beg != __end)
if (__traits_type::eq(__c, __zero) && __beg != __end)
{
__xtrc += _S_atoms[_M_zero];
++__pos;
__c = *(++__beg);
if ((__c == __x || __c == __X) && __beg != __end)
if ((__traits_type::eq(__c, __x) || __traits_type::eq(__c, __X))
&& __beg != __end)
{
__xtrc += __ctype.narrow(__c, char());
++__pos;
@ -316,11 +327,10 @@ namespace std
const char_type __sep = __np.thousands_sep();
while (__beg != __end)
{
typedef char_traits<_CharT> __traits_type;
const char_type* __p = __traits_type::find(__watoms, __len, __c);
// NB: strchr returns true for __c == 0x0
if (__p && __c)
if (__p && !__traits_type::eq(__c, char_type()))
{
// Try first for acceptable digit; record it if found.
__xtrc += _S_atoms[__p - __watoms];
@ -328,7 +338,7 @@ namespace std
++__sep_pos;
__c = *(++__beg);
}
else if (__c == __sep && __check_grouping)
else if (__traits_type::eq(__c, __sep) && __check_grouping)
{
// NB: Thousands separator at the beginning of a string
// is a no-no, as is two consecutive thousands separators.
@ -394,7 +404,9 @@ namespace std
// Parse bool values as alphanumeric
else
{
typedef basic_string<_CharT> __string_type;
typedef char_traits<_CharT> __traits_type;
typedef basic_string<_CharT> __string_type;
locale __loc = __io.getloc();
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
const __string_type __true = __np.truename();
@ -407,8 +419,10 @@ namespace std
for (size_t __n = 0; __beg != __end; ++__n)
{
char_type __c = *__beg++;
bool __testf = __n <= __falsen ? __c == __falses[__n] : false;
bool __testt = __n <= __truen ? __c == __trues[__n] : false;
bool __testf = __n <= __falsen
? __traits_type::eq(__c, __falses[__n]) : false;
bool __testt = __n <= __truen
? __traits_type::eq(__c, __trues[__n]) : false;
if (!(__testf || __testt))
{
__err |= ios_base::failbit;
@ -708,6 +722,7 @@ namespace std
_M_widen_float(_OutIter __s, ios_base& __io, _CharT __fill, char* __cs,
int __len) const
{
typedef char_traits<_CharT> __traits_type;
// [22.2.2.2.2] Stage 2, convert to char_type, using correct
// numpunct.decimal_point() values for '.' and adding grouping.
const locale __loc = __io.getloc();
@ -723,7 +738,7 @@ namespace std
// Replace decimal point.
const _CharT* __p;
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
if (__p = char_traits<_CharT>::find(__ws, __len, __ctype.widen('.')))
if (__p = __traits_type::find(__ws, __len, __ctype.widen('.')))
__ws[__p - __ws] = __np.decimal_point();
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
@ -744,7 +759,7 @@ namespace std
// Tack on decimal part.
if (__p)
{
char_traits<_CharT>::copy(__p2, __p, __len - __declen);
__traits_type::copy(__p2, __p, __len - __declen);
__newlen += __len - __declen;
}
@ -816,13 +831,15 @@ namespace std
_M_insert(_OutIter __s, ios_base& __io, _CharT __fill, const _CharT* __ws,
int __len) const
{
typedef char_traits<_CharT> __traits_type;
// [22.2.2.2.2] Stage 3.
streamsize __w = __io.width();
_CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
if (__w > static_cast<streamsize>(__len))
{
__pad(__io, __fill, __ws2, __ws, __w, __len, true);
__pad<_CharT, __traits_type>::_S_pad(__io, __fill, __ws2, __ws,
__w, __len, true);
__len = static_cast<int>(__w);
// Switch strings.
__ws = __ws2;
@ -845,7 +862,7 @@ namespace std
if ((__flags & ios_base::boolalpha) == 0)
{
unsigned long __uv = __v;
__s = _M_convert_int(__s, __io, __fill, 'u', char_type(), __uv);
__s = _M_convert_int(__s, __io, __fill, 'u', char(), __uv);
}
else
{
@ -866,14 +883,14 @@ namespace std
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
{ return _M_convert_int(__s, __io, __fill, 'd', char_type(), __v); }
{ return _M_convert_int(__s, __io, __fill, 'd', char(), __v); }
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long __v) const
{ return _M_convert_int(__s, __io, __fill, 'u', char_type(), __v); }
{ return _M_convert_int(__s, __io, __fill, 'u', char(), __v); }
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _OutIter>
@ -894,7 +911,7 @@ namespace std
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
{ return _M_convert_float(__s, __io, __fill, char_type(), __v); }
{ return _M_convert_float(__s, __io, __fill, char(), __v); }
template<typename _CharT, typename _OutIter>
_OutIter
@ -915,7 +932,7 @@ namespace std
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
try
{
__s = _M_convert_int(__s, __io, __fill, 'u', char_type(),
__s = _M_convert_int(__s, __io, __fill, 'u', char(),
reinterpret_cast<unsigned long>(__v));
__io.flags(__flags);
}
@ -1591,7 +1608,7 @@ namespace std
const _CharT** __names, size_t __indexlen,
ios_base::iostate& __err) const
{
typedef char_traits<char_type> __traits_type;
typedef char_traits<_CharT> __traits_type;
int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int) * __indexlen));
size_t __nmatches = 0;
size_t __pos = 0;
@ -1686,7 +1703,7 @@ namespace std
do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, tm* __tm) const
{
typedef char_traits<char_type> __traits_type;
typedef char_traits<_CharT> __traits_type;
locale __loc = __io.getloc();
__timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
const char_type* __days[7];
@ -1729,7 +1746,7 @@ namespace std
do_get_monthname(iter_type __beg, iter_type __end,
ios_base& __io, ios_base::iostate& __err, tm* __tm) const
{
typedef char_traits<char_type> __traits_type;
typedef char_traits<_CharT> __traits_type;
locale __loc = __io.getloc();
__timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
const char_type* __months[12];
@ -1959,12 +1976,14 @@ namespace std
_Tv __v, const __c_locale&, int __prec = -1)
{
int __ret;
const char* __old = setlocale(LC_ALL, "C");
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
@ -1974,12 +1993,14 @@ namespace std
const __c_locale&, int __prec = -1)
{
int __ret;
const char* __old = setlocale(LC_ALL, "C");
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
@ -1992,22 +2013,31 @@ namespace std
// internal-adjusted objects are padded according to the rules below
// concerning 0[xX] and +-, otherwise, exactly as right-adjusted
// ones are.
template<typename _CharT, typename _Traits>
void
__pad(ios_base& __io, _CharT __fill, _CharT* __news, const _CharT* __olds,
const streamsize __newlen, const streamsize __oldlen,
const bool __num)
{
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
int_type __plen = static_cast<size_t>(__newlen - __oldlen);
char_type* __pads = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __plen));
traits_type::assign(__pads, __plen, __fill);
char_type* __beg;
char_type* __end;
// NB: Of the two parameters, _CharT can be deduced from the
// function arguments. The other (_Traits) has to be explicitly specified.
template<typename _CharT, typename _Traits>
struct __pad
{
static void
_S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
const _CharT* __olds, const streamsize __newlen,
const streamsize __oldlen, const bool __num);
};
template<typename _CharT, typename _Traits>
void
__pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
_CharT* __news, const _CharT* __olds,
const streamsize __newlen,
const streamsize __oldlen, const bool __num)
{
size_t __plen = static_cast<size_t>(__newlen - __oldlen);
_CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __plen));
_Traits::assign(__pads, __plen, __fill);
_CharT* __beg;
_CharT* __end;
size_t __mod = 0;
size_t __beglen; //either __plen or __oldlen
ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
@ -2015,7 +2045,7 @@ namespace std
if (__adjust == ios_base::left)
{
// Padding last.
__beg = const_cast<char_type*>(__olds);
__beg = const_cast<_CharT*>(__olds);
__beglen = __oldlen;
__end = __pads;
}
@ -2026,12 +2056,14 @@ namespace std
// Who came up with these rules, anyway? Jeeze.
locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const char_type __minus = __ctype.widen('-');
const char_type __plus = __ctype.widen('+');
bool __testsign = __olds[0] == __minus || __olds[0] == __plus;
bool __testhex = __ctype.widen('0') == __olds[0]
&& (__ctype.widen('x') == __olds[1]
|| __ctype.widen('X') == __olds[1]);
const _CharT __minus = __ctype.widen('-');
const _CharT __plus = __ctype.widen('+');
bool __testsign = _Traits::eq(__olds[0], __minus)
|| _Traits::eq(__olds[0], __plus);
bool __testhex = _Traits::eq(__ctype.widen('0'), __olds[0])
&& (_Traits::eq(__ctype.widen('x'), __olds[1])
|| _Traits::eq(__ctype.widen('X'), __olds[1]));
if (__testhex)
{
__news[0] = __olds[0];
@ -2040,23 +2072,23 @@ namespace std
__news += 2;
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds + __mod);
__end = const_cast<_CharT*>(__olds + __mod);
}
else if (__testsign)
{
__news[0] = __olds[0] == __plus ? __plus : __minus;
_Traits::eq((__news[0] = __olds[0]), __plus) ? __plus : __minus;
++__mod;
++__news;
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds + __mod);
__end = const_cast<_CharT*>(__olds + __mod);
}
else
{
// Padding first.
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds);
__end = const_cast<_CharT*>(__olds);
}
}
else
@ -2064,23 +2096,11 @@ namespace std
// Padding first.
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds);
__end = const_cast<_CharT*>(__olds);
}
traits_type::copy(__news, __beg, __beglen);
traits_type::copy(__news + __beglen, __end, __newlen - __beglen - __mod);
}
// NB: Can't have default argument on non-member template, and
// num_put doesn't have a _Traits template parameter, so this
// forwarding template adds in the default template argument.
template<typename _CharT>
void
__pad(ios_base& __io, _CharT __fill, _CharT* __news, const _CharT* __olds,
const streamsize __newlen, const streamsize __oldlen,
const bool __num)
{
return __pad<_CharT, char_traits<_CharT> >(__io, __fill, __news, __olds,
__newlen, __oldlen, __num);
_Traits::copy(__news, __beg, __beglen);
_Traits::copy(__news + __beglen, __end,
__newlen - __beglen - __mod);
}
// Used by both numeric and monetary facets.
@ -2397,5 +2417,3 @@ namespace std
} // namespace std
#endif

View File

@ -119,19 +119,11 @@ namespace std
basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sbin)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb && __sbin)
{
try
{
streamsize __xtrct = 0;
if (__sbin)
{
__streambuf_type* __sbout = this->rdbuf();
__xtrct = __copy_streambufs(*this, __sbin, __sbout);
}
else
this->setstate(ios_base::badbit);
if (!__xtrct)
if (!__copy_streambufs(*this, __sbin, this->rdbuf()))
this->setstate(ios_base::failbit);
}
catch(exception& __fail)
@ -143,6 +135,8 @@ namespace std
__throw_exception_again;
}
}
else if (!__sbin)
this->setstate(ios_base::badbit);
return *this;
}
@ -480,7 +474,8 @@ namespace std
streamsize __len = 1;
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, &__c, __w, __len, false);
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __pads,
&__c, __w, __len, false);
__len = __w;
}
__out.write(__pads, __len);
@ -515,7 +510,8 @@ namespace std
streamsize __len = 1;
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, &__c, __w, __len, false);
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __pads,
&__c, __w, __len, false);
__len = __w;
}
__out.write(__pads, __len);
@ -539,7 +535,7 @@ namespace std
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
if (__cerb && __s)
{
try
{
@ -548,7 +544,8 @@ namespace std
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, __s, __w, __len, false);
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __pads,
__s, __w, __len, false);
__s = __pads;
__len = __w;
}
@ -564,6 +561,8 @@ namespace std
__throw_exception_again;
}
}
else if (!__s)
__out.setstate(ios_base::badbit);
return __out;
}
@ -575,14 +574,14 @@ namespace std
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 167. Improper use of traits_type::length()
// Note that this is only in 'Review' status.
typedef char_traits<char> __ctraits_type;
typedef char_traits<char> __traits_type;
#endif
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
if (__cerb && __s)
{
size_t __clen = __ctraits_type::length(__s);
size_t __clen = __traits_type::length(__s);
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * (__clen + 1)));
for (size_t __i = 0; __i <= __clen; ++__i)
for (size_t __i = 0; __i < __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws;
@ -594,7 +593,8 @@ namespace std
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, __ws, __w, __len, false);
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __pads,
__ws, __w, __len, false);
__str = __pads;
__len = __w;
}
@ -610,6 +610,8 @@ namespace std
__throw_exception_again;
}
}
else if (!__s)
__out.setstate(ios_base::badbit);
return __out;
}
@ -620,16 +622,18 @@ namespace std
{
typedef basic_ostream<char, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
if (__cerb && __s)
{
try
{
streamsize __w = __out.width();
char* __pads = static_cast<char*>(__builtin_alloca(__w));
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, __s, __w, __len, false);
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __pads,
__s, __w, __len, false);
__s = __pads;
__len = __w;
}
@ -645,6 +649,8 @@ namespace std
__throw_exception_again;
}
}
else if (!__s)
__out.setstate(ios_base::badbit);
return __out;
}
@ -667,7 +673,8 @@ namespace std
#endif
if (__w > __len)
{
__pad(__out, __out.fill(), __pads, __s, __w, __len, false);
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __pads, __s,
__w, __len, false);
__s = __pads;
__len = __w;
}
@ -693,6 +700,7 @@ namespace std
extern template ostream& operator<<(ostream&, const unsigned char*);
extern template ostream& operator<<(ostream&, const signed char*);
#ifdef _GLIBCPP_USE_WCHAR_T
extern template class basic_ostream<wchar_t>;
extern template wostream& endl(wostream&);
extern template wostream& ends(wostream&);
@ -701,4 +709,5 @@ namespace std
extern template wostream& operator<<(wostream&, char);
extern template wostream& operator<<(wostream&, const wchar_t*);
extern template wostream& operator<<(wostream&, const char*);
#endif
} // namespace std

View File

@ -95,13 +95,13 @@ namespace std
__len *= 2;
if (__testwrite)
__ret = this->sputc(__c);
__ret = this->sputc(traits_type::to_char_type(__c));
else if (__len <= _M_string.max_size())
{
// Force-allocate, re-sync.
_M_string = this->str();
_M_string.reserve(__len);
_M_buf_size = static_cast<int_type>(__len);
_M_buf_size = __len;
_M_really_sync(_M_in_cur - _M_in_beg,
_M_out_cur - _M_out_beg);
*_M_out_cur = traits_type::to_char_type(__c);
@ -184,7 +184,7 @@ namespace std
if (_M_buf_size)
{
off_type __pos = __sp._M_position();
off_type __pos = __sp; // Use streamoff operator to do conversion.
char_type* __beg = NULL;
char_type* __end = NULL;
bool __testin = (ios_base::in & _M_mode & __mode) != 0;

View File

@ -166,7 +166,7 @@ struct _Bit_iterator : public _Bit_iterator_base
_Bit_iterator(_Bit_type * __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) {}
reference operator*() const { return reference(_M_p, 1U << _M_offset); }
reference operator*() const { return reference(_M_p, 1UL << _M_offset); }
iterator& operator++() {
_M_bump_up();
return *this;
@ -223,7 +223,7 @@ struct _Bit_const_iterator : public _Bit_iterator_base
: _Bit_iterator_base(__x._M_p, __x._M_offset) {}
const_reference operator*() const {
return _Bit_reference(_M_p, 1U << _M_offset);
return _Bit_reference(_M_p, 1UL << _M_offset);
}
const_iterator& operator++() {
_M_bump_up();

View File

@ -130,11 +130,6 @@ struct _Deque_iterator
reference operator*() const { return *_M_cur; }
pointer operator->() const { return _M_cur; }
difference_type operator-(const _Self& __x) const {
return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
(_M_cur - _M_first) + (__x._M_last - __x._M_cur);
}
_Self& operator++() {
++_M_cur;
if (_M_cur == _M_last) {
@ -194,16 +189,6 @@ struct _Deque_iterator
reference operator[](difference_type __n) const { return *(*this + __n); }
bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; }
bool operator!=(const _Self& __x) const { return !(*this == __x); }
bool operator<(const _Self& __x) const {
return (_M_node == __x._M_node) ?
(_M_cur < __x._M_cur) : (_M_node < __x._M_node);
}
bool operator>(const _Self& __x) const { return __x < *this; }
bool operator<=(const _Self& __x) const { return !(__x < *this); }
bool operator>=(const _Self& __x) const { return !(*this < __x); }
/** @if maint
* Prepares to traverse new_node. Sets everything except _M_cur, which
* should therefore be set by the caller immediately afterwards, based on
@ -217,6 +202,123 @@ struct _Deque_iterator
}
};
// Note: we also provide overloads whose operands are of the same type in
// order to avoid ambiguos overload resolution when std::rel_ops operators
// are in scope (for additional details, see libstdc++/3628)
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return __x._M_cur == __y._M_cur;
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return __x._M_cur == __y._M_cur;
}
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return !(__x == __y);
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return !(__x == __y);
}
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return (__x._M_node == __y._M_node) ?
(__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return (__x._M_node == __y._M_node) ?
(__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
}
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return __y < __x;
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return __y < __x;
}
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return !(__y < __x);
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return !(__y < __x);
}
template <class _Tp, class _Ref, class _Ptr>
inline bool
operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
{
return !(__x < __y);
}
template <class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR>
inline bool
operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return !(__x < __y);
}
// _GLIBCPP_RESOLVE_LIB_DEFECTS
// According to the resolution of DR179 not only the various comparison
// operators but also operator- must accept mixed iterator/const_iterator
// parameters.
template <typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
{
return _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
(_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size()) *
(__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first) +
(__y._M_last - __y._M_cur);
}
template <class _Tp, class _Ref, class _Ptr>
inline _Deque_iterator<_Tp, _Ref, _Ptr>
operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)

View File

@ -629,10 +629,6 @@ namespace __gnu_cxx
operator-(const difference_type& __n) const
{ return __normal_iterator(_M_current - __n); }
difference_type
operator-(const __normal_iterator& __i) const
{ return _M_current - __i._M_current; }
const _Iterator&
base() const { return _M_current; }
};
@ -719,6 +715,16 @@ namespace __gnu_cxx
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() >= __rhs.base(); }
// _GLIBCPP_RESOLVE_LIB_DEFECTS
// According to the resolution of DR179 not only the various comparison
// operators but also operator- must accept mixed iterator/const_iterator
// parameters.
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline typename __normal_iterator<_IteratorL, _Container>::difference_type
operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Container>
inline __normal_iterator<_Iterator, _Container>
operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n,

View File

@ -95,7 +95,7 @@ inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
return __x.first == __y.first && __x.second == __y.second;
}
/// http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html#pairlt
/// <http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html#pairlt>
template <class _T1, class _T2>
inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{

View File

@ -40,7 +40,7 @@
namespace std
{
template<typename _CharT, typename _Traits>
const typename basic_streambuf<_CharT, _Traits>::int_type
const size_t
basic_streambuf<_CharT, _Traits>::_S_pback_size;
template<typename _CharT, typename _Traits>
@ -138,7 +138,7 @@ namespace std
if (__ret < __n)
{
int_type __c = this->uflow();
if (__c != traits_type::eof())
if (!traits_type::eq_int_type(__c, traits_type::eof()))
{
traits_type::assign(*__s++, traits_type::to_char_type(__c));
++__ret;
@ -177,7 +177,7 @@ namespace std
if (__ret < __n)
{
int_type __c = this->overflow(traits_type::to_int_type(*__s));
if (__c != traits_type::eof())
if (!traits_type::eq_int_type(__c, traits_type::eof()))
{
++__ret;
++__s;
@ -214,7 +214,7 @@ namespace std
__sbin->_M_in_cur_move(__xtrct);
if (__xtrct == __bufsize)
{
if (__sbin->sgetc() == _Traits::eof())
if (_Traits::eq_int_type(__sbin->sgetc(), _Traits::eof()))
break;
__bufsize = __sbin->in_avail();
}

View File

@ -69,13 +69,13 @@ namespace std
public:
istreambuf_iterator() throw()
: _M_sbuf(0), _M_c(-2) { }
: _M_sbuf(0), _M_c(traits_type::eof()) { }
istreambuf_iterator(istream_type& __s) throw()
: _M_sbuf(__s.rdbuf()), _M_c(-2) { }
: _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
istreambuf_iterator(streambuf_type* __s) throw()
: _M_sbuf(__s), _M_c(-2) { }
: _M_sbuf(__s), _M_c(traits_type::eof()) { }
// NB: The result of operator*() on an end of stream is undefined.
char_type
@ -85,21 +85,25 @@ namespace std
istreambuf_iterator&
operator++()
{
if (_M_sbuf && _M_sbuf->sbumpc() == traits_type::eof())
const int_type __eof = traits_type::eof();
if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof))
_M_sbuf = 0;
else
_M_c = -2;
_M_c = __eof;
return *this;
}
istreambuf_iterator
operator++(int)
{
const int_type __eof = traits_type::eof();
istreambuf_iterator __old = *this;
if (_M_sbuf && (__old._M_c = _M_sbuf->sbumpc()) == traits_type::eof())
if (_M_sbuf
&& traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()),
__eof))
_M_sbuf = 0;
else
_M_c = -2;
_M_c = __eof;
return __old;
}
@ -110,8 +114,8 @@ namespace std
equal(const istreambuf_iterator& __b) const
{
const int_type __eof = traits_type::eof();
bool __thiseof = _M_get() == __eof;
bool __beof = __b._M_get() == __eof;
bool __thiseof = traits_type::eq_int_type(_M_get(), __eof);
bool __beof = traits_type::eq_int_type(__b._M_get(), __eof);
return (__thiseof && __beof || (!__thiseof && !__beof));
}
#endif
@ -120,13 +124,14 @@ namespace std
int_type
_M_get() const
{
int_type __ret = traits_type::eof();
const int_type __eof = traits_type::eof();
int_type __ret = __eof;
if (_M_sbuf)
{
if (_M_c != static_cast<int_type>(-2))
if (!traits_type::eq_int_type(_M_c, __eof))
__ret = _M_c;
else
if ((__ret = _M_sbuf->sgetc()) == traits_type::eof())
if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()), __eof))
_M_sbuf = 0;
}
return __ret;

View File

@ -31,6 +31,15 @@
// ISO C++ 14882: 19.3 Error numbers
//
/** @file cerrno
* This is a Standard C++ Library file. You should @c #include this file
* in your programs, rather than any of the "*.h" implementation files.
*
* This is the C++ version of the Standard C Library header @c errno.h,
* and its contents are (mostly) the same as that header, but are all
* contained in the namespace @c std.
*/
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
@ -38,4 +47,9 @@
#include_next <errno.h>
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef errno
#define errno errno
#endif
#endif

View File

@ -36,6 +36,89 @@
#pragma GCC system_header
#include <bits/c++config.h>
#include_next <math.h>
// Get rid of those macros defined in <math.h> in lieu of real functions.
#undef abs
#undef div
#undef acos
#undef asin
#undef atan
#undef atan2
#undef ceil
#undef cos
#undef cosh
#undef exp
#undef fabs
#undef floor
#undef fmod
#undef frexp
#undef ldexp
#undef log
#undef log10
#undef modf
#undef pow
#undef sin
#undef sinh
#undef sqrt
#undef tan
#undef tanh
#undef fpclassify
#undef isfinite
#undef isinf
#undef isnan
#undef isnormal
#undef signbit
#undef isgreater
#undef isgreaterequal
#undef isless
#undef islessequal
#undef islessgreater
#undef isunordered
namespace std
{
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
#if _GLIBCPP_HAVE_MODFF
inline float
modf(float __x, float* __iptr) { return modff(__x, __iptr); }
#else
inline float
modf(float __x, float* __iptr)
{
double __tmp;
double __res = modf(static_cast<double>(__x), &__tmp);
*__iptr = static_cast<float>(__tmp);
return __res;
}
#endif
#if _GLIBCPP_HAVE_MODFL
inline long double
modf(long double __x, long double* __iptr) { return modfl(__x, __iptr); }
#else
inline long double
modf(long double __x, long double* __iptr)
{
double __tmp;
double __res = modf(static_cast<double>(__x), &__tmp);
* __iptr = static_cast<long double>(__tmp);
return __res;
}
#endif
}
#endif

View File

@ -38,4 +38,12 @@
#include_next <setjmp.h>
// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
#undef longjmp
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef setjmp
#define setjmp(env) std::setjmp (env)
#endif
#endif

View File

@ -36,6 +36,7 @@
#pragma GCC system_header
#undef __need___va_list
#include_next <stdarg.h>
#endif

View File

@ -36,6 +36,10 @@
#pragma GCC system_header
#define __need_size_t
#define __need_ptrdiff_t
#define __need_NULL
#define __need_offsetof
#include_next <stddef.h>
#endif

View File

@ -38,4 +38,47 @@
#include_next <stdio.h>
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
#undef clearerr
#undef fclose
#undef feof
#undef ferror
#undef fflush
#undef fgetc
#undef fgetpos
#undef fgets
#undef fopen
#undef fprintf
#undef fputc
#undef fputs
#undef fread
#undef freopen
#undef fscanf
#undef fseek
#undef fsetpos
#undef ftell
#undef fwrite
#undef getc
#undef getchar
#undef gets
#undef perror
#undef printf
#undef putc
#undef putchar
#undef puts
#undef remove
#undef rename
#undef rewind
#undef scanf
#undef setbuf
#undef setvbuf
#undef sprintf
#undef sscanf
#undef tmpfile
#undef tmpnam
#undef ungetc
#undef vfprintf
#undef vprintf
#undef vsprintf
#endif

View File

@ -36,6 +36,27 @@
#pragma GCC system_header
#include <bits/c++config.h>
#include <cstddef>
#include <ctime>
#if _GLIBCPP_HAVE_WCHAR_H
#include_next <wchar.h>
#endif
// Need to do a bit of trickery here with mbstate_t as char_traits
// assumes it is in wchar.h, regardless of wchar_t specializations.
#ifndef _GLIBCPP_HAVE_MBSTATE_T
namespace std
{
extern "C"
{
typedef struct
{
int __fill[6];
} mbstate_t;
}
}
#endif
#endif

View File

@ -36,6 +36,10 @@
#pragma GCC system_header
#include <bits/c++config.h>
#if _GLIBCPP_HAVE_WCTYPE_H
#include_next <wctype.h>
#endif
#endif

View File

@ -0,0 +1,30 @@
// -*- C++ -*- compatibility header.
// 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.
#include <cassert>

View File

@ -0,0 +1,49 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_CTYPE_H_
#define _CPP_CTYPE_H_ 1
#include <cctype>
using std::isalnum;
using std::isalpha;
using std::iscntrl;
using std::isdigit;
using std::isgraph;
using std::islower;
using std::isprint;
using std::ispunct;
using std::isspace;
using std::isupper;
using std::isxdigit;
using std::tolower;
using std::toupper;
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,74 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_MATH_H_
#define _CPP_MATH_H_ 1
#include <cmath>
using std::abs;
using std::acos;
using std::asin;
using std::atan;
using std::atan2;
using std::cos;
using std::sin;
using std::tan;
using std::cosh;
using std::sinh;
using std::tanh;
using std::exp;
using std::frexp;
using std::ldexp;
using std::log;
using std::log10;
using std::modf;
using std::pow;
using std::sqrt;
using std::ceil;
using std::fabs;
using std::floor;
using std::fmod;
#if _GLIBCPP_USE_C99
using std::fpclassify;
using std::isfinite;
using std::isinf;
using std::isnan;
using std::isnormal;
using std::signbit;
using std::isgreater;
using std::isgreaterequal;
using std::isless;
using std::islessequal;
using std::islessgreater;
using std::isunordered;
#endif
#endif

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,85 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_STDIO_H_
#define _CPP_STDIO_H_ 1
#include <cstdio>
using std::FILE;
using std::fpos_t;
using std::remove;
using std::rename;
using std::tmpfile;
using std::tmpnam;
using std::fclose;
using std::fflush;
using std::fopen;
using std::freopen;
using std::setbuf;
using std::setvbuf;
using std::fprintf;
using std::fscanf;
using std::printf;
using std::scanf;
using std::snprintf;
using std::sprintf;
using std::sscanf;
using std::vfprintf;
using std::vfscanf;
using std::vprintf;
using std::vscanf;
using std::vsnprintf;
using std::vsprintf;
using std::vsscanf;
using std::fgetc;
using std::fgets;
using std::fputc;
using std::fputs;
using std::getc;
using std::getchar;
using std::gets;
using std::putc;
using std::putchar;
using std::puts;
using std::ungetc;
using std::fread;
using std::fwrite;
using std::fgetpos;
using std::fseek;
using std::fsetpos;
using std::ftell;
using std::rewind;
using std::clearerr;
using std::feof;
using std::ferror;
using std::perror;
#endif

View File

@ -0,0 +1,67 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_STDLIB_H_
#define _CPP_STDLIB_H_ 1
#include <cstdlib>
using std::div_t;
using std::ldiv_t;
using std::abort;
using std::abs;
using std::atexit;
using std::atof;
using std::atoi;
using std::atol;
using std::bsearch;
using std::calloc;
using std::div;
using std::exit;
using std::free;
using std::getenv;
using std::labs;
using std::ldiv;
using std::malloc;
using std::mblen;
using std::mbstowcs;
using std::mbtowc;
using std::qsort;
using std::rand;
using std::realloc;
using std::srand;
using std::strtod;
using std::strtol;
using std::strtoul;
using std::system;
using std::wcstombs;
using std::wctomb;
#endif

View File

@ -0,0 +1,58 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_STRING_H_
#define _CPP_STRING_H_ 1
#include <cstring>
using std::memcpy;
using std::memmove;
using std::strcpy;
using std::strncpy;
using std::strcat;
using std::strncat;
using std::memcmp;
using std::strcmp;
using std::strcoll;
using std::strncmp;
using std::strxfrm;
using std::memchr;
using std::strchr;
using std::strcspn;
using std::strpbrk;
using std::strrchr;
using std::strspn;
using std::strstr;
using std::strtok;
using std::memset;
using std::strerror;
using std::strlen;
#endif

View File

@ -0,0 +1,60 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_TIME_H_
#define _CPP_TIME_H_ 1
#include <ctime>
// Get rid of those macros defined in <time.h> in lieu of real functions.
#undef clock
#undef difftime
#undef mktime
#undef time
#undef asctime
#undef ctime
#undef gmtime
#undef localtime
#undef strftime
using std::clock_t;
using std::time_t;
using std::tm;
using std::clock;
using std::difftime;
using std::mktime;
using std::time;
using std::asctime;
using std::ctime;
using std::gmtime;
using std::localtime;
using std::strftime;
#endif

View File

@ -0,0 +1,106 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_WCHAR_H_
#define _CPP_WCHAR_H_ 1
#include <cwchar>
using std::mbstate_t;
#if _GLIBCPP_USE_WCHAR_T
using std::wint_t;
using std::btowc;
using std::wctob;
using std::fgetwc;
using std::fgetwc;
using std::fgetws;
using std::fputwc;
using std::fputws;
using std::fwide;
using std::fwprintf;
using std::fwscanf;
using std::swprintf;
using std::swscanf;
using std::vfwprintf;
using std::vfwscanf;
using std::vswprintf;
using std::vswscanf;
using std::vwprintf;
using std::vwscanf;
using std::wprintf;
using std::wscanf;
using std::getwc;
using std::getwchar;
using std::mbsinit;
using std::mbrlen;
using std::mbrtowc;
using std::mbsrtowcs;
using std::wcsrtombs;
using std::putwc;
using std::putwchar;
using std::ungetwc;
using std::wcrtomb;
using std::wcstod;
using std::wcstof;
using std::wcstol;
using std::wcstoul;
using std::wcscpy;
using std::wcsncpy;
using std::wcscat;
using std::wcsncat;
using std::wcscmp;
using std::wcscoll;
using std::wcsncmmp;
using std::wcsxfrm;
using std::wcschr;
using std::wcscspn;
using std::wcslen;
using std::wcspbrk;
using std::wcsrchr;
using std::wcsspn;
using std::wcsstr;
using std::wcstok;
using std::wmemchr;
using std::wmemcmp;
using std::wmemcpy;
using std::wmemmove;
using std::wmemset;
using std::wcsftime;
#if _GLIBCPP_USE_C99
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
#endif
#endif //_GLIBCPP_USE_WCHAR_T
#endif

View File

@ -0,0 +1,55 @@
// -*- C++ -*- compatibility header.
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_CWCTYPE_H_
#define _CPP_CWCTYPE_H_ 1
#include <cwctype>
using std::wctype_t;
using std::wctrans_t;
using std::iswalpha;
using std::iswupper;
using std::iswlower;
using std::iswdigit;
using std::iswxdigit;
using std::iswalnum;
using std::iswspace;
using std::iswpunct;
using std::iswprint;
using std::iswgraph;
using std::iswcntrl;
using std::iswctype;
using std::towctrans;
using std::towlower;
using std::towupper;
using std::wctrans;
using std::wctype;
#endif

View File

@ -82,13 +82,6 @@ namespace std
// an `exported' forward declaration.
template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int);
template<typename _Tp>
inline _Tp
__cmath_abs(_Tp __x)
{
return __x < _Tp() ? -__x : __x;
}
inline double
abs(double __x)
{ return __builtin_fabs(__x); }

View File

@ -247,6 +247,11 @@ namespace __gnu_cxx
// random_sample and random_sample_n (extensions, not part of the standard).
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _ForwardIter, typename _OutputIter, typename _Distance>
_OutputIter
random_sample_n(_ForwardIter __first, _ForwardIter __last,
@ -273,6 +278,11 @@ namespace __gnu_cxx
return __out;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _ForwardIter, typename _OutputIter, typename _Distance,
typename _RandomNumberGenerator>
_OutputIter
@ -353,6 +363,11 @@ namespace __gnu_cxx
return __out + __m;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _InputIter, typename _RandomAccessIter>
inline _RandomAccessIter
random_sample(_InputIter __first, _InputIter __last,
@ -367,6 +382,11 @@ namespace __gnu_cxx
__out_first, __out_last - __out_first);
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _InputIter, typename _RandomAccessIter,
typename _RandomNumberGenerator>
inline _RandomAccessIter
@ -418,6 +438,11 @@ namespace __gnu_cxx
return true;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _RandomAccessIter>
inline bool
is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
@ -430,6 +455,11 @@ namespace __gnu_cxx
return __is_heap(__first, __last - __first);
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _RandomAccessIter, typename _StrictWeakOrdering>
inline bool
is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
@ -448,6 +478,11 @@ namespace __gnu_cxx
// nondescending order. This is an extension, not part of the C++
// standard.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _ForwardIter>
bool
is_sorted(_ForwardIter __first, _ForwardIter __last)
@ -469,6 +504,11 @@ namespace __gnu_cxx
return true;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _ForwardIter, typename _StrictWeakOrdering>
bool
is_sorted(_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp)

View File

@ -83,7 +83,11 @@ class hash_map;
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&,
const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&);
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class _Alloc>
class hash_map
@ -235,6 +239,11 @@ inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2);
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multimap
{

View File

@ -85,6 +85,11 @@ inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set
{
@ -236,6 +241,11 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2);
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multiset
{

View File

@ -93,6 +93,11 @@ namespace __gnu_cxx
__n += __last - __first;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _InputIterator, typename _Distance>
inline void
distance(_InputIterator __first, _InputIterator __last,

View File

@ -105,11 +105,21 @@ namespace __gnu_cxx
// Alias for the internal name __power. Note that power is an extension,
// not part of the C++ standard.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _Tp, typename _Integer, typename _MonoidOperation>
inline _Tp
power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
{ return __power(__x, __n, __monoid_op); }
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _Tp, typename _Integer>
inline _Tp
power(_Tp __x, _Integer __n)
@ -117,6 +127,11 @@ namespace __gnu_cxx
// iota is not part of the C++ standard. It is an extension.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template<typename _ForwardIter, typename _Tp>
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)

View File

@ -73,6 +73,11 @@ using std::allocator;
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>

View File

@ -295,6 +295,11 @@ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
return __last_node;
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Tp, class _Alloc = allocator<_Tp> >
class slist : private _Slist_base<_Tp,_Alloc>
{

View File

@ -27,10 +27,27 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file ext/stdio_filebuf.h
* This file is a GNU extension to the Standard C++ Library.
*/
#ifndef _EXT_STDIO_FILEBUF
#define _EXT_STDIO_FILEBUF
#pragma GCC system_header
#include <fstream>
namespace __gnu_cxx
{
/**
* @class stdio_filebuf ext/stdio_filebuf.h <ext/stdio_filebuf.h>
* @brief Provides a layer of compatibility for C/POSIX.
*
* This GNU extension provides extensions for working with standard C
* FILE*'s and POSIX file descriptors. It must be instantiated by the
* user with the type of character used in the file stream, e.g.,
* stdio_filebuf<char>.
*/
template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
class stdio_filebuf : public std::basic_filebuf<_CharT, _Traits>
{
@ -47,15 +64,47 @@ namespace __gnu_cxx
char_type _M_unbuf[4];
public:
/**
* @param fd An open file descriptor.
* @param mode Same meaning as in a standard filebuf.
* @param del Whether to close the file on destruction.
* @param size Optimal or preferred size of internal buffer, in bytes.
*
* This constructor associates a file stream buffer with an open
* POSIX file descriptor. Iff @a del is true, then the associated
* file will be closed when the stdio_filebuf is closed/destroyed.
*/
stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del,
int_type __size);
/**
* @param f An open @c FILE*.
* @param mode Same meaning as in a standard filebuf.
* @param size Optimal or preferred size of internal buffer, in bytes.
* Defaults to system's @c BUFSIZ.
*
* This constructor associates a file stream buffer with an open
* C @c FILE*. The @c FILE* will not be automatically closed when the
* stdio_filebuf is closed/destroyed.
*/
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
int_type __size = static_cast<int_type>(BUFSIZ));
/**
* Possibly closes the external data stream, in the case of the file
* descriptor constructor and @c del @c == @c true.
*/
virtual
~stdio_filebuf();
/**
* @return The underlying file descriptor.
*
* Once associated with an external data stream, this function can be
* used to access the underlying POSIX file descriptor. Note that
* there is no way for the library to track what you do with the
* descriptor, so be careful.
*/
int
fd()
{ return _M_file.fd(); }
@ -74,16 +123,18 @@ namespace __gnu_cxx
if (this->is_open())
{
_M_mode = __mode;
_M_buf_size_opt = __size;
if (__size > 0 && __size < 4)
{
// Specify unbuffered.
_M_buf = _M_unbuf;
_M_buf_size = __size;
_M_buf_size_opt = 0;
}
else
_M_allocate_internal_buffer();
{
_M_buf_size_opt = __size;
_M_allocate_internal_buffer();
}
_M_set_indeterminate();
}
}
@ -97,17 +148,21 @@ namespace __gnu_cxx
if (this->is_open())
{
_M_mode = __mode;
_M_buf_size_opt = __size;
if (__size > 0 && __size < 4)
{
// Specify unbuffered.
_M_buf = _M_unbuf;
_M_buf_size = __size;
_M_buf_size_opt = 0;
}
else
_M_allocate_internal_buffer();
{
_M_buf_size_opt = __size;
_M_allocate_internal_buffer();
}
_M_set_indeterminate();
}
}
} // namespace __gnu_cxx
#endif /* _EXT_STDIO_FILEBUF */

View File

@ -610,11 +610,28 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
_Node* __cur1 = __ht1._M_buckets[__n];
_Node* __cur2 = __ht2._M_buckets[__n];
for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
// Check same length of lists
for ( ; __cur1 && __cur2;
__cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
{}
if (__cur1 || __cur2)
return false;
// Now check one's elements are in the other
for (__cur1 = __ht1._M_buckets[__n] ; __cur1; __cur1 = __cur1->_M_next)
{
bool _found__cur1 = false;
for (_Node* __cur2 = __ht2._M_buckets[__n];
__cur2; __cur2 = __cur2->_M_next)
{
if (__cur1->_M_val == __cur2->_M_val)
{
_found__cur1 = true;
break;
}
}
if (!_found__cur1)
return false;
}
}
return true;
}

View File

@ -1238,6 +1238,11 @@ struct _Rope_base
};
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _CharT, class _Alloc>
class rope : public _Rope_base<_CharT,_Alloc> {
public:

View File

@ -61,7 +61,7 @@
#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
#define _GLIBCPP_BITSET_WORDS(__n) \
((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
((__n) < 1 ? 0 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
namespace std
{
@ -463,6 +463,101 @@ namespace std
_M_do_find_next(size_t __prev, size_t __not_found) const;
};
/**
* @if maint
* Base class, specialization for no storage (zero-length %bitset).
*
* See documentation for bitset.
* @endif
*/
template<>
struct _Base_bitset<0>
{
typedef unsigned long _WordT;
_Base_bitset() {}
_Base_bitset(unsigned long) {}
static size_t
_S_whichword(size_t __pos )
{ return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; }
static size_t
_S_whichbyte(size_t __pos )
{ return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; }
static size_t
_S_whichbit(size_t __pos )
{ return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; }
static _WordT
_S_maskbit(size_t __pos )
{ return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
// This would normally give access to the data. The bounds-checking
// in the bitset class will prevent the user from getting this far,
// but (1) it must still return an lvalue to compile, and (2) the
// user might call _Unchecked_set directly, in which case this /needs/
// to fail. Let's not penalize zero-length users unless they actually
// make an unchecked call; all the memory ugliness is therefore
// localized to this single should-never-get-this-far function.
_WordT&
_M_getword(size_t) const
{ __throw_out_of_range("bitset -- zero-length"); return *new _WordT; }
_WordT
_M_hiword() const { return 0; }
void
_M_do_and(const _Base_bitset<0>&) { }
void
_M_do_or(const _Base_bitset<0>&) { }
void
_M_do_xor(const _Base_bitset<0>&) { }
void
_M_do_left_shift(size_t) { }
void
_M_do_right_shift(size_t) { }
void
_M_do_flip() { }
void
_M_do_set() { }
void
_M_do_reset() { }
// Are all empty bitsets equal to each other? Are they equal to
// themselves? How to compare a thing which has no state? What is
// the sound of one zero-length bitset clapping?
bool
_M_is_equal(const _Base_bitset<0>&) const { return true; }
bool
_M_is_any() const { return false; }
size_t
_M_do_count() const { return 0; }
unsigned long
_M_do_to_ulong() const { return 0; }
// Normally "not found" is the size, but that could also be
// misinterpreted as an index in this corner case. Oh well.
size_t
_M_do_find_first(size_t) const { return 0; }
size_t
_M_do_find_next(size_t, size_t) const { return 0; }
};
// Helper class to zero out the unused high-order bits in the highest word.
template<size_t _Extrabits>
struct _Sanitize
@ -1115,7 +1210,7 @@ namespace std
}
}
if (__tmp.empty())
if (__tmp.empty() && !_Nb)
__is.setstate(ios_base::failbit);
else
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);

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