Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 73333 invoked from network); 30 Jul 2008 22:56:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jul 2008 22:56:20 -0000 Received: (qmail 37955 invoked by uid 500); 30 Jul 2008 22:56:19 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 37935 invoked by uid 500); 30 Jul 2008 22:56:19 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 37926 invoked by uid 99); 30 Jul 2008 22:56:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2008 15:56:19 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2008 22:55:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E9D36238898A; Wed, 30 Jul 2008 15:55:46 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r681237 [1/2] - in /stdcxx/branches/4.3.x: ./ etc/config/ examples/manual/ include/ include/ansi/ include/loc/ include/rw/ src/ tests/containers/ tests/include/ tests/localization/ tests/regress/ tests/src/ tests/strings/ tests/utilities/ u... Date: Wed, 30 Jul 2008 22:55:44 -0000 To: commits@stdcxx.apache.org From: vitek@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080730225546.E9D36238898A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vitek Date: Wed Jul 30 15:55:43 2008 New Revision: 681237 URL: http://svn.apache.org/viewvc?rev=681237&view=rev Log: 2008-07-30 Travis Vitek Merge r666742, r666829, r668632, r673164, r673573, r673978, r674008, r674023, r674069, r674236, r674441, r674550, r675269, r675315, r676077, r677756, r677764, r677770, r677777, r677789, r677783, r677791, r677800, r677810, r678003, r678239, r678483, r678619, r678905, r679241, r679246, r679601, r680049, r680050, r680051, r680545, r680756, r680775, r680791, r681102 from branches/4.2.x: 2008-06-11 Eric Lemings STDCXX-871 * tests/include/rw_driver.h (rw_fatal): * tests/include/rw_printf.h (rw_sprintfa, rw_snprintfa): Add link to page containing specifications for formatting directives. * tests/include/rw_printf.h (rw_asnprintf): Removed old list of formatting directives. Added more specifications for formatting directives to rwtest-fmtspec page and listed undocumented (i.e. complicated) formatting directives in a separate section so all directives are at least accounted for. 2008-06-11 Eric Lemings STDCXX-488 * etc/config/gcc.config: Use rpath on Darwin 9 OR LATER VERSION. Do not use rpath on Darwin 8. 2008-06-17 Farid Zaripov * GNUmakefile: Add "narrow" mode to the build mode in 15d builds. 2008-07-01 Travis Vitek STDCXX-670 * include/ansi/setjmp.h [!setjmp]: Define function macro setjmp. 2008-07-02 Martin Sebor STDCXX-986 * doc/stdlibug/2-3.html (2.3.1 Input Stream Iterators): Corrected a typo in example code. 2008-07-04 Farid Zaripov * etc/config/makefile.rules: Define local shell variable TZ to export its value (to complete changes in rev. 561060). 2008-07-04 Farid Zaripov * tests/include/rw_file.h: Replaced _MSC_VER to _WIN32 in preprocessor directive to use correct file name on MinGW. 2008-07-04 Farid Zaripov * tests/src/printf.cpp (_rw_fmtfloating): Use workaround for MSVC on MinGW too since MinGW uses MSVC's runtime. 2008-07-04 Farid Zaripov * include/rw/_config-gcc.h [__MINGW32__]: Add MinGW specific defines. * tests/localization/22.locale.cons.mt.cpp (test_ctors): Use MSVC specific workarounds on MinGW too. * tests/localization/22.locale.time.put.cpp (rw_strftime): Ditto. * util/gencat.cpp [__MINGW32__] (main): Create message catalog dll's independent on cygwin1.dll. 2008-07-05 Martin Sebor * include/rw/_config-gcc.h: Corrected typos in comments. Added comments to clearly separate sections dealing with individual operating environments. 2008-07-07 Farid Zaripov * etc/config/makefile.rules: Added comment about TZ variable. 2008-07-07 Martin Sebor STDCXX-988 * include/ansi/limits.h [__GNUG__]: Used #include_next twice to coax gcc's to pull in the system in order to #define POSIX and system macros. * tests/regress/18.c.limits.stdcxx-988.cpp: Regression test for STDCXX-988. Tested with gcc 4.1.2 and EDG eccp 3.9 on Fedora 8. 2008-07-09 Eric Lemings STDCXX-550 * tests/utilities/20.operators.cpp (test_random_access_iterators): Account for debug iterators on HP-UX platforms. 2008-07-09 Eric Lemings STDCXX-550 * tests/utilities/20.operators.cpp (test_random_access_iterator): Oops. Should be `!defined' in #if directive. 2008-07-11 Martin Sebor * src/wcodecvt.cpp (size_t): Used type throughout in place of the _RWSTD_SIZE_T macro which is necessary in library headers. 2008-07-17 Martin Sebor STDCXX-494 * include/vector (vector): Removed Allocator base class, replacing it (in a binary compatible way) with a new member, _C_alloc, instead. (_C_value_alloc_type): Removed member typedef. (vector): Initialized the _C_alloc member instead of allocator_type in all class ctors. (~vector, begin, end, size, max_size, empty, swap): Referenced _C_begin, _C_end, and _C_bufend indirectly, via the new _C_alloc member. (pop_back, push_back): Used the new _C_alloc member to destroy and construct elements. * include/vector.cc (_C_realloc, _C_destroy, _C_insert_1, _C_insert_n, _C_insert_range): Same as above. * tests/regress/23.vector.stdcxx-494: Added regression test for the vector part of the issue. 2008-07-17 Martin Sebor * tests/regress/18.c.limits.stdcxx-988.cpp (main): Avoided testing macros for specific values to prevent failures on non-conforming systems. 2008-07-17 Martin Sebor * etc/config/xfail.txt: Copied from trunk. 2008-07-17 Martin Sebor * tests/regress/18.c.limits.stdcxx-988.cpp [HP aCC] (main): Avoided testing LLONG_MAX and LLONG_MIN unless 199901L <= __STDC_VERSION__ (otherwise the macros are deliberately not defined). 2008-07-17 Martin Sebor * test/strings/21.string.erase.cpp (test_erase): Cast actual function arguments to the target type to silence HP aCC 6.16 remarks #4271-D: type conversion may lose sign. 2008-07-17 Martin Sebor STDCXX-780 * tests/include/rw_streambuf.h (test): Aasserted a precondition to silence HP aCC 6/cadvise warning #20206-D: Out of bound access. 2008-07-17 Martin Sebor * tests/containers/23.deque.modifiers.cpp (exception_loop): Converted a signed int to size_type to silence HP aCC 6 remark #4271-D: type conversion may lose sign. 2008-07-17 Martin Sebor STDCXX-896 * tests/containers/23.deque.modifiers.cpp (test_insert, test_assign): Cast away the constness of the target type before deleting a pointer to work around an HP aCC 6.16 bug. 2008-07-18 Martin Sebor * examples/manual/wctype.cpp: New example showcasing the wchar_t specialization of the std::ctype_byname facet along with the wide character classification functions, inspired by the following post to the Sun C++ discussion forum: http://forums.sun.com/thread.jspa?threadID=5315069. 2008-07-19 Martin Sebor STDCXX-997 * src/strtol.cpp [__SUNPRO_CC] (__rw_strtol, __rw_strtoul): Used #pragma no_side_effects to help Sun C++ optimizer generate better code (about 5% improvement was measured). [__SUNPRO_CC && _RWSTD_LONG_LONG] (__rw_strtoll, __rw_strtoull): Same. 2008-07-21 Eric Lemings STDCXX-808 * tests/regress/27.streambuf.buffer.stdcxx-808.cpp: Add regression test case that has failed in previous releases. 2008-07-21 Martin Sebor STDCXX-999 * NOTICE.txt: Updated year of copyright. 2008-07-22 Eric Lemings STDCXX-808 * tests/regress/27.streambuf.buffer.stdcxx-808.cpp: Add file header comment. 2008-07-23 Martin Sebor STDCXX-997 * include/bitset [__SUNPRO_CC] (__rw_bitset, __rw_bit_count, __rw_shl, __rw_shr): Used #pragma no_side_effects to help the optimizer generate better code. 2008-07-23 Martin Sebor * include/bitset [__SUNPRO_CC] Spelled #pragma no_side_effect the same as in the manual (even if the compiler seems to grok it both ways). 2008-07-26 Martin Sebor STDCXX-998 * include/rw/_defs.h [_RWSTD_ATTRIBUTE_NOTHROW] (_RWSTD_DECLARE_NOTHROW, _RWSTD_DEFINE_NOTHROW): Defined new helper macros to make it possible to declare functions with the attribute((nothrow)) when it's available and to use the empty exception specification to emulate the same feature when it isn't. (__rw_assert_fail): Used _RWSTD_DECLARE_NOTHROW. * include/rw/_config-gcc.h [gcc >= 3.3] (RWSTD_ATTRIBUTE_NOTHROW): Defined. 2008-07-26 Martin Sebor STDCXX-998 * src/assert.cpp (U_STACK_TRACE, __rw_stack_trace, printstack, __rw_assert_fail): Declared nothrow. 2008-07-26 Martin Sebor STDCXX-998 * src/strtol.h (__rw_strtol, __rw_strtoll): Declared nothrow. (__rw_strtoul, __rw_strtoull): Same. * src/strtol.cpp: Same. 2008-07-28 Travis Vitek * include/rw/_defs.h: Use _RWSTD_DECLARE_NOTHROW macro only after definition of _THROWS to avoid compile errors. 2008-07-29 Martin Sebor * include/loc/_moneypunct.h (~moneypunct): Explicitly declared to prevent the compiler from generating a definition (and vtable) in every translation unit that uses the class. Pursuant to STDCXX-998, made use of attribute((nothrow)) where available. * include/loc/_codecvt.h (~codecvt, ~codecvt_byname): Same. * include/loc/_collate.h (~collate, ~collate_byname): Same. * include/loc/_codecvt.cc (~codecvt, ~codecvt_byname): Defined. * include/loc/_moneypunct.cc (~moneypunct): Same. * include/loc/_collate.cc (~collate, ~collate_byname): Same. * src/collate.cpp (~collate, ~collate_byname): Same. * src/codecvt.cpp (~codecvt): Same. * src/wcodecvt.cpp (~codecvt, ~codecvt_byname): Defined. 2008-07-29 Martin Sebor * include/loc/_messages.h (~messages, ~messages_byname): Explicitly declared dtors to prevent the compiler from emitting function and vtable definition in every translation unit that uses the class. * include/loc/_money_put.h (~money_put): Same. * include/loc/_moneypunct.h (~moneypunct_byname): Same. * include/loc/_numpunct.h (~numpunct_byname): Same. * include/loc/_time_get.h (~time_get, ~time_get_byname): Same. * include/loc/_time_put.h (~time_put, ~time_put_byname): Same. * include/loc/_money_put.cc (~money_put): Defined. * include/loc/_time_get.cc (~time_get, ~time_get_byname): Same. * include/loc/_moneypunct.cc (~moneypunct_byname): Same. * include/loc/_messages.cc (~messages, ~messages_byname): Same. * include/loc/_numpunct.cc (~numpunct_byname): Same. * include/loc/_time_put.cc (~time_put, ~time_put_byname): Same. 2008-07-29 Martin Sebor * include/loc/_codecvt.h (codecvt_byname): Added an explicit specialization to avoid having to explicitly instanting the primary template in order to emit the definition of (the now explicitly defined out-of-line, since rev 680756) virtual dtor needed in __rw::__rw_ct_codecvt(). * src/codecvt.cpp (codecvt_byname): Defined ctor and dtor. 2008-07-30 Martin Sebor * include/rw/_defs.h (_RWSTD_ATTRIBUTE_NOTHROW): Defined as a no-op when the attribute isn't supported by the compiler to make the macro portably usable. (__rw_assert_fail): Inverted the order of the function attribute and exception specification to prevent compiler errors. Added: stdcxx/branches/4.3.x/examples/manual/wctype.cpp - copied unchanged from r678003, stdcxx/branches/4.2.x/examples/manual/wctype.cpp stdcxx/branches/4.3.x/tests/regress/18.c.limits.stdcxx-988.cpp - copied, changed from r674550, stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp stdcxx/branches/4.3.x/tests/regress/23.vector.stdcxx-494.cpp - copied unchanged from r677756, stdcxx/branches/4.2.x/tests/regress/23.vector.stdcxx-494.cpp Modified: stdcxx/branches/4.3.x/NOTICE.txt stdcxx/branches/4.3.x/etc/config/gcc.config stdcxx/branches/4.3.x/etc/config/makefile.rules stdcxx/branches/4.3.x/include/ansi/limits.h stdcxx/branches/4.3.x/include/ansi/setjmp.h stdcxx/branches/4.3.x/include/bitset stdcxx/branches/4.3.x/include/loc/_codecvt.cc stdcxx/branches/4.3.x/include/loc/_codecvt.h stdcxx/branches/4.3.x/include/loc/_collate.cc stdcxx/branches/4.3.x/include/loc/_collate.h stdcxx/branches/4.3.x/include/loc/_messages.cc stdcxx/branches/4.3.x/include/loc/_messages.h stdcxx/branches/4.3.x/include/loc/_money_put.cc stdcxx/branches/4.3.x/include/loc/_money_put.h stdcxx/branches/4.3.x/include/loc/_moneypunct.cc stdcxx/branches/4.3.x/include/loc/_moneypunct.h stdcxx/branches/4.3.x/include/loc/_numpunct.cc stdcxx/branches/4.3.x/include/loc/_numpunct.h stdcxx/branches/4.3.x/include/loc/_time_get.cc stdcxx/branches/4.3.x/include/loc/_time_get.h stdcxx/branches/4.3.x/include/loc/_time_put.cc stdcxx/branches/4.3.x/include/loc/_time_put.h stdcxx/branches/4.3.x/include/rw/_config-gcc.h stdcxx/branches/4.3.x/include/rw/_defs.h stdcxx/branches/4.3.x/include/vector stdcxx/branches/4.3.x/include/vector.cc stdcxx/branches/4.3.x/src/assert.cpp stdcxx/branches/4.3.x/src/codecvt.cpp stdcxx/branches/4.3.x/src/collate.cpp stdcxx/branches/4.3.x/src/strtol.cpp stdcxx/branches/4.3.x/src/strtol.h stdcxx/branches/4.3.x/src/wcodecvt.cpp stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp stdcxx/branches/4.3.x/tests/include/rw_driver.h stdcxx/branches/4.3.x/tests/include/rw_file.h stdcxx/branches/4.3.x/tests/include/rw_printf.h stdcxx/branches/4.3.x/tests/include/rw_streambuf.h stdcxx/branches/4.3.x/tests/localization/22.locale.cons.mt.cpp stdcxx/branches/4.3.x/tests/localization/22.locale.time.put.cpp stdcxx/branches/4.3.x/tests/src/printf.cpp stdcxx/branches/4.3.x/tests/strings/21.string.erase.cpp stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp stdcxx/branches/4.3.x/tests/utilities/20.operators.cpp stdcxx/branches/4.3.x/util/gencat.cpp Modified: stdcxx/branches/4.3.x/NOTICE.txt URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/NOTICE.txt?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/NOTICE.txt (original) +++ stdcxx/branches/4.3.x/NOTICE.txt Wed Jul 30 15:55:43 2008 @@ -1,12 +1,12 @@ Apache C++ Standard Library - stdcxx -Copyright 2005-2007 The Apache Software Foundation. +Copyright 2005-2008 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at Rogue Wave Software, Inc., -Copyright (c) 1994-2007. +Copyright (c) 1994-2008. This software contains code derived from the HP Standard Template Library, Copyright (c) 1994 Hewlett-Packard Company. Modified: stdcxx/branches/4.3.x/etc/config/gcc.config URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/etc/config/gcc.config?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/etc/config/gcc.config (original) +++ stdcxx/branches/4.3.x/etc/config/gcc.config Wed Jul 30 15:55:43 2008 @@ -106,7 +106,7 @@ -compatibility_version 4 -current_version $(LIBVER) # use appropriate install_name - ifeq ($(shell [ $(OS_MAJOR) -eq 9 ] && echo 1), 1) + ifeq ($(shell [ $(OS_MAJOR) -ge 9 ] && echo 1), 1) LDSOFLAGS += -install_name @rpath/$(LIBNAME) else LDSOFLAGS += -install_name $(LIBNAME) @@ -207,7 +207,9 @@ endif ifeq ($(OSNAME),Darwin) - RPATH = -Wl,-rpath, + ifeq ($(shell [ $(OS_MAJOR) -ge 9 ] && echo 1), 1) + RPATH = -Wl,-rpath, + endif endif # debug/optimization options Modified: stdcxx/branches/4.3.x/etc/config/makefile.rules URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/etc/config/makefile.rules?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/etc/config/makefile.rules (original) +++ stdcxx/branches/4.3.x/etc/config/makefile.rules Wed Jul 30 15:55:43 2008 @@ -158,6 +158,9 @@ # creates and sets the POSIX TMPDIR environment variable to a temporary # directory before running the programs which is then removed when done # +# The variable TZ is used in examples and initialized in GNUmakefile.exm +# (see rev.561060) +# # PlumHall specific: # for all "top level" tests that failed to build, find and build all # subtests (the little tests the main test consists of) @@ -168,6 +171,7 @@ PATH=$$PATH:.; \ TOPDIR=$(TOPDIR); \ TMPDIR=$${TMPDIR:-/tmp}/stdcxx-run-$$$$; \ + TZ=$(TZ); \ export LD_LIBRARY_PATH PATH TMPDIR TOPDIR TZ; \ trap "rm -rf $$TMPDIR" HUP INT QUIT TERM EXIT; \ mkdir -p $$TMPDIR; \ @@ -181,6 +185,7 @@ PATH=$$PATH:$(LIBDIR):$(BINDIR):.; \ TOPDIR=$(TOPDIR); \ TMPDIR=$${TMPDIR:-/tmp}/stdcxx-run-$$$$; \ + TZ=$(TZ); \ export LD_LIBRARY_PATH PATH TMPDIR TOPDIR TZ; \ trap "rm -rf $$TMPDIR" HUP INT QUIT TERM EXIT; \ mkdir -p $$TMPDIR; \ Modified: stdcxx/branches/4.3.x/include/ansi/limits.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/ansi/limits.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/ansi/limits.h (original) +++ stdcxx/branches/4.3.x/include/ansi/limits.h Wed Jul 30 15:55:43 2008 @@ -107,7 +107,12 @@ # endif # ifdef __GNUC__ - // use the gcc extension to #include the compiler's limits.h + // use the gcc extension to #include the compiler's +# include_next + + // include the same file again to get it to #include the system + // (presumably residing /usr/include/) +# define _GCC_NEXT_LIMITS_H # include_next # else # include _RWSTD_ANSI_C_LIMITS_H Modified: stdcxx/branches/4.3.x/include/ansi/setjmp.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/ansi/setjmp.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/ansi/setjmp.h (original) +++ stdcxx/branches/4.3.x/include/ansi/setjmp.h Wed Jul 30 15:55:43 2008 @@ -48,4 +48,8 @@ # include _RWSTD_ANSI_C_SETJMP_H #endif // _RWSTD_NO_DEPRECATED_C_HEADERS +#ifndef setjmp +# define setjmp(env) setjmp (env) +#endif + #endif // _RWSTD_SETJMP_H_INCLUDED Modified: stdcxx/branches/4.3.x/include/bitset URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/bitset?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/bitset (original) +++ stdcxx/branches/4.3.x/include/bitset Wed Jul 30 15:55:43 2008 @@ -58,6 +58,10 @@ _RWSTD_SIZE_T, _RWSTD_SIZE_T, const char*, const char*); +#ifdef __SUNPRO_CC +# pragma no_side_effect (__rw_bitset) +#endif // Sun C++ + #ifndef _RWSTD_NO_WCHAR_T _RWSTD_SPECIALIZED_FUNCTION @@ -68,6 +72,9 @@ _RWSTD_SIZE_T, _RWSTD_SIZE_T, const char*, const char*); +# ifdef __SUNPRO_CC +# pragma no_side_effect (__rw_bitset) +# endif // Sun C++ #endif // _RWSTD_NO_WCHAR_T // helper, implements bitset::count() @@ -81,6 +88,10 @@ _RWSTD_EXPORT void __rw_shr (unsigned long*, _RWSTD_SIZE_T, _RWSTD_SIZE_T) _THROWS (()); +#ifdef __SUNPRO_CC +# pragma no_side_effect (__rw_bit_count, __rw_shl, __rw_shr) +#endif // Sun C++ + } // namespace __rw Modified: stdcxx/branches/4.3.x/include/loc/_codecvt.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_codecvt.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_codecvt.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_codecvt.cc Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -35,7 +35,26 @@ template _RW::__rw_facet_id codecvt<_InternT, _ExternT, _StateT>::id; + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ codecvt<_InternT, _ExternT, _StateT>:: +~codecvt () /* nothrow */ +{ + // no-op +} + #endif // _RWSTD_NO_EXT_CODECVT_PRIMARY +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ codecvt_byname<_InternT, _ExternT, _StateT>:: +~codecvt_byname () /* nothrow */ +{ + // no-op +} + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_codecvt.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_codecvt.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_codecvt.h (original) +++ stdcxx/branches/4.3.x/include/loc/_codecvt.h Wed Jul 30 15:55:43 2008 @@ -120,6 +120,8 @@ explicit codecvt (_RWSTD_SIZE_T __ref = 0): _RW::__rw_facet (__ref) { } + virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; + // 22,2,1,5,1, p1 result out (state_type& __state, const intern_type* __from, const intern_type* __from_end, @@ -188,7 +190,7 @@ explicit codecvt (_RWSTD_SIZE_T = 0); - virtual ~codecvt (); + virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; result out (state_type &__state, const intern_type *__from, const intern_type* __from_end, @@ -332,6 +334,8 @@ explicit codecvt (_RWSTD_SIZE_T = 0); + virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; + result out (state_type& __state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, @@ -398,9 +402,26 @@ : codecvt <_InternT, _ExternT, _StateT> (__ref) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~codecvt_byname () _RWSTD_ATTRIBUTE_NOTHROW; +}; + + +_RWSTD_SPECIALIZED_CLASS +class _RWSTD_EXPORT codecvt_byname + : public codecvt +{ + char _C_namebuf [32]; + +public: + + explicit codecvt_byname (const char*, _RWSTD_SIZE_T = 0); + + virtual ~codecvt_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; + #ifndef _RWSTD_NO_WCHAR_T _RWSTD_SPECIALIZED_CLASS @@ -415,6 +436,8 @@ explicit codecvt_byname (const char*, _RWSTD_SIZE_T = 0); + virtual ~codecvt_byname () _RWSTD_ATTRIBUTE_NOTHROW; + protected: virtual codecvt_base::result Modified: stdcxx/branches/4.3.x/include/loc/_collate.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_collate.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_collate.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_collate.cc Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -35,6 +35,16 @@ template _RW::__rw_facet_id collate<_CharT>::id; + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ collate<_CharT>:: +~collate () /* nothrow */ +{ + // no-op +} + #endif // _RWSTD_NO_EXT_COLLATE_PRIMARY } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_collate.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_collate.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_collate.h (original) +++ stdcxx/branches/4.3.x/include/loc/_collate.h Wed Jul 30 15:55:43 2008 @@ -25,7 +25,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -66,6 +66,8 @@ explicit collate (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } + virtual ~collate () _RWSTD_ATTRIBUTE_NOTHROW; + int compare (const char_type* __low1, const char_type* __high1, const char_type* __low2, const char_type* __high2) const { @@ -113,6 +115,8 @@ explicit collate (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } + virtual ~collate () _RWSTD_ATTRIBUTE_NOTHROW; + int compare (const char_type* __low1, const char_type* __high1, const char_type* __low2, const char_type* __high2) const { @@ -156,9 +160,11 @@ allocator > string_type; - explicit collate (_RWSTD_SIZE_T __refs = 0) + explicit collate (_RWSTD_SIZE_T __refs = 0) _THROWS (()) : _RW::__rw_facet (__refs) { } + virtual ~collate () _RWSTD_ATTRIBUTE_NOTHROW; + int compare (const char_type* __low1, const char_type* __high1, const char_type* __low2, const char_type* __high2) const { @@ -182,7 +188,7 @@ virtual int do_compare (const char_type*, const char_type*, const char_type*, const char_type*) const; - + virtual string_type do_transform (const char_type*, const char_type*) const; @@ -218,6 +224,8 @@ this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + virtual ~collate_byname () _RWSTD_ATTRIBUTE_NOTHROW; + protected: virtual int @@ -242,6 +250,8 @@ this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + virtual ~collate_byname () _RWSTD_ATTRIBUTE_NOTHROW; + protected: virtual int Modified: stdcxx/branches/4.3.x/include/loc/_messages.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_messages.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_messages.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_messages.cc Wed Jul 30 15:55:43 2008 @@ -36,6 +36,16 @@ _RW::__rw_facet_id messages<_CharT>::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ messages<_CharT>:: +~messages () +{ + // no-op +} + + template messages_base::catalog messages<_CharT>:: @@ -141,4 +151,14 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ messages_byname<_CharT>:: +~messages_byname () +{ + // no-op +} + + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_messages.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_messages.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_messages.h (original) +++ stdcxx/branches/4.3.x/include/loc/_messages.h Wed Jul 30 15:55:43 2008 @@ -84,6 +84,7 @@ explicit messages (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } + virtual ~messages () _RWSTD_ATTRIBUTE_NOTHROW; catalog open (const string& __fun, const locale& __loc) const { return do_open (__fun, __loc); @@ -136,6 +137,8 @@ : messages<_CharT>(__refs) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~messages_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_money_put.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_money_put.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_money_put.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_money_put.cc Wed Jul 30 15:55:43 2008 @@ -51,6 +51,16 @@ _RW::__rw_facet_id money_put<_CharT, _OutputIter>::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ money_put<_CharT, _OutputIter>:: +~money_put () /* nothrow */ +{ + // no-op +} + + template /* private */ typename money_put<_CharT, _OutputIter>::iter_type money_put<_CharT, _OutputIter>:: Modified: stdcxx/branches/4.3.x/include/loc/_money_put.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_money_put.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_money_put.h (original) +++ stdcxx/branches/4.3.x/include/loc/_money_put.h Wed Jul 30 15:55:43 2008 @@ -63,6 +63,8 @@ explicit money_put (_RWSTD_SIZE_T __ref = 0) : _RW::__rw_facet (__ref) { } + virtual ~money_put () _RWSTD_ATTRIBUTE_NOTHROW; + // 22.2.6.2.1, p1 iter_type put (iter_type __it, bool __intl, ios_base &__flags, char_type __fill, long double __val) const { Modified: stdcxx/branches/4.3.x/include/loc/_moneypunct.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_moneypunct.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_moneypunct.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_moneypunct.cc Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -40,4 +40,25 @@ #endif // _RWSTD_NO_STATIC_CONST_MEMBER_INIT + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ moneypunct<_CharT, _Intl>:: +~moneypunct () /* nothrow */ +{ + // no-op +} + + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ moneypunct_byname<_CharT, _Intl>:: +~moneypunct_byname () /* nothrow */ +{ + // no-op +} + + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_moneypunct.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_moneypunct.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_moneypunct.h (original) +++ stdcxx/branches/4.3.x/include/loc/_moneypunct.h Wed Jul 30 15:55:43 2008 @@ -25,7 +25,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -68,6 +68,8 @@ explicit moneypunct (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } + virtual ~moneypunct () _RWSTD_ATTRIBUTE_NOTHROW; + char_type decimal_point () const { return do_decimal_point (); } @@ -211,6 +213,8 @@ : moneypunct<_CharT, _Intl>(__ref) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~moneypunct_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; Modified: stdcxx/branches/4.3.x/include/loc/_numpunct.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_numpunct.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_numpunct.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_numpunct.cc Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -36,8 +36,11 @@ _RW::__rw_facet_id numpunct<_CharT>::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class template -/* virtual */ numpunct<_CharT>::~numpunct () +/* virtual */ numpunct<_CharT>:: +~numpunct () /* nothrow */ { // no-op } @@ -45,4 +48,14 @@ // #endif // _RWSTD_NO_EXT_NUMPUNCT_PRIMARY +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ numpunct_byname<_CharT>:: +~numpunct_byname () /* nothrow */ +{ + // no-op +} + + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_numpunct.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_numpunct.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_numpunct.h (original) +++ stdcxx/branches/4.3.x/include/loc/_numpunct.h Wed Jul 30 15:55:43 2008 @@ -238,6 +238,8 @@ : numpunct<_CharT>(__refs) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~numpunct_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_time_get.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_time_get.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_time_get.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_time_get.cc Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -50,6 +50,16 @@ _RW::__rw_facet_id time_get<_CharT, _InputIter>::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ time_get<_CharT, _InputIter>:: +~time_get () +{ + // no-op +} + + template typename time_get<_CharT, _InputIter>::iter_type time_get<_CharT, _InputIter>:: @@ -356,4 +366,14 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ time_get_byname<_CharT, _InputIter>:: +~time_get_byname () +{ + // no-op +} + + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_time_get.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_time_get.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_time_get.h (original) +++ stdcxx/branches/4.3.x/include/loc/_time_get.h Wed Jul 30 15:55:43 2008 @@ -75,6 +75,8 @@ explicit time_get (_RWSTD_SIZE_T __ref = 0) : _RW::__rw_facet (__ref) { } + virtual ~time_get () _RWSTD_ATTRIBUTE_NOTHROW; + dateorder date_order() const { return do_date_order(); } @@ -207,6 +209,8 @@ : time_get<_CharT, _InputIter>(__ref) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~time_get_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_time_put.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_time_put.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_time_put.cc (original) +++ stdcxx/branches/4.3.x/include/loc/_time_put.cc Wed Jul 30 15:55:43 2008 @@ -60,6 +60,16 @@ _RW::__rw_facet_id time_put<_CharT, _OutputIter>::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ time_put<_CharT, _InputIter>:: +~time_put () +{ + // no-op +} + + template */ > /* virtual */ typename time_put<_CharT, _OutputIter>::iter_type time_put<_CharT, _OutputIter>:: @@ -173,4 +183,14 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template +/* virtual */ time_put_byname<_CharT, _OutputIter>:: +~time_put_byname () +{ + // no-op +} + + } // namespace std Modified: stdcxx/branches/4.3.x/include/loc/_time_put.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_time_put.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/loc/_time_put.h (original) +++ stdcxx/branches/4.3.x/include/loc/_time_put.h Wed Jul 30 15:55:43 2008 @@ -61,6 +61,8 @@ explicit time_put (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } + virtual ~time_put () _RWSTD_ATTRIBUTE_NOTHROW; + // 22.2.5.3.1, p1 iter_type put (iter_type, ios_base&, char_type, const tm*, const char_type*, const char_type*) const; @@ -106,6 +108,8 @@ : time_put<_CharT, _OutputIter>(__ref) { this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + + virtual ~time_put_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; } // namespace std Modified: stdcxx/branches/4.3.x/include/rw/_config-gcc.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config-gcc.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/rw/_config-gcc.h (original) +++ stdcxx/branches/4.3.x/include/rw/_config-gcc.h Wed Jul 30 15:55:43 2008 @@ -88,6 +88,13 @@ // (it may still exit by throwing an exception or by calling longjmp) #define _RWSTD_ATTRIBUTE_NORETURN _RWSTD_GNUC_ATTRIBUTE ((noreturn)) +#if __GNUG__ > 3 || __GNUG__ == 3 && __GNUC_MINOR__ >= 3 + // gcc attribute((nothrow)) to indicate that a function doesn't throw + // exceptions; unlike the emtpy exception specification the attribute + // avoids the cost of checking for exceptions and calling unexpected() +# define _RWSTD_ATTRIBUTE_NOTHROW _RWSTD_GNUC_ATTRIBUTE ((nothrow)) +#endif // gcc >= 3.3 + #ifdef _RWSTD_OS_LINUX # ifdef _RWSTD_NO_NEW_HEADER @@ -123,6 +130,7 @@ #undef _RWSTD_NO_DEPRECATED_LIBC_IN_STD +/*** CygWin ***************************************************************/ #ifdef __CYGWIN__ // use our own C++ libc headers # undef _RWSTD_NO_NEW_HEADER @@ -134,7 +142,7 @@ # endif # ifdef _RWSHARED - // disabe exporting timeplate instantations in shared builds + // disable exporting tmeplate instantiations in shared builds // see STDCXX-507 # define _RWSTD_NO_EXTERN_TEMPLATE @@ -145,6 +153,22 @@ # endif #endif // __CYGWIN__ +/*** MinGW ****************************************************************/ +#ifdef __MINGW32__ +# ifdef _RWSHARED + // disable exporting temeplate instantiations in shared builds + // see STDCXX-507 +# define _RWSTD_NO_EXTERN_TEMPLATE +# endif + + // operator new and delete is not reliably replaceable across + // shared library boundaries, which includes the shared library + // version of the language support library + // on MinGW the language support library is always shared +# define _RWSTD_NO_REPLACEABLE_NEW_DELETE +#endif // __MINGW32__ + +/*** Tru64 UNIX ***********************************************************/ #ifdef _RWSTD_OS_OSF1 // sizeof (long double) == sizeof (double), 'L' causes SIGSEGV # define _RWSTD_LDBL_PRINTF_PREFIX "" @@ -152,6 +176,7 @@ #endif // _RWSTD_OS_OSF1 +/*** Solaris **************************************************************/ #ifdef _RWSTD_OS_SUNOS // _SOLARIS_THREADS #defined when the -threads option is used on SunOS Modified: stdcxx/branches/4.3.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_defs.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.3.x/include/rw/_defs.h Wed Jul 30 15:55:43 2008 @@ -1113,40 +1113,6 @@ # define _RWSTD_ASSUME(expr) _RWSTD_ASSERT (expr) #endif // _RWSTD_ASSUME -#ifndef _RWSTD_ATTRIBUTE_NORETURN - // gcc (and others) __attribute__ ((noreturn)) -# define _RWSTD_ATTRIBUTE_NORETURN /* empty */ -#endif // _RWSTD_ATTR_NORETURN - - -// compile-time assertion - asserts constant expressions during -// compilation with no runtime overhead; failed assertions are reported -// as compilation errors - -_RWSTD_NAMESPACE (__rw) { - -// file may be #included from within an extern "C" block -extern "C++" { - -template -struct __rw_compile_assert; - -_RWSTD_SPECIALIZED_CLASS -struct __rw_compile_assert { enum { _C_ok }; }; - -#define _RWSTD_COMPILE_ASSERT(const_expr) \ - ((void)_RW::__rw_compile_assert<(const_expr)>::_C_ok) - -// called for failed assertions -void _RWSTD_EXPORT -__rw_assert_fail (const char*, const char*, int, const char*) - _RWSTD_ATTRIBUTE_NORETURN; - -} // extern "C++" - -} // namespace __rw - - #define _RWSTD_STR(x) #x #define _RWSTD_STRSTR(x) _RWSTD_STR(x) @@ -1197,6 +1163,62 @@ #endif // _RWSTD_NO_EXCEPTION_SPECIFICATION_ON_NEW +#ifndef _RWSTD_ATTRIBUTE_NORETURN + // gcc (and others) __attribute__ ((noreturn)) +# define _RWSTD_ATTRIBUTE_NORETURN /* empty */ +#endif // _RWSTD_ATTR_NORETURN + + +#ifdef _RWSTD_ATTRIBUTE_NOTHROW + // gcc (and others) __attribute__ ((nothrow)) +# define _RWSTD_DECLARE_NOTHROW _RWSTD_ATTRIBUTE_NOTHROW + // attributes cannot appear on function definitions +# define _RWSTD_DEFINE_NOTHROW /* empty */ +#else + // make the macro usable even when it doesn't do anything +# define _RWSTD_ATTRIBUTE_NOTHROW /* empty */ + // emulate using empty exception specifications which must + // be specified for both declarations and definitions +# define _RWSTD_DECLARE_NOTHROW _THROWS(()) +# define _RWSTD_DEFINE_NOTHROW _THROWS(()) +#endif // _RWSTD_ATTR_NORETURN + + +// compile-time assertion - asserts constant expressions during +// compilation with no runtime overhead; failed assertions are reported +// as compilation errors + +_RWSTD_NAMESPACE (__rw) { + +// file may be #included from within an extern "C" block +extern "C++" { + +template +struct __rw_compile_assert; + +_RWSTD_SPECIALIZED_CLASS +struct __rw_compile_assert { enum { _C_ok }; }; + +#define _RWSTD_COMPILE_ASSERT(const_expr) \ + ((void)_RW::__rw_compile_assert<(const_expr)>::_C_ok) + +// called for failed assertions +void _RWSTD_EXPORT +__rw_assert_fail (const char*, const char*, int, const char*) + _RWSTD_DECLARE_NOTHROW _RWSTD_ATTRIBUTE_NORETURN; + + + +#ifdef __SUNPRO_CC + // help Sun C++ optimizer generate better code +# pragma does_not_return (__rw_assert_fail) +#endif // __SUNPRO_CC + +} // extern "C++" + +} // namespace __rw + + // for convenience #if !defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) \ && (!defined (__SUNPRO_CC) || __SUNPRO_CC > 0x540) Modified: stdcxx/branches/4.3.x/include/vector URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/vector?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/vector (original) +++ stdcxx/branches/4.3.x/include/vector Wed Jul 30 15:55:43 2008 @@ -61,7 +61,7 @@ _EXPORT template -class vector: private _Allocator +class vector { public: @@ -73,7 +73,6 @@ typedef typename allocator_type::const_reference const_reference; typedef typename allocator_type::pointer pointer; typedef typename allocator_type::const_pointer const_pointer; - typedef _RWSTD_ALLOC_TYPE (allocator_type, value_type) _C_value_alloc_type; public: @@ -130,33 +129,32 @@ explicit vector (const allocator_type &__alloc = allocator_type ()) - : allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { } + : _C_alloc (__alloc) { } explicit vector (size_type __n, const_reference __x = value_type (), const allocator_type &__alloc = allocator_type ()) - : allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { + : _C_alloc (__alloc) { assign (__n, __x); } template vector (_InputIter __first, _InputIter __last, const allocator_type &__alloc = allocator_type ()) - : allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { + : _C_alloc (__alloc) { assign (__first, __last); } vector (const vector &__rhs) - : allocator_type (__rhs.get_allocator ()), - _C_begin (), _C_end (), _C_bufend () { + : _C_alloc (__rhs.get_allocator ()) { assign (__rhs.begin (), __rhs.end ()); } ~vector () { - _C_destroy (begin ()); - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, - deallocate (_C_begin, _C_bufend - _C_begin)); + _C_destroy (begin ()); + _C_alloc.deallocate (_C_alloc._C_begin, + _C_alloc._C_bufend - _C_alloc._C_begin); } vector& operator= (const vector&); @@ -172,23 +170,23 @@ } allocator_type get_allocator () const { - return *this; + return _C_alloc; } iterator begin () { - return _C_make_iter (_C_begin); + return _C_make_iter (_C_alloc._C_begin); } const_iterator begin () const { - return _C_make_iter (_C_begin); + return _C_make_iter (_C_alloc._C_begin); } iterator end () { - return _C_make_iter (_C_end); + return _C_make_iter (_C_alloc._C_end); } const_iterator end () const { - return _C_make_iter (_C_end); + return _C_make_iter (_C_alloc._C_end); } reverse_iterator rbegin () { @@ -208,21 +206,21 @@ } size_type size () const { - return size_type (_C_end - _C_begin); + return size_type (_C_alloc._C_end - _C_alloc._C_begin); } size_type max_size () const { - return _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, max_size ()); + return _C_alloc.max_size (); } void resize (size_type, value_type = value_type ()); size_type capacity () const { - return _C_bufend - _C_begin; + return _C_alloc._C_bufend - _C_alloc._C_begin; } bool empty () const { - return _C_begin == _C_end; + return _C_alloc._C_begin == _C_alloc._C_end; } void reserve (size_type); @@ -259,8 +257,8 @@ void pop_back () { _RWSTD_ASSERT (!empty ()); - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, destroy (_C_end - 1)); - --_C_end; + _C_alloc.destroy (_C_alloc._C_end - 1); + --_C_alloc._C_end; } iterator insert (iterator, const_reference); @@ -358,11 +356,9 @@ // constructs a copy at the end and grows the size of container void _C_push_back (const_reference __x) { - _RWSTD_ASSERT (_C_end != _C_bufend); - - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, - construct (_C_end, __x)); - ++_C_end; + _RWSTD_ASSERT (_C_alloc._C_end != _C_alloc._C_bufend); + _C_alloc.construct (_C_alloc._C_end, __x); + ++_C_alloc._C_end; } // destroys elements from the iterator to the end of the vector @@ -372,9 +368,16 @@ // implements swap for objects with unequal allocator void _C_unsafe_swap (vector&); - pointer _C_begin; - pointer _C_end; - pointer _C_bufend; + struct _C_VectorAlloc: allocator_type { + + _C_VectorAlloc (const allocator_type &__alloc) + : allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () + { /* empty */} + + pointer _C_begin; + pointer _C_end; + pointer _C_bufend; + } _C_alloc; }; @@ -472,12 +475,10 @@ vector<_TypeT, _Allocator>:: push_back (const_reference __x) { - if (_C_end == _C_bufend) { + if (_C_alloc._C_end == _C_alloc._C_bufend) _C_insert_1 (end (), __x); - } - else { + else _C_push_back (__x); - } } @@ -512,8 +513,8 @@ if (__next != end ()) _STD::copy (__next, end (), __it); - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, destroy (_C_end - 1)); - --_C_end; + _C_alloc.destroy (_C_alloc._C_end - 1); + --_C_alloc._C_end; return __it; } @@ -549,15 +550,15 @@ swap (vector &__other) { if (get_allocator () == __other.get_allocator ()) { - pointer __tmp = _C_begin; - _C_begin = __other._C_begin; - __other._C_begin = __tmp; - __tmp = _C_end; - _C_end = __other._C_end; - __other._C_end = __tmp; - __tmp = _C_bufend; - _C_bufend = __other._C_bufend; - __other._C_bufend = __tmp; + pointer __tmp = _C_alloc._C_begin; + _C_alloc._C_begin = __other._C_alloc._C_begin; + __other._C_alloc._C_begin = __tmp; + __tmp = _C_alloc._C_end; + _C_alloc._C_end = __other._C_alloc._C_end; + __other._C_alloc._C_end = __tmp; + __tmp = _C_alloc._C_bufend; + _C_alloc._C_bufend = __other._C_alloc._C_bufend; + __other._C_alloc._C_bufend = __tmp; } else { // not exception-safe Modified: stdcxx/branches/4.3.x/include/vector.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/vector.cc?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/include/vector.cc (original) +++ stdcxx/branches/4.3.x/include/vector.cc Wed Jul 30 15:55:43 2008 @@ -82,20 +82,19 @@ vector __tmp (get_allocator ()); // allocate storage of requested capacity - __tmp._C_begin = - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, __tmp, - allocate (__cap, this)); + __tmp._C_alloc._C_begin = _C_alloc.allocate (__cap, this); // initialize pointers - __tmp._C_end = __tmp._C_begin; - __tmp._C_bufend = __tmp._C_begin + __cap; + __tmp._C_alloc._C_end = __tmp._C_alloc._C_begin; + __tmp._C_alloc._C_bufend = __tmp._C_alloc._C_begin + __cap; // copy *this into the temporary one element at a time, as if // by calling std::unitialized_copy(), growing the temporary // at each iteration so that an exception thrown by the copy // ctor will cause the destruction of all already constructed // elements (by invoking the temporary's dtor) - for (pointer __ptr = _C_begin; !(__ptr == _C_end); ++__ptr) { + for (pointer __ptr = _C_alloc._C_begin; !(__ptr == _C_alloc._C_end); + ++__ptr) { __tmp._C_push_back (*__ptr); } @@ -110,10 +109,8 @@ { _RWSTD_ASSERT_RANGE (__first, end ()); - _C_value_alloc_type __alloc = _RWSTD_VALUE_ALLOC_CAST (*this); - for (size_type __n = end () - __first; !(0 == __n); --__n) - __alloc.destroy (--_C_end); + _C_alloc.destroy (--_C_alloc._C_end); } @@ -170,12 +167,12 @@ if (__it < end ()) { - const pointer __end = _C_end; + const pointer __end = _C_alloc._C_end; // construct a copy of the last element in the range [it, end) // in the uninitialized slot just past the end of the range // and bump up end() - _C_push_back (*(_C_end - difference_type (1))); + _C_push_back (*(_C_alloc._C_end - difference_type (1))); // move the remaining elements from the range above one slot // toward the end starting with the last element @@ -218,36 +215,40 @@ vector __tmp (get_allocator ()); __tmp.reserve (__size2); - _RWSTD_ASSERT (!(pointer () == __tmp._C_end)); + _RWSTD_ASSERT (!(pointer () == __tmp._C_alloc._C_end)); iterator __i; // copy the initial range prior to `it' as if by a call to - // std::uninitialized_copy (begin (), __it, __tmp._C_begin); + // uninitialized_copy (begin (), __it, __tmp._C_alloc._C_begin); for (__i = begin (); !(__i == __it); ++__i) { - _RWSTD_ASSERT (!(__tmp._C_end == __tmp._C_bufend)); + _RWSTD_ASSERT (!( __tmp._C_alloc._C_end + == __tmp._C_alloc._C_bufend)); __tmp._C_push_back (*__i); } // construct `n' copies of `x' just past the initial range, // as if by a call to - // std::uninitialized_fill_n (__tmp._C_begin + __size1, __n, __x); + // uninitialized_fill_n (__tmp._C_aloc._C_begin + __size1, __n, __x); for ( ; __n; --__n) { - _RWSTD_ASSERT (!(__tmp._C_end == __tmp._C_bufend)); + _RWSTD_ASSERT (!( __tmp._C_alloc._C_end + == __tmp._C_alloc._C_bufend)); __tmp._C_push_back (__x); } // copy the final range of elements starting with `it' // as if by a call to - // uninitialized_copy (__it, end (), __tmp._C_begin + __size1 + __n); + // uninitialized_copy (__it, end (), + // __tmp._C_alloc._C_begin + __size1 + __n); for (__i = __it; !(__i == end ()); ++__i) { - _RWSTD_ASSERT (!(__tmp._C_end == __tmp._C_bufend)); + _RWSTD_ASSERT (!( __tmp._C_alloc._C_end + == __tmp._C_alloc._C_bufend)); __tmp._C_push_back (*__i); } @@ -262,14 +263,12 @@ // controlled by *this that need to be moved (copy contructed past // the end of the end of the sequence or assigned over existing // elements) - const pointer __movbeg = _C_begin + __size1; + const pointer __movbeg = _C_alloc._C_begin + __size1; const pointer __movend = __movbeg + __n; _RWSTD_ASSERT (_C_make_iter (__movbeg) == __it); - _C_value_alloc_type __alloc = _RWSTD_VALUE_ALLOC_CAST (*this); - - if (__movend <= _C_end) { + if (__movend <= _C_alloc._C_end) { // the end of the range of existing elements after being // moved to make room for the elements to be inserted is @@ -277,15 +276,16 @@ // compute the beginning of the range of elements whose copies // will be constructed just past the current end of the sequence - const pointer __ucpbeg = _C_end - __n; - const pointer __ucpend = _C_end; + const pointer __ucpbeg = _C_alloc._C_end - __n; + const pointer __ucpend = _C_alloc._C_end; // construct copies of elements that will be moved beyond // the current end of the sequence controlled by *this - _STD::uninitialized_copy (__ucpbeg, _C_end, _C_end, __alloc); + _STD::uninitialized_copy (__ucpbeg, _C_alloc._C_end, + _C_alloc._C_end, _C_alloc); // advance end to maintain consistent state - _C_end += __n; + _C_alloc._C_end += __n; // copy elements the will be overwritten below // over the range of elements moved above @@ -299,17 +299,17 @@ const size_type __n1 = size () - __size1; const size_type __n2 = __n - __n1; - _STD::uninitialized_fill_n (_C_end, __n2, __x, __alloc); + _STD::uninitialized_fill_n (_C_alloc._C_end, __n2, __x, _C_alloc); - const pointer __end = _C_end; + const pointer __end = _C_alloc._C_end; - _C_end += __n2; + _C_alloc._C_end += __n2; // construct copies of the range of elements [pos, end) // past the end of the range of elements inserted above - _STD::uninitialized_copy (__movbeg, __end, _C_end, __alloc); + _STD::uninitialized_copy (__movbeg, __end, _C_alloc._C_end, _C_alloc); - _C_end += __end - __movbeg; + _C_alloc._C_end += __end - __movbeg; __n = __n1; } @@ -472,23 +472,23 @@ if (__inx < __size) { // swap the inserted elements with the elements before which // they should be inserted, as if by calling - // std::rotate (__beg, __mid, _C_end) - const pointer __beg = this->_C_begin + __inx; - const pointer __mid = this->_C_begin + __size; + // std::rotate (__beg, __mid, _C_alloc._C_end) + const pointer __beg = this->_C_alloc._C_begin + __inx; + const pointer __mid = this->_C_alloc._C_begin + __size; if (__beg < __mid) { for (pointer __p0 = __beg, __p1 = __mid; __p0 < --__p1; ++__p0) _STD::iter_swap (__p0, __p1); } - if (__mid < this->_C_end) { - for (pointer __p0 = __mid, __p1 = this->_C_end; + if (__mid < this->_C_alloc._C_end) { + for (pointer __p0 = __mid, __p1 = this->_C_alloc._C_end; __p0 < --__p1; ++__p0) _STD::iter_swap (__p0, __p1); } - if (__beg < this->_C_end) { - for (pointer __p0 = __beg, __p1 = this->_C_end; + if (__beg < this->_C_alloc._C_end) { + for (pointer __p0 = __beg, __p1 = this->_C_alloc._C_end; __p0 < --__p1; ++__p0) _STD::iter_swap (__p0, __p1); } @@ -555,12 +555,12 @@ // in the sequence controlled by *this that need to be moved // (copy contructed past the end of the end of the sequence // or assigned over existing elements) - const pointer __movbeg = this->_C_begin + __size1; + const pointer __movbeg = this->_C_alloc._C_begin + __size1; const pointer __movend = __movbeg + __size2; _RWSTD_ASSERT (this->_C_make_iter (__movbeg) == __it); - const pointer __end = this->_C_end; + const pointer __end = this->_C_alloc._C_end; if (__movend <= __end) { // compute the beginning of the range of elements whose copies @@ -589,7 +589,7 @@ // construct copies of the trailing subsequence of the range // of elements being inserted, as if by a call to - // std::uninitialized_copy (__mid, __last, _C_end); + // std::uninitialized_copy (__mid, __last, _C_alloc._C_end); for (_FwdIter __m = __mid ; !(__m == __last); ++__m) this->_C_push_back (*__m); @@ -597,7 +597,7 @@ // construct copies of the range of elements [pos, end) // past the end of the range of elements inserted above, // as if by a call to - // std::uninitialized_copy (__movbeg, __end, _C_end); + // std::uninitialized_copy (__movbeg, __end, _C_alloc._C_end); for (pointer __p = __movbeg; !(__p == __end); ++__p) this->_C_push_back (*__p); Modified: stdcxx/branches/4.3.x/src/assert.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/assert.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/assert.cpp (original) +++ stdcxx/branches/4.3.x/src/assert.cpp Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -37,7 +37,7 @@ #ifdef __HP_aCC -extern "C" void U_STACK_TRACE (); +extern "C" void U_STACK_TRACE () _RWSTD_DECLARE_NOTHROW; # define STACK_TRACE U_STACK_TRACE @@ -47,8 +47,14 @@ _RWSTD_NAMESPACE (__rw) { +// declare with attribute((nothrow)) since the function calls +// others that may not be declared nothrow static void -__rw_stack_trace (int fd) +__rw_stack_trace (int fd) _RWSTD_DECLARE_NOTHROW; + + +static void +__rw_stack_trace (int fd) _RWSTD_DEFINE_NOTHROW { // limit stacktrace to the depth of 256 calls void* array [256]; @@ -70,7 +76,7 @@ // having to #define enabling macros (i.e., __EXTENSIONS__) and deal // with the breakage when using a strict compiler such as EDG eccp // with the long long extension (used in some system headers) disabled -extern "C" int printstack (int); +extern "C" int printstack (int) _RWSTD_DECLARE_NOTHROW; # define STACK_TRACE() printstack (2) #endif @@ -86,6 +92,7 @@ _RWSTD_EXPORT void __rw_assert_fail (const char *expr, const char *file, int line, const char *func) + _RWSTD_DEFINE_NOTHROW { // func may be 0 if the compiler doesn't support the ANSI C predefined // identifier `__func__' (see 6.4.2.2 of ISO/IEC 9899:1999) or an Modified: stdcxx/branches/4.3.x/src/codecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/codecvt.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/codecvt.cpp (original) +++ stdcxx/branches/4.3.x/src/codecvt.cpp Wed Jul 30 15:55:43 2008 @@ -105,7 +105,10 @@ } -/* virtual */ codecvt::~codecvt () +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ codecvt:: +~codecvt () { // no-op } @@ -265,6 +268,23 @@ } +codecvt_byname:: +codecvt_byname (const char *name, size_t ref) + : codecvt (ref) +{ + _C_set_name (name, _C_namebuf, sizeof _C_namebuf); +} + + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ codecvt_byname:: +~codecvt_byname () +{ + // no-op +} + + } // namespace std #define TARGS_C Modified: stdcxx/branches/4.3.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/collate.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/collate.cpp (original) +++ stdcxx/branches/4.3.x/src/collate.cpp Wed Jul 30 15:55:43 2008 @@ -787,7 +787,7 @@ template -long __rw_hash (const _CharT *lo, const _CharT *hi) +long __rw_hash (const _CharT *lo, const _CharT *hi) _THROWS (()) { // Peter Weinberger's generic hashing algorithm, adapted by Andrew // Binstock from a version by Allen Holub (see Andrew Binstock, @@ -843,6 +843,15 @@ _RW::__rw_facet_id collate::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ collate:: +~collate () /* nothrow */ +{ + // no-op +} + + int collate:: do_compare (const char_type *__lo1, const char_type *__hi1, const char_type *__lo2, const char_type *__hi2) const @@ -888,6 +897,15 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ collate_byname:: +~collate_byname () /* nothrow */ +{ + // no-op +} + + int collate_byname:: do_compare (const char* low1, const char* high1, const char* low2, const char* high2) const @@ -996,6 +1014,15 @@ _RW::__rw_facet_id collate::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ collate:: +~collate () /* nothrow */ +{ + // no-op +} + + int collate:: do_compare (const char_type *__lo1, const char_type *__hi1, const char_type *__lo2, const char_type *__hi2) const @@ -1062,6 +1089,15 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ collate_byname:: +~collate_byname () /* nothrow */ +{ + // no-op +} + + int collate_byname:: do_compare (const wchar_t* low1, const wchar_t* high1, const wchar_t* low2, const wchar_t* high2) const Modified: stdcxx/branches/4.3.x/src/strtol.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/strtol.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/strtol.cpp (original) +++ stdcxx/branches/4.3.x/src/strtol.cpp Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -192,7 +192,7 @@ unsigned long -__rw_strtoul (const char *nptr, int *errptr, int base) +__rw_strtoul (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -395,7 +395,7 @@ long -__rw_strtol (const char *nptr, int *errptr, int base) +__rw_strtol (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -626,7 +626,7 @@ # if (_RWSTD_LONG_SIZE < _RWSTD_LLONG_SIZE) ULLong -__rw_strtoull (const char *nptr, int *errptr, int base) +__rw_strtoull (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -813,7 +813,7 @@ LLong -__rw_strtoll (const char *nptr, int *errptr, int base) +__rw_strtoll (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); Modified: stdcxx/branches/4.3.x/src/strtol.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/strtol.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/strtol.h (original) +++ stdcxx/branches/4.3.x/src/strtol.h Wed Jul 30 15:55:43 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2008 Rogue Wave Software, Inc. * **************************************************************************/ @@ -35,11 +35,14 @@ _RWSTD_EXPORT extern const unsigned char __rw_digit_map[]; + +// same as strtoul() except that the source sequence must start +// with a sign (either '+' or '-') unsigned long - __rw_strtoul (const char*, int*, int); +__rw_strtoul (const char*, int*, int) _THROWS (()); long - __rw_strtol (const char*, int*, int); +__rw_strtol (const char*, int*, int) _THROWS (()); #ifdef _RWSTD_LONG_LONG @@ -49,7 +52,7 @@ # if (_RWSTD_LLONG_SIZE <= _RWSTD_LONG_SIZE) inline unsigned _RWSTD_LONG_LONG -__rw_strtoull (const char *nptr, int *errptr, int base) +__rw_strtoull (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (sizeof (_RWSTD_LONG_LONG) == sizeof (long)); @@ -58,7 +61,7 @@ inline _RWSTD_LONG_LONG -__rw_strtoll (const char *nptr, int *errptr, int base) +__rw_strtoll (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (sizeof (_RWSTD_LONG_LONG) == sizeof (long)); @@ -68,13 +71,29 @@ # else // if (_RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE) unsigned _RWSTD_LONG_LONG -__rw_strtoull (const char*, int*, int); +__rw_strtoull (const char*, int*, int) _THROWS (()); _RWSTD_LONG_LONG -__rw_strtoll (const char*, int*, int); +__rw_strtoll (const char*, int*, int) _THROWS (()); # endif // _RWSTD_LLONG_SIZE <= _RWSTD_LONG_SIZE #endif // _RWSTD_LONG_LONG +#ifdef __SUNPRO_CC + + // tell the Sun C++ optimizer that the functions do not access + // for reading or writing any part of the program state (either + // visible at in the caller at the point of the call, or not) +# pragma no_side_effect (__rw_strtoul) +# pragma no_side_effect (__rw_strtol) + +# ifdef _RWSTD_LONG_LONG +# pragma no_side_effect (__rw_strtoull) +# pragma no_side_effect (__rw_strtoll) +# endif // _RWSTD_LONG_LONG + +#endif // Sun C++ + + } // namespace __rw Modified: stdcxx/branches/4.3.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/wcodecvt.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.3.x/src/wcodecvt.cpp Wed Jul 30 15:55:43 2008 @@ -74,8 +74,8 @@ # undef _RWSTD_NO_MBRLEN -extern "C" _RWSTD_SIZE_T -mbrlen (const char*, _RWSTD_SIZE_T, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); +extern "C" size_t +mbrlen (const char*, size_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_MBRLEN && !_RWSTD_NO_MBRLEN_IN_LIBC @@ -87,7 +87,7 @@ # undef _RWSTD_NO_MBLEN extern "C" int -mblen (const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); +mblen (const char*, size_t) _LIBC_THROWS(); #endif // _RWSTD_NO_MBLEN && !_RWSTD_NO_MBLEN_IN_LIBC @@ -99,7 +99,7 @@ # undef _RWSTD_NO_MBTOWC extern "C" int -mbtowc (wchar_t*, const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); +mbtowc (wchar_t*, const char*, size_t) _LIBC_THROWS(); #endif // _RWSTD_NO_MBTOWC && !_RWSTD_NO_MBTOWC_IN_LIBC @@ -110,9 +110,8 @@ # undef _RWSTD_NO_WCSRTOMBS -extern "C" _RWSTD_SIZE_T -wcsrtombs (char*, const wchar_t**, - _RWSTD_SIZE_T, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); +extern "C" size_t +wcsrtombs (char*, const wchar_t**, size_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_WCSRTOMBS && !_RWSTD_NO_WCSRTOMBS_IN_LIBC @@ -123,7 +122,7 @@ # undef _RWSTD_NO_WCRTOMB -extern "C" _RWSTD_SIZE_T +extern "C" size_t wcrtomb (char*, wchar_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_WCRTOMB && !_RWSTD_NO_WCRTOMB_IN_LIBC @@ -237,7 +236,7 @@ { "UCS-LE", __rw_ucs_le } }; -static const _RWSTD_SIZE_T +static const size_t __rw_n_ucsmods = sizeof __rw_ucsmods / sizeof *__rw_ucsmods; @@ -270,10 +269,10 @@ // behaves just like mbrlen(), except that if the character pointed to // by `str' is the NUL character and `emax' is non-zero, the function // returns 1 -static inline _RWSTD_SIZE_T +static inline size_t __rw_libc_mbrlen (_RWSTD_MBSTATE_T &state, const char *str, - _RWSTD_SIZE_T emax) + size_t emax) { _RWSTD_ASSERT (0 != str); @@ -313,7 +312,7 @@ // does a simple transliteration of the UTF-8 encoded character string static unsigned int __rw_xlit (const _RW::__rw_codecvt_t* impl, - const char *utf8s, _RWSTD_SIZE_T sz) + const char *utf8s, size_t sz) { const unsigned int* const ptbls = impl->get_xliteration_tab (); @@ -358,8 +357,8 @@ // compute the length of the source sequence in bytes and // the size of the destination buffer in wide characters - _RWSTD_SIZE_T src_len = from_end - from; - _RWSTD_SIZE_T dst_size = to_limit - to; + size_t src_len = from_end - from; + size_t dst_size = to_limit - to; // set the initial values to the source and destination pointers const char* psrc = from; @@ -368,7 +367,7 @@ while (dst_size && src_len) { // the number of bytes that form the next multibyte character - _RWSTD_SIZE_T nbytes; + size_t nbytes; #ifndef _RWSTD_NO_MBRTOWC nbytes = mbrtowc (pdst, psrc, src_len, &state); @@ -379,14 +378,14 @@ #endif // -1 indicates an invalid sequence (i.e., error) - if (nbytes == (_RWSTD_SIZE_T)(-1)) { + if (nbytes == size_t (-1)) { res = _STD::codecvt_base::error; break; } // -2 indicates an ambiguous but valid subsequence // (i.e., ok) - if (nbytes == (_RWSTD_SIZE_T)(-2)) + if (nbytes == size_t (-2)) break; // 0 indicates the NUL character (skip over it) @@ -410,8 +409,8 @@ // range then we have a "partial" conversion if (res == _STD::codecvt_base::ok && src_len && !dst_size) { _RWSTD_MBSTATE_T tmp_state = state; - _RWSTD_SIZE_T tmp = __rw_libc_mbrlen (tmp_state, psrc, src_len); - if (tmp < (_RWSTD_SIZE_T)(-2)) + size_t tmp = __rw_libc_mbrlen (tmp_state, psrc, src_len); + if (tmp < size_t (-2)) res = _STD::codecvt_base::partial; } @@ -442,15 +441,13 @@ // save the value of MB_CUR_MAX and avoid repeatedly using // the macro for efficiency (it may expand to a function call) - const _RWSTD_SIZE_T mb_cur_max = - _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, MB_CUR_MAX); + const size_t mb_cur_max = size_t (MB_CUR_MAX); // the result of conversion _STD::codecvt_base::result res = _STD::codecvt_base::ok; // the size of the available space in the destination range - _RWSTD_SIZE_T dst_free = - _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, to_limit - to_next); + size_t dst_free = size_t (to_limit - to_next); // small temporary buffer used when the space in the destination // buffer is less than MB_CUR_MAX @@ -472,7 +469,7 @@ // the number of bytes in the resulting multibyte character // sequence, not including the terminating NUL - _RWSTD_SIZE_T dst_len = 0; + size_t dst_len = 0; #ifndef _RWSTD_NO_WCRTOMB @@ -546,7 +543,7 @@ // use libc locale to obtain the shift sequence char tmp [_RWSTD_MB_LEN_MAX]; - _RWSTD_SIZE_T ret; + size_t ret; #ifndef _RWSTD_NO_WCRTOMB ret = wcrtomb (tmp, wchar_t (0), &state); @@ -559,7 +556,7 @@ if (_RWSTD_SIZE_MAX == ret) return _STD::codecvt_base::error; - if (ret > (_RWSTD_SIZE_T)(to_limit - to_next)) { + if (ret > size_t (to_limit - to_next)) { // restore the state and return partial state = tmp_state; return _STD::codecvt_base::partial; @@ -576,7 +573,7 @@ // for validity by performing a number of computationally // relatively expensive tests; used only in strict mode static bool -__rw_utf8validate (const char* from, _RWSTD_SIZE_T nbytes) +__rw_utf8validate (const char* from, size_t nbytes) { _RWSTD_ASSERT (0 != from); _RWSTD_ASSERT (1 < nbytes && 7 > nbytes); @@ -622,7 +619,7 @@ if (6 == nbytes && 0xfcU == byte [0] && (byte [1] & 0xfcU) == 0x80U) return false; - for (_RWSTD_SIZE_T i = 1; i < nbytes; ++i) { + for (size_t i = 1; i < nbytes; ++i) { if ((byte [i] & ~0x3fU) != 0x80U) return false; // invalid byte } @@ -699,7 +696,7 @@ if (strict_utf && tmp) { // perform additional expensive UTF-8 validation - const _RWSTD_SIZE_T utf_len = tmp - from; + const size_t utf_len = tmp - from; if (utf_len > 1 && !__rw_utf8validate (from, utf_len)) tmp = 0; @@ -780,9 +777,9 @@ } // compute the number of bytes available in the destination sequence - const _RWSTD_SIZE_T bytes_avail = to_limit - to_next; + const size_t bytes_avail = to_limit - to_next; - _RWSTD_SIZE_T utf8_len; + size_t utf8_len; if (impl) { @@ -861,11 +858,11 @@ // implements do_length() on top of libc mbrlen() -static _RWSTD_SIZE_T +static size_t __rw_libc_do_length (_RWSTD_MBSTATE_T &state, const char *from, const char *from_end, - _RWSTD_SIZE_T imax) + size_t imax) { const char* const from_begin = from; @@ -873,7 +870,7 @@ // compute the maximum length (in bytes) of the multibyte // character sequence starting at `from' - _RWSTD_SIZE_T nbytes = from_end - from; + size_t nbytes = from_end - from; if (_RWSTD_MB_LEN_MAX < nbytes) nbytes = _RWSTD_MB_LEN_MAX; @@ -884,7 +881,7 @@ nbytes = __rw_libc_mbrlen (state, from, nbytes); // stop when an invalid or incomplete character is encountered - if (nbytes >= (_RWSTD_SIZE_T)(-2)) + if (nbytes >= size_t (-2)) break; from += nbytes; @@ -896,10 +893,10 @@ // implements do_length() for UTF-8@UCS -static _RWSTD_SIZE_T +static size_t __rw_utf8_do_length (const char *from, const char *from_end, - _RWSTD_SIZE_T imax, + size_t imax, int flags) { _RWSTD_ASSERT (from <= from_end); @@ -924,7 +921,7 @@ _RWSTD_ASSERT (next <= from_end); // perform additional expensive UTF-8 validation in strict mode - const _RWSTD_SIZE_T utf_len = next - from_next; + const size_t utf_len = next - from_next; if ( strict_utf && utf_len > 1 && !__rw_utf8validate (from_next, utf_len)) @@ -960,10 +957,10 @@ // Note that the function returns the number of externT characters // (i.e., those of type char for the required instantiations). -static _RWSTD_SIZE_T +static size_t __rw_libstd_do_length (const char* from, const char* from_end, - _RWSTD_SIZE_T imax, + size_t imax, int flags, const _RW::__rw_codecvt_t* impl) { @@ -1028,13 +1025,22 @@ /* explicit */ codecvt:: -codecvt (_RWSTD_SIZE_T __ref /* = 0 */) +codecvt (size_t __ref /* = 0 */) : _RW::__rw_facet (__ref) { // no-op } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ codecvt:: +~codecvt () +{ + // no-op +} + + /* virtual */ bool codecvt:: do_always_noconv () const _THROWS (()) @@ -1177,7 +1183,7 @@ do_length (state_type &state, const extern_type *from, const extern_type *from_end, - _RWSTD_SIZE_T imax) const + size_t imax) const { // 22.2.1.5.2, p9 - preconditions _RWSTD_ASSERT (from <= from_end); @@ -1192,14 +1198,14 @@ return 0; // 22.2.1.5.2, p10 - const _RWSTD_SIZE_T len = from_end - from; + const size_t len = from_end - from; return int (len < imax ? len : imax); } // codecvt_byname specialization codecvt_byname:: -codecvt_byname (const char *name, _RWSTD_SIZE_T ref) +codecvt_byname (const char *name, size_t ref) : codecvt(ref) { _C_flags = _RW::__rw_encoding_from_name (name); @@ -1224,14 +1230,14 @@ if (mod) { const char* const mod_nam = mod + 1; - const _RWSTD_SIZE_T mod_len = strlen (mod_nam); + const size_t mod_len = strlen (mod_nam); // search for one of the known modifiers if (mod_len > 2 && !memcmp (mod_nam, "UCS", 3)) { int flags = 0; - for (_RWSTD_SIZE_T i = 0; i != _RW::__rw_n_ucsmods; ++i) { + for (size_t i = 0; i != _RW::__rw_n_ucsmods; ++i) { if (!strcmp (_RW::__rw_ucsmods [i].mod, mod_nam)) { flags = _RW::__rw_ucsmods [i].flags; break; @@ -1259,7 +1265,7 @@ // denoting an external UTF encoding with strict validation rules // but slower processing, and their relaxed but faster equivalents, // utf-8, utf-16, utf-16-be, utf-16-le - const _RWSTD_SIZE_T name_len = strlen (name); + const size_t name_len = strlen (name); if (4 < name_len) { @@ -1308,6 +1314,15 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +/* virtual */ codecvt_byname::~ +codecvt_byname () +{ + // no-op +} + + /* virtual */ codecvt_base::result codecvt_byname:: do_in (state_type& state, @@ -1552,7 +1567,7 @@ do_length (state_type& state, const extern_type *from, const extern_type *from_end, - _RWSTD_SIZE_T cmax) const + size_t cmax) const { // 22.2.1.5.2 p1 _RWSTD_ASSERT (from <= from_end); @@ -1560,7 +1575,7 @@ // verify that the range is valid _RWSTD_ASSERT (from && from_end || !from && !from_end); - _RWSTD_SIZE_T len = 0; + size_t len = 0; // test the type of the encoding that the facet is interpreting switch (ISO2022_TYPE (_C_flags)) { @@ -1696,7 +1711,7 @@ { // returns the max value do_length (s, from, from_end, 1) can return // for any valid range [from, from_end) - see LWG issue 74 (a DR) - _RWSTD_SIZE_T max_len = 0; + size_t max_len = 0; // test the type of the encoding that the facet is interpreting switch (ISO2022_TYPE (_C_flags)) { @@ -1710,14 +1725,14 @@ // use libc locale const _RW::__rw_setlocale clocale (_C_name, LC_CTYPE); - max_len = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, MB_CUR_MAX); + max_len = size_t (MB_CUR_MAX); } else { // use own implementation if (IS_UTF8 (_C_flags)) max_len = _UTF8_MB_CUR_MAX; else if (impl) - max_len = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, impl->mb_cur_max); + max_len = size_t (impl->mb_cur_max); } break; } Modified: stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp (original) +++ stdcxx/branches/4.3.x/tests/containers/23.deque.modifiers.cpp Wed Jul 30 15:55:43 2008 @@ -190,10 +190,15 @@ _TRY { + // convert an int to size_type to avoid conversion + // warnings when passing it to member functions + // that expect an unsigned argument + const Deque::size_type nelems (n); + switch (mfun) { case Assign_n: _RWSTD_ASSERT (x); - deq.assign (n, *x); + deq.assign (nelems, *x); break; case AssignRange: deq.assign (first, last); @@ -214,7 +219,7 @@ break; case Insert_n: _RWSTD_ASSERT (x); - deq.insert (it, n, *x); + deq.insert (it, nelems, *x); break; case InsertRange: deq.insert (it, first, last); @@ -447,7 +452,10 @@ std::free (funcall); delete[] xins; - delete[] xseq; + + // cast away constness to work around an HP aCC 6.16 bug + // see http://issues.apache.org/jira/browse/STDCXX-802 + delete[] _RWSTD_CONST_CAST (UserClass*, xseq); } /**************************************************************************/ @@ -975,7 +983,10 @@ std::free (funcall); delete[] xasn; - delete[] xseq; + + // cast away constness to work around an HP aCC 6.16 bug + // see http://issues.apache.org/jira/browse/STDCXX-802 + delete[] _RWSTD_CONST_CAST (UserClass*, xseq); } @@ -1177,7 +1188,9 @@ std::free (funcall); - delete[] xseq; + // cast away constness to work around an HP aCC 6.16 bug + // see http://issues.apache.org/jira/browse/STDCXX-802 + delete[] _RWSTD_CONST_CAST (UserClass*, xseq); } void test_erase () Modified: stdcxx/branches/4.3.x/tests/include/rw_driver.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/include/rw_driver.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/tests/include/rw_driver.h (original) +++ stdcxx/branches/4.3.x/tests/include/rw_driver.h Wed Jul 30 15:55:43 2008 @@ -98,7 +98,8 @@ * @param line When positive, denotes the line number of the location * relevant to the diagnostic. Negative values are ignored. * @param fmtspec A printf format specifier (with extensions) used - * to format the text of the diagnostic. + * to format the text of the diagnostic. See rwtest-fmtspec page + * for details. * @param ... Optional list of values to format. * * @return Returns the value of expr passed to it. Modified: stdcxx/branches/4.3.x/tests/include/rw_file.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/include/rw_file.h?rev=681237&r1=681236&r2=681237&view=diff ============================================================================== --- stdcxx/branches/4.3.x/tests/include/rw_file.h (original) +++ stdcxx/branches/4.3.x/tests/include/rw_file.h Wed Jul 30 15:55:43 2008 @@ -33,17 +33,17 @@ #include // for test config macros -#ifndef _MSC_VER +#ifndef _WIN32 // POSIX special files: // http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap10.html # define DEV_CONSOLE "/dev/console" # define DEV_NULL "/dev/null" # define DEV_TTY "/dev/tty" -#else // if defined (_MSC_VER) +#else // if defined (_WIN32) # define DEV_CONSOLE "CON:" # define DEV_NULL "NUL:" # define DEV_TTY "CON:" -#endif // _MSC_VER +#endif // _WIN32 #if _RWSTD_PATH_SEP == '/'