You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/09/28 22:57:41 UTC

svn commit: r580483 [38/42] - in /incubator/stdcxx/branches/4.2.0: ./ bin/ doc/ doc/stdlibref/ doc/stdlibug/ etc/config/ etc/config/src/ etc/config/windows/ etc/nls/charmaps/ etc/nls/posix/charmaps/ etc/nls/posix/src/ etc/nls/src/ examples/manual/ exam...

Modified: incubator/stdcxx/branches/4.2.0/include/vector.cc
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/include/vector.cc?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/include/vector.cc (original)
+++ incubator/stdcxx/branches/4.2.0/include/vector.cc Fri Sep 28 13:55:52 2007
@@ -111,9 +111,10 @@
 {
     _RWSTD_ASSERT_RANGE (__first, end ());
 
-    for (size_type __n = end () - __first; !(0 == __n); --__n) {
-        _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, destroy (--_C_end));
-    }
+    _C_value_alloc_type __alloc = _RWSTD_VALUE_ALLOC_CAST (*this);
+
+    for (size_type __n = end () - __first; !(0 == __n); --__n)
+        __alloc.destroy (--_C_end);
 }
 
 
@@ -650,8 +651,10 @@
                 __self->_C_push_back (*__p);
 
             // over the range of elements moved above
-            for (pointer __q = __end; __movend < __q--; )
+            for (pointer __q = __end; __movend < __q; ) {
+                --__q;
                 *__q = *(__q - __size2);
+            }
         }
         else {
             // compute the length of the initial subsequence of the range

Modified: incubator/stdcxx/branches/4.2.0/src/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/ChangeLog?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/ChangeLog (original)
+++ incubator/stdcxx/branches/4.2.0/src/ChangeLog Fri Sep 28 13:55:52 2007
@@ -1,10 +1,611 @@
+2007-08-06  Martin Sebor  <se...@roguewave.com>
+
+	* ChangeLog: Updated, keeping original TABs.
+
+2007-07-27 Farid Zaripov <Fa...@epam.com>
+
+	* gcc.config [__CYGWIN__]: Added -D_REENTRANT option in
+	multithreaded builds. Don't define AS_EXT as .s.
+	* atomic.s [__CYGWIN__]: Prepend symbol names by '_'.
+
+2007-07-17  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-486
+	* time_put.cpp (tzset): Added throw() to the declaration.
+
+2007-07-13  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-485
+	* locale_body.cpp (_C_manage): Reset the capacity of the locale
+	buffer to the capacity of the statically allocated buffer after
+	its size shrinks below that level.
+
+2007-07-10 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-508
+	* catalog.cpp (catopen): while() loop replaced to for() loop
+	with checking for max iterations.
+
+2007-07-08  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-478
+	* locale_eq.cpp (operator==): Removed the assumption that the same
+	user-defined facets must be stored at the same index in the array
+	in order for two locales in which they are installed to compare
+	equal.
+
+2007-07-08  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-477
+	* locale_eq.cpp (operator==): Considered the names of locales when
+	all their standard and byname facet masks are the same and all their
+	facet pointers are the same.
+
+2007-07-08  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-395
+	* etc/config/src/LIMITS.cpp (_RWSTD_WCHAR_T_MAX, _RWSTD_WCHAR_T_MIN,
+	_RWSTD_WCHAR_T_SIZE): Renamed to _RWSTD_WCHAR_MAX, _RWSTD_WCHAR_MIN,
+	and _RWSTD_WCHAR_SIZE, respectively, for consistency with the libc
+	macros.
+	* tests/src/locale.cpp: Same.
+	* tests/src/char.cpp: Same.
+	* tests/src/printf.cpp: Same.
+	* tests/localization/22.locale.codecvt.out.cpp: Same.
+	* tests/self/0.printf.cpp: Same.
+	* include/limits: Same.
+	* include/tr1/cstdint: Same.
+	* include/ansi/_cwchar.h: Same.
+	* src/wctype.cpp: Same.
+	* src/wcodecvt.cpp: Same.
+	* util/ctype.cpp: Same.
+	* util/charmap.cpp: Same.
+
+2007-07-06  Martin Sebor  <se...@roguewave.com>
+
+	* ctype_bits.cpp (_RWSTD_NO_V3_LOCALE): Removed unnecessary guards
+	and replaces references to _V3_LOCALE with _STD and std, whichever
+	is appropriate.
+	* time_get.cpp: Same.
+	* iso2022.cpp: Same.
+	* wctype.cpp: Same.
+	* iso2022.h: Same.
+	* locale_bits.cpp: Same.
+	* locale_eq.cpp: Same.
+	* codecvt.cpp: Same.
+	* locale_name.cpp: Same.
+	* locale_classic.cpp: Same.
+	* locale_core.cpp: Same.
+	* wcodecvt.cpp: Same.
+	* locale_global.cpp: Same.
+	* locale_body.h: Same.
+	* locale_combine.cpp: Same.
+
+2007-07-06  Martin Sebor  <se...@roguewave.com>
+
+	* mman.h: Header with declarations of portability helper functions
+	for the manipulation of memory mapped files.
+	* mman.cpp: Definitions of the said helpers.
+	* facet.cpp (__rw_mmap, __rw_unmmap): Moved functions to mman.cpp.
+
+2007-07-05  Martin Sebor  <se...@roguewave.com>
+
+	* use_facet.h (_RWSTD_DEFINE_FACET_FACTORY): Documented macro
+	and "constified" a local variable in its definition.
+
+2007-07-05  Martin Sebor  <se...@roguewave.com>
+
+	* stdexcept (range_error, domain_error, runtime_error): Declared
+	virtual destructors instead of relying on the compiler to generate
+	them automatically to avoid generating the class vtable in every
+	translation unit that uses each of the classes.
+	* range_error.cpp: Defined range_error destructor.
+	* domain_error.cpp: Defined domain_error destructor.
+	* runtime_error.cpp: Defined runtime_error destructor.
+
+2007-06-28  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-461
+	* num_put.cpp (__rw_fix_flt): Corrected the formatting of Infinities
+	and NaN's when precision exceeds the length of the formatted string.
+
+2007-06-23  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-457
+	* podarray.cc: Updated license statement.
+	* podarray.c: Same.
+	* version.cpp: Updated copyright.
+
+2007-06-23  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-457
+	* catalog.h: Updated license statement.
+	* access.h: Same.
+	* use_facet.h: Same.
+	* iso2022.h: Same.
+	* setlocale.h: Same.
+	* version.cpp: Same.
+	* iosdata.h: Same.
+	* locale_body.h: Same.
+	* strtol.h: Same.
+
+2007-06-23  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-457
+	* ti_istream.cpp: Updated license statement.
+	* ti_stringbuf.cpp: Same.
+	* ti_string.cpp: Same.
+	* ti_wmoney_put.cpp: Same.
+	* ctype_bits.cpp: Same.
+	* ti_ostream.cpp: Same.
+	* memory.cpp: Same.
+	* ti_wstreambuf.cpp: Same.
+	* ti_collate.cpp: Same.
+	* ti_insert_dbl.cpp: Same.
+	* strtol.cpp: Same.
+	* ti_wistream.cpp: Same.
+	* ti_wnumpunct.cpp: Same.
+	* ti_moneypunct.cpp: Same.
+	* ti_wostream.cpp: Same.
+	* time_get.cpp: Same.
+	* iso2022.cpp: Same.
+	* ti_winsert_int.cpp: Same.
+	* limits.cpp: Same.
+	* ti_numpunct.cpp: Same.
+	* ti_wcollate.cpp: Same.
+	* ti_wmoney_get.cpp: Same.
+	* ti_money_put.cpp: Same.
+	* ti_winsert_ptr.cpp: Same.
+	* ti_num_put.cpp: Same.
+	* ti_streambuf.cpp: Same.
+	* ti_ios.cpp: Same.
+	* locale_core.cpp: Same.
+	* ti_wstring.cpp: Same.
+	* typeinfo.cpp: Same.
+	* assert.cpp: Same.
+	* ti_winsert_dbl.cpp: Same.
+	* ti_wtime_put.cpp: Same.
+	* ti_wnum_put.cpp: Same.
+	* ios_bits.cpp: Same.
+	* ti_wios.cpp: Same.
+	* rwstderr.cpp: Same.
+	* locale_bits.cpp: Same.
+	* random.cpp: Same.
+	* ti_money_get.cpp: Same.
+	* ti_time_put.cpp: Same.
+	* ti_wmoneypunct.cpp: Same.
+	* locale_eq.cpp: Same.
+	* strstream.cpp: Same.
+	* version.cpp: Same.
+	* ti_wstringbuf.cpp: Same.
+	* num_put.cpp: Same.
+	* codecvt.cpp: Same.
+	* vecbool.cpp: Same.
+	* ios.cpp: Same.
+	* ti_num_get.cpp: Same.
+	* catalog.cpp: Same.
+	* ti_wmessages.cpp: Same.
+	* locale_name.cpp: Same.
+	* locale_classic.cpp: Same.
+	* ti_messages.cpp: Same.
+	* ti_insert_int.cpp: Same.
+	* locale_global.cpp: Same.
+	* ti_wtime_get.cpp: Same.
+	* ti_wnum_get.cpp: Same.
+	* limits_bits.cpp: Same.
+	* ti_insert_ptr.cpp: Same.
+	* ti_time_get.cpp: Same.
+	* locale_combine.cpp: Same.
+
+2007-06-22 Farid Zaripov <Fa...@epam.com>
+
+	* _error.h(__rw_free_what_buf): Removed inline in declaration.
+	* exception.cpp(__rw_free_what_buf): The same.
+
+2007-06-22 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-454
+	* _error.h: Added declaration of the __rw_free_what_buf.
+	* exception.cpp (__rw_free_what_buf): Added _RWSTD_EXPORT to prototype.
+	Added assertion on __rw_what_refcnt value.
+	(_C_assign): If whatstr == __rw_what_buf, just reuse it without
+	allocation
+	of the new buffer.
+	* rwexcept.cpp: Use __rw_free_what_buf() instead of delete[].
+
+2007-06-21 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-293
+	* exception.cpp (__rw_throw): Don't delete allocated what string because
+	of __rw_throw_proc() takes ownership and must delete what string.
+
+2007-06-21 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-293
+	* exception.cpp (__rw_free_what_buf): New function to free buffer,
+	allocated by __rw_vfmtwhat().
+	Used __rw_free_what_buf() instead of delete[].
+
+2007-06-19  Martin Sebor  <se...@roguewave.com>
+
+	* punct.cpp (_RWSTD_NO_V3_LOCALE): Removed a dead guard.
+	(_RWSTD_SIZE_T): Replaced with size_t throughout.
+	Removed the :: scope resolution operator from references
+	to C library functions.
+
+2007-06-09  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-446
+	STDCXX-447
+	* complex (pow, operator>>, operator<<): Removed inline definitions.
+	* complex.cc (pow, operator>>, operator<<): Defined out-of-line and
+	exported.
+	* complex.c: #included complex.cc.
+	* export.cpp (<complex>, complex.cc): #included.
+
+2007-06-08  Martin Sebor  <se...@roguewave.com>
+
+	* src/wctype.cpp (do_widen): Explicitly specified template argument
+	list to work around HP aCC 3 and 5 bug resulting in Error 331: Illegal
+	cast expression; cannot cast expression type '<no type>' to 'wchar_t'.
+	See STDCXX-445.
+
+2007-06-07  Martin Sebor  <se...@roguewave.com>
+
+	* _ctype.h (do_toupper, do_tolower, do_widen, do_narrow): Outlined
+	virtual member functions of ctype<wchar_t> since they can almost
+	never be inlined anyway.
+	* wctype.cpp: Same.
+
+2007-06-06 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-188
+	* typeinfo.cpp: use ::_C_name or std::_C_name depending on
+	_RWSTD_NO_STD_TYPE_INFO macro.
+
+2007-06-05 Farid Zaripov <Fa...@epam.com>
+
+	STDCXX-188
+	* typeinfo.cpp: silenced warning: _C_name was declared
+	but never referenced
+
+2007-06-01  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-432
+	* _config.h (_config-eccp.h): Avoided #including when using HP aCC.
+	* exception.cpp (stdarg.h): Used _RWSTD_EDG_ECCP to guard against
+	inclusion when using EDG eccp based compilers including HP aCC 6.
+
+2007-05-28  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-402
+	* strtol.cpp (__rw_strtoul, __rw_strtol, __rw_strtoull, __rw_strtoll):
+	Asserted preconditions.
+	(LLong, ULLong): New convenience typedefs at namespace scope.
+	(__rw_strtoull, __rw_strtoll): Corrected off by one errors.
+
+2007-05-15  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-417
+	* atomic.s (TYPE_DIR): New macro conditionally defined to the .type
+	directive for GNU as on ELF targets.
+
+2007-05-15  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-416
+	* stdexcept (logic_error): Declared dtor.
+	* logic_error.cpp: New file.
+	(logic_error): Defined class dtor
+
+2007-04-07  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-387
+	* DAYLIGHT.cpp: New config test to determine whether the system
+	supports the XSI POSIX extension daylight.
+	* time_put.cpp (daylight): #defined to 0 when _RWSTD_NO_DAYLIGHT
+	is #defined.
+
+2007-03-28  Martin Sebor  <se...@roguewave.com>
+
+	* ctype.cpp (ctype_byname ctor): Asserted a precondition.
+	(_RWSTD_NO_V3_LOCALE, _V3_LOCALE): Removed/replaced obsolete macros.
+
+2007-03-07  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-349
+	* iostore.cpp (_C_copyfmt): Zeroed out a_size array to prevent
+	(bogus) gcc warnings about the variable being used uninitialized.
+
+2007-01-04 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	* string.cpp (__rw_memchr, __rw_wmemchr): Fixed bug: the function
+	returns incorrect result when nbytes == 0 and *src == c
+
+2006-12-11  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-309
+	* valarray (operator[]): Invoked next_ind() at most once per each
+	iteration of the loop.
+	* valarray.cpp (next_ind): Returned start() instead of 0 after
+	wrapping around.
+
+2006-12-05  Martin Sebor  <se...@roguewave.com>
+
+	* string.cpp (__rw_memcpy, __rw_memmove, __rw_memchr, __rw_memset,
+	__rw_memcmp, __rw_strlen): Defined each helper without depending
+	on the corresponding libc function in order to avoid infinite
+	recursion.
+	(__rw_wmemcpy, __rw_wmemmove, __rw_wmemchr, __rw_wmemset, __rw_wmemcmp,
+	__rw_wcslen): Same.
+
+2006-11-29  Martin Sebor  <se...@roguewave.com>
+
+	* time_put.cpp [MSVC >= 8.0] (__rw_put_time): Used the conforming
+	swprintf() rather than the legacy Microsoft one without the size
+	argument as suggested by the compiler warning.
+
+2006-11-14  Martin Sebor  <se...@roguewave.com>
+
+	* memattr.cpp (__rw_memattr): Used msync() instead of the unreliable
+	madvise() on IRIX.
+
+2006-10-09  Martin Sebor  <se...@roguewave.com>
+
+	* wcodecvt.cpp (__rw_libc_do_in): Corrected a typo in conditionally
+	compiled code.
+
+2006-10-09 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	STDCXX-93
+	* time_put.cpp (__rw_get_timepunct): Corrected buffer size in
+	wcsftime() calls; _RWSTD_SIZE_MAX changed to size of source
+	string in mbstowcs() calls to deal with MSVC 8.0 CRT
+
+2006-10-05  Martin Sebor  <se...@roguewave.com>
+
+	* time_put.cpp (__rw_get_time_put_data): Added braces around
+	the initializer of a local array to silence a gcc warning.
+
+2006-10-04 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	* exception.cpp [_MSC_VER]: #undefined _RWSTD_NO_VSNPRINTF after
+	#define vsnprintf _vsnprintf
+
+2006-10-03 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	Set svn:eol-style property.
+
+2006-09-29 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	* _num_put.cc: Updated the licensing header
+	* _select.h: The same
+	* file.cpp: The same
+
+2006-09-29 Farid Zaripov <fa...@kyiv.vdiweb.com>
+
+	* _num_put.cc (__rw_iter_failed): Removed const to resolve
+	ambiguity on MSVC 7.0
+	* _select.h [_RWSTD_NO_CLASS_PARTIAL_SPEC]: Added __rw_is_same
+	for compilers which not support the partial template specialization
+	* file.cpp: Declare fileno() only if it not declared in CRT header,
+	but present in libc
+	* NEW_THROWS.cpp: Returned 1 if operator new doesn't throws
+
+2006-08-28  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-280
+	* wcodecvt.cpp (__rw_libc_do_out): Used wcrtomb instead of wcsrtombs
+	in order to avoid reading past the end of the source sequence when
+	it doesn't contain an embedded NUL.
+
+2006-08-20  Martin Sebor  <se...@roguewave.com>
+
+	* collate.cpp ("podarray.cc"): Removed #include directive
+	to prevent multiple definition errors.
+	(__rw_pod_array): Moved explicit instantiation...
+	* podarray.h: ...to here.
+
+2006-08-18  Martin Sebor  <se...@roguewave.com>
+
+	* messages.cpp: Constified locals and sanitized formatting.
+	(_RWSTD_NO_V3_LOCALE): Removed dead macro.
+	(_V3_LOCALE): Replaced with _STD.
+
+2006-08-18  Martin Sebor  <se...@roguewave.com>
+
+	* collate.cpp (podarray.cc): #included in order to be able
+	to explicitly instantiate __rw_pod_array.
+
+2006-08-14  Martin Sebor  <se...@roguewave.com>
+
+	* podarray.h: Moved brace closing a namespace to the correct place.
+
+2006-08-14  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-276
+	* podarray.h (__rw_pod_array): Moved member initialization into
+	the body of the ctor in order to prevent HP aCC 3.70 ICE.
+
+2006-08-13  Martin Sebor  <se...@roguewave.com>
+
+	* exception.cpp: Added/modified comments.
+	* iostream.cpp: Same.
+	* tmpbuf.cpp: Same.
+	* facet.cpp: Same. Removed dead macro.
+	* setlocale.cpp: Same.
+
+2006-08-13  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-274
+	* collate.cpp (__rw_pod_array): Explicitly instantiated for Compaq C++
+	and other compilers that do not do so automatically when a template
+	specialization is used.
+	(_RWSTD_NO_V3_LOCALE, _V3_LOCALE): Removed dead macros.
+	* podarray.h (__rw_pod_array): Added explicit instantiation directive.
+	* ti_podarray.cpp: New file for the explicit instantiation of class
+	__rw_pod_array.
+
+2006-06-26  Anton Pevtsov  <an...@moscow.vdiweb.com>
+
+	* include/rw/_mutex.h: Added missed _RWSTD_EXPORT directive.
+	* src/exception.cpp: Added missed _RWSTD_EXPORT directive.
+
+2006-06-15  Martin Sebor  <se...@roguewave.com>
+
+	* atomic-64.s: Updated copyright notice.
+	* atomic.s: Same.
+
+2006-06-14  Martin Sebor  <se...@roguewave.com>
+
+	* collate.cpp (wcstombs): Decorated with dllimport to silence
+	MSVC warnings about incompatible DLL linkage.
+	* wcodecvt.cpp (wctomb): Same.
+
+2006-06-13  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-200
+	* _localedef.h (__rw_time_t): Changed function argument types
+	to silence Sun C++ 5.8 64-bit conversion/truncation warnings.
+	* punct.cpp (__rw_get_numpunct, __rw_get_moneypunct): Explicitly
+	cast wide expressions to the (narrower) destination type in order
+	to silence Sun C++ 5.8 64-bit truncation warnings.
+	* time_put.cpp (__rw_get_timepunct, __rw_get_zone): Same.
+
+2006-06-01  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-192
+	* atomic.s: Removed .type directives to prevent as errors
+	on Mac OS X.
+
+2006-05-12  Martin Sebor  <se...@roguewave.com>
+
+	* instance.cpp (__nullref): Increased the size of the array to make
+	big enough to accommodate std::wstring times two with some extra
+	space to spare.
+
+2006-04-20  Martin Sebor  <se...@roguewave.com>
+
+	* bitset.cpp (__rw_bit_count): Reimplemented to work around
+	an uncharacterized MSVC 8.0 codegen bug on EM64T and for
+	better efficiency (> 2x speedup on ILP32, likely much greater
+	on LP64).
+
+2006-03-28  Martin Sebor  <se...@roguewave.com>
+
+	* memattr.cpp (__rw_memattr): Checked errno for EFAULT and ENOMEM
+	after caling madvise() on Linux to prevent false negatives when
+	errno is set to EBADF for mapped address ranges not backed by a
+	file.
+
+2006-03-25  Martin Sebor  <se...@roguewave.com>
+
+	* locale_body.cpp (__rw_cats): Guarded the use of _RWSTD_CAT_5
+	and used _RWSTD_CAT_0 in its place when not #defined (e.g., by
+	dumb windoze).
+
+2006-03-25  Martin Sebor  <se...@roguewave.com>
+
+	* _defs.h (_RWSTD_VA_COPY): New helper macro.
+	* VA_LIST.cpp(_RWSTD_NO_VA_COPY): New macro #defined in response
+	to the C99 va_copy() macro not being #defined in <stdarg.h>.
+	* exception.cpp (__rw_vfmtwhat): Unconditionally used _RWSTD_VA_COPY().
+	* printf.cpp (rw_vasnprintf): Used _RWSTD_VA_COPY.
+	(rw_sprintf, rw_snprintf): Provided definitions.
+
+2006-03-25  Martin Sebor  <se...@roguewave.com>
+
+	* memattr.cpp (__rw_memattr): Used mvalid() instead of madvise()
+	on Tru64 UNIX.
+	Removed checks for errno values EFAULT and EINVAL for portability
+	and simply tested for any non-zero errno value.
+
+2006-03-22  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-140
+	* locale_body.cpp (_C_is_managed): Avoided an infinite loop
+	when _RWSTD_CAT_SEP is #defined to the empty string ("").
+
+2006-03-22  Martin Sebor  <se...@roguewave.com>
+
+	* locale_body.cpp (size_t): Used instead of _RWSTD_SIZE_T for
+	readability.
+	(_V3_LOCALE, _RWSTD_NO_V3_LOCALE): Removed dead macro/guard.
+	Minor formatting adjustments for consistency.
+
+2006-03-18  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-165
+	* num_get.cpp (__rw_get_num): Checked _LONG_DOUBLE in addition to __hpux
+	before using struct long_double in case the struct is not defined e.g.,
+	when using gcc's replacement <stdlib.h> on HP-UX.
+
+2006-03-17  Martin Sebor  <se...@roguewave.com>
+
+	* exception.cpp (_C_assign): Replaced size_t (~0) with SIZE_MAX
+	to avoid HP aCC remark 4237.
+	(operator=): Avoided the use of a comma expression in the return
+	statement to prevent the bogus HP aCC remark 4284 (operator= does
+	not return reference to *this).
+
+2006-03-17  Martin Sebor  <se...@roguewave.com>
+
+	* ti_filebuf.cpp (<stdio.h>): Included before <fstream> to get
+	the extended member functions of basic_filebuf that take FILE*
+	as an argument defined and to prevent unsats from programs that
+	do the same thing when extern template is enabled.
+	* ti_filebuf.cpp: Ditto.
+
+2006-03-16  Martin Sebor  <se...@roguewave.com>
+
+	* memattr.cpp (__rw_memattr): Handled EFAULT (set by HP-UX)
+	in addition to ENOMEM.
+
+2006-03-09  Martin Sebor  <se...@roguewave.com>
+
+	* collate.cpp (_RWSTD_MB_MAX): Defined to avoid using MB_LEN_MAX
+	in case it's less than 8 (the theoretical maximum for UTF-8) or
+	even less than 6 (the real maximum for UTF-8). Noted by HP aCC
+	6.07.
+	(__rw_get_w_ce_offset, __rw_get_wchar_offset, do_transform): Used
+	_RWSTD_MB_MAX.
+	(__rw_strnxfrm, __rw_wcsnxfrm): Plugged a potential memory leak
+	noted by HP aCC 6.07.
+
+2006-03-06  Martin Sebor  <se...@roguewave.com>
+
+	* atomic-cxx.S: Changed copyright to the ASF.
+
+2006-03-06  Martin Sebor  <se...@roguewave.com>
+
+	STDCXX-162
+	* _config.h (_RWSTD_NO_STRING_MUTEX): Removed conditional definition.
+	* _mutex.h (_RWSTD_ATOMIC_OPS): Corrected spelling and simplified the
+	handling of the macro. Handled x86_64 in the same block as IA64.
+	* _strref.h (_RWSTD_NO_STRING_MUTEX): Defined in response to
+	_RWSTD_ATOMIC_OPS being undefined.
+	* atomic.s: Handled __x86_64 (and __x86_64__).
+	* i86_64/atomic.s: AMD64/EM64T implementation.
+
+2006-03-03  Martin Sebor  <se...@roguewave.com>
+
+	* wcodecvt.cpp (wcrtomb): Corrected declaration.
+
+2006-02-02  Martin Sebor  <se...@roguewave.com>
+
+	* wcodecvt.cpp [_RWSTD_NO_WCRTOMB] (__rw_libc_do_out): Corrected
+	the spelling of wctomb() in conditionally compiled code.
+
+Updated.
+
 2006-02-01  Martin Sebor  <se...@roguewave.com>
 
 	* wcodecvt.cpp (__rw_libc_do_out): Removed the RWSTD_WCRTOMB macro and
 	instead explicitly spelled out the code	the macro used to expand to.
 	(__rw_libc_do_unshift): Same.
 	(__rw_libc_do_in): Same for _RWSTD_MBRTOWC().
-	
+
+2006-02-01  Martin Sebor  <se...@roguewave.com>
+
 	* wctype.cpp (<stdlib.h>): Included for wctomb.
 	(_RWSTD_NO_V3_LOCALE): Removed dead macro.
 	(__rw_toupper): Used _STD instead of _V3_LOCALE.
@@ -16,69 +617,69 @@
 
 2006-01-19  Martin Sebor  <se...@roguewave.com>
 
-        * string.cpp [_RWSTD_NO_MEMCPY] (__rw_memcpy): Corrected logic
-        errors in conditionally compiled code.
-        [_RWSTD_NO_MEMCHR] (__rw_memchr): Same.
-        [_RWSTD_NO_MEMCMP] (__rw_memcmp): Same.
-        [_RWSTD_NO_STRLEN] (__rw_strlen): Same(!) 
-        [_RWSTD_NO_WMEMCPY] (__rw_wmemcpy): Same.
-        [_RWSTD_NO_WMEMCHR] (__rw_wmemchr): Same.
-        [_RWSTD_NO_WMEMCMP] (__rw_wmemcmp): Same.
-        [_RWSTD_NO_WSTRLEN] (__rw_wcslen): Same.
+	* string.cpp [_RWSTD_NO_MEMCPY] (__rw_memcpy): Corrected logic
+	errors in conditionally compiled code.
+	[_RWSTD_NO_MEMCHR] (__rw_memchr): Same.
+	[_RWSTD_NO_MEMCMP] (__rw_memcmp): Same.
+	[_RWSTD_NO_STRLEN] (__rw_strlen): Same(!) 
+	[_RWSTD_NO_WMEMCPY] (__rw_wmemcpy): Same.
+	[_RWSTD_NO_WMEMCHR] (__rw_wmemchr): Same.
+	[_RWSTD_NO_WMEMCMP] (__rw_wmemcmp): Same.
+	[_RWSTD_NO_WSTRLEN] (__rw_wcslen): Same.
 
 2006-01-19  Martin Sebor  <se...@roguewave.com>
 
-        * string.cpp [_RWSTD_NO_MEMCPY] (__rw_memcpy): Explicitly cast void*
-        to char* before doing any arithmetic on the value.
-        (__rw_memchr): Same.
-        (__rw_memset): Same.
-        (__rw_memcmp): Same.
-        (__rw_memmove): Same. Added a missing return statement.
-        [_RWSTD_NO_WMEMMOVE] (__rw_wmemmove): Added a missing return statement.
+	* string.cpp [_RWSTD_NO_MEMCPY] (__rw_memcpy): Explicitly cast void*
+	to char* before doing any arithmetic on the value.
+	(__rw_memchr): Same.
+	(__rw_memset): Same.
+	(__rw_memcmp): Same.
+	(__rw_memmove): Same. Added a missing return statement.
+	[_RWSTD_NO_WMEMMOVE] (__rw_wmemmove): Added a missing return statement.
 
 2006-01-19  Martin Sebor  <se...@roguewave.com>
 
-        * wcodecvt.cpp [_RWSTD_NO_MBTOWC] (mbtowc): Declared when not
-        declared in <stdlib.h> but known to be defined in the libc binary.
-        (do_in, do_out, do_length): Guarded references to mbtowc() with
-        _RWSTD_NO_MBTOWC.
-        [_RWSTD_NO_MBRLEN && _RWSTD_NO_MBLEN] (__rw_libc_mbrlen): Silenced
-        an unused variable warning.
-        (do_unshift): Removed an unnecessary scope resolution operator
-        from a call to mbtowc().
+	* wcodecvt.cpp [_RWSTD_NO_MBTOWC] (mbtowc): Declared when not
+	declared in <stdlib.h> but known to be defined in the libc binary.
+	(do_in, do_out, do_length): Guarded references to mbtowc() with
+	_RWSTD_NO_MBTOWC.
+	[_RWSTD_NO_MBRLEN && _RWSTD_NO_MBLEN] (__rw_libc_mbrlen): Silenced
+	an unused variable warning.
+	(do_unshift): Removed an unnecessary scope resolution operator
+	from a call to mbtowc().
 
 2006-01-16  Martin Sebor  <se...@roguewave.com>
 
-        STDCXX-104
-        * wcodecvt.cpp (__rw_libc_do_out): Used the _RWSTD_WCSLEN() macro
+	STDCXX-104
+	* wcodecvt.cpp (__rw_libc_do_out): Used the _RWSTD_WCSLEN() macro
         instead of invoking wcslen() directly.
 
 2006-01-14  Martin Sebor  <se...@roguewave.com>
 
-        * codecvt.cpp (StateT): Moved convenience typedef from __rw_mbsinit
-        to file scope and used it to declare the function's formal argument.
+	* codecvt.cpp (StateT): Moved convenience typedef from __rw_mbsinit
+	to file scope and used it to declare the function's formal argument.
 
 2006-01-14  Martin Sebor  <se...@roguewave.com>
 
-        * wcodecvt.cpp (StateT): New convenience typedef.
-        (__rw_libstd_do_out): Documented the purpose of dead code
-        and unreachable warnings.
+	* wcodecvt.cpp (StateT): New convenience typedef.
+	(__rw_libstd_do_out): Documented the purpose of dead code
+	and unreachable warnings.
 
 2006-01-12  Martin Sebor  <se...@roguewave.com>
 
-        * codecvt.cpp: Removed assumptions about _RWSTD_MBSTATE_T being
-        a simple type (not really necessary after r368468 but it doesn't
-        hurt to be extra safe).
-        * wcodecvt.cpp: Same.
+	* codecvt.cpp: Removed assumptions about _RWSTD_MBSTATE_T being
+	a simple type (not really necessary after r368468 but it doesn't
+	hurt to be extra safe).
+	* wcodecvt.cpp: Same.
 
 2006-01-12  Martin Sebor  <se...@roguewave.com>
 
-        STDCXX-108
-        * TIMEZONE.cpp: New test to determine whether the POSIX timezone
-        variable is declared in <time.h>.
-        * time_put.cpp (__rw_get_zone): Changed to return 0 instead of void
-        on success (and non-zero on error) and handled _RWSTD_NO_TIMEZONE.
-        (__rw_get_time_put_data): Handled __rw_get_zone failure.
+	STDCXX-108
+	* TIMEZONE.cpp: New test to determine whether the POSIX timezone
+	variable is declared in <time.h>.
+	* time_put.cpp (__rw_get_zone): Changed to return 0 instead of void
+	on success (and non-zero on error) and handled _RWSTD_NO_TIMEZONE.
+	(__rw_get_time_put_data): Handled __rw_get_zone failure.
 
 2006-01-11  Andrew Black <ab...@roguewave.com>
 
@@ -355,9 +956,9 @@
 
 2005-07-26  Martin Sebor  <se...@roguewave.com>
 
-	Set the svn:keywords property and enabled the expansion
-	of the Id keyword.
+	Set the svn:keywords property and enabled the expansion of the Id
+	keyword.
 
-2005-07-18  Martin Sebor  <se...@roguewave.com>
+2005-07-19  Martin Sebor  <se...@roguewave.com>
 
 	Initial import of the Rogue Wave C++ Standard library 4.1.2.

Modified: incubator/stdcxx/branches/4.2.0/src/atomic-cxx.S
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/atomic-cxx.S?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/atomic-cxx.S (original)
+++ incubator/stdcxx/branches/4.2.0/src/atomic-cxx.S Fri Sep 28 13:55:52 2007
@@ -6,22 +6,23 @@
  *
  ***************************************************************************
  *
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
  *
- * Copyright 2003-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2003-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 

Modified: incubator/stdcxx/branches/4.2.0/src/atomic.s
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/atomic.s?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/atomic.s (original)
+++ incubator/stdcxx/branches/4.2.0/src/atomic.s Fri Sep 28 13:55:52 2007
@@ -6,22 +6,23 @@
  *
  ***************************************************************************
  *
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
  *
- * Copyright 2003-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2003-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 

Modified: incubator/stdcxx/branches/4.2.0/src/catalog.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/catalog.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/catalog.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/catalog.cpp Fri Sep 28 13:55:52 2007
@@ -71,12 +71,14 @@
 
   CatVector::size_type __catfind(nl_catd id)
   {
-    CatVector::size_type i = 0;
-    while (i < __rw_catlist.size() && __rw_catlist[i] && __rw_catlist[i]->id() != id)
-      i++;
-    if (!__rw_catlist[i])
-      return __rw_catlist.size();
-    return i;
+    for (CatVector::size_type i = 0;
+         i < __rw_catlist.size() && __rw_catlist[i]; ++i) {
+
+      if (__rw_catlist[i]->id() == id)
+          return i;
+    }
+    
+    return __rw_catlist.size();
   }  
 
 
@@ -95,8 +97,7 @@
 
         if (cat && cat->good()) {
             CatVector::size_type i = 0;
-            while (__rw_catlist[i] != 0)
-                i++;
+            for (; i < __rw_catlist.size() && __rw_catlist[i]; ++i) ;
             if (__rw_catlist.size() == i)
                 __rw_catlist.resize(__rw_catlist.size() * 2,0);
             __rw_catlist[i] = cat;
@@ -135,7 +136,7 @@
     delete __rw_catlist[i];
     __rw_catlist[i] = 0;
     CatVector::size_type j;
-    for (j = i+1; __rw_catlist[j] && j < __rw_catlist.size(); j++)
+    for (j = i+1; j < __rw_catlist.size() && __rw_catlist[j]; j++)
       __rw_catlist[j-1] = __rw_catlist[j];
     if (j < __rw_catlist.size())
       __rw_catlist[j] = 0;

Modified: incubator/stdcxx/branches/4.2.0/src/codecvt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/codecvt.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/codecvt.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/codecvt.cpp Fri Sep 28 13:55:52 2007
@@ -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-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -30,8 +30,6 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 
 // working around a Compaq C++ bug (see PR #26778)
 #if __DECCXX_VER >= 60300000 && __DECCXX_VER < 60400000
@@ -93,12 +91,20 @@
 }   // namespace __rw
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) {
+_RWSTD_NAMESPACE (std) {
 
 
 _RW::__rw_facet_id codecvt<char, char, _RWSTD_MBSTATE_T>::id;
 
 
+codecvt<char, char, _RWSTD_MBSTATE_T>::
+codecvt (size_t refs /* = 0 */)
+    : _RW::__rw_facet (refs), _C_always_noconv (-1)
+{
+    // empty
+}
+
+
 /* virtual */ codecvt<char, char, _RWSTD_MBSTATE_T>::~codecvt ()
 {
     // no-op
@@ -259,11 +265,10 @@
 }
 
 
-}   // namespace _V3_LOCALE
+}   // namespace std
 
 #define TARGS_C   <char, char, _RWSTD_MBSTATE_T>
 
 _RWSTD_DEFINE_FACET_FACTORY (static, codecvt, TARGS_C, codecvt);
 _RWSTD_SPECIALIZE_USE_FACET (codecvt);
 
-#endif   // _RWSTD_NO_V3_LOCALE

Modified: incubator/stdcxx/branches/4.2.0/src/ctype_bits.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/ctype_bits.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/ctype_bits.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/ctype_bits.cpp Fri Sep 28 13:55:52 2007
@@ -30,12 +30,10 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 #include <loc/_ctype.h>
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) {
+_RWSTD_NAMESPACE (std) {
 
 
 _RWSTD_DEFINE_STATIC_CONST (const ctype_base::mask ctype_base::space);
@@ -52,7 +50,5 @@
 
 _RWSTD_DEFINE_STATIC_CONST (const _RWSTD_SIZE_T ctype<char>::table_size);
 
-}   // namespace _V3_LOCALE
-
 
-#endif   // _RWSTD_NO_V3_LOCALE
+}   // namespace std

Modified: incubator/stdcxx/branches/4.2.0/src/export.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/export.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/export.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/export.cpp Fri Sep 28 13:55:52 2007
@@ -127,3 +127,32 @@
 #include "podarray.cc"
 
 #endif   // _RWSTD_NO_EXPORT
+
+// export __rw_atomic_xxx() functions, defined in atomic.asm
+#if defined (_WIN32) && defined (_DLL)
+
+#  if defined (_M_IX86)
+
+#    pragma comment(linker, "/EXPORT:___rw_atomic_add8")
+#    pragma comment(linker, "/EXPORT:___rw_atomic_add16")
+#    pragma comment(linker, "/EXPORT:___rw_atomic_add32")
+#    pragma comment(linker, "/EXPORT:___rw_atomic_xchg8")
+#    pragma comment(linker, "/EXPORT:___rw_atomic_xchg16")
+#    pragma comment(linker, "/EXPORT:___rw_atomic_xchg32")
+
+#  elif defined (_M_X64)
+
+#    pragma comment(linker, "/EXPORT:__rw_atomic_add8")
+#    pragma comment(linker, "/EXPORT:__rw_atomic_add16")
+#    pragma comment(linker, "/EXPORT:__rw_atomic_add32")
+#    pragma comment(linker, "/EXPORT:__rw_atomic_xchg8")
+#    pragma comment(linker, "/EXPORT:__rw_atomic_xchg16")
+#    pragma comment(linker, "/EXPORT:__rw_atomic_xchg32")
+
+#    ifdef _RWSTD_INT64_T
+#      pragma comment(linker, "/EXPORT:__rw_atomic_add64")
+#      pragma comment(linker, "/EXPORT:__rw_atomic_xchg64")
+#    endif   // _RWSTD_INT64_T
+#  endif   // _M_IX86
+
+#endif   // _WIN32 && _DLL

Modified: incubator/stdcxx/branches/4.2.0/src/facet.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/facet.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/facet.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/facet.cpp Fri Sep 28 13:55:52 2007
@@ -30,30 +30,14 @@
 
 #include <rw/_defs.h>
 
-// unistd.h is included here because of PR #26255
-#ifndef _MSC_VER
-#  include <unistd.h>
-#endif  // _MSC_VER
-
 #include <locale.h>   // for LC_XXX costants
 #include <stdlib.h>   // for bsearch(), getenv(), qsort()
 #include <string.h>   // for memcpy(), strlen()
 
-#include <sys/stat.h>
-
-#ifndef _MSC_VER
-#  include <sys/mman.h>
-#else
-#  include <windows.h>
-#  include <io.h>
-#endif   // _MSC_VER
-
-#include <sys/types.h>
-#include <fcntl.h>
-
 #include <iosfwd>         // for mbstate_t
 
 #include "access.h"
+#include "mman.h"
 
 #include <loc/_facet.h>
 #include <loc/_locale.h>
@@ -99,93 +83,6 @@
     }
 
     return 0;
-}
-
-
-// maps a named file into memory as shared, read-only, returns
-// the beginning address on success and fills `size' with the
-// size of the file; returns 0 on failure
-static
-void* __rw_mmap (const char* fname, _RWSTD_SIZE_T *size)
-{
-    _RWSTD_ASSERT (0 != fname);
-    _RWSTD_ASSERT (0 != size);
-
-#if !defined (_MSC_VER)
-    struct stat sb;
-    if (stat (fname, &sb) == -1)
-#else
-    struct _stat sb;
-    if (_stat (fname, &sb) == -1)
-#endif
-        return 0;
-
-    *size = sb.st_size;
-
-#if !defined(_MSC_VER)
-    const int fd = open (fname, O_RDONLY);
-
-    if (-1 == fd)
-        return 0;
-
-    // On HPUX systems MAP_SHARED will prevent a second mapping of the same
-    // file if the regions are overlapping; one solution is to make the 
-    // mapping private.
-#if defined(__hpux)
-    void *data = mmap (0, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-#else
-    void *data = mmap (0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
-#endif // defined(__hpux__)
-
-    close (fd);
-
-#ifndef MAP_FAILED
-#  define MAP_FAILED (void*)-1
-#endif
-
-    if (MAP_FAILED == data)   // failure
-        return 0;
-#else
-    HANDLE mmf = 
-        CreateFile (fname, GENERIC_READ, FILE_SHARE_READ, NULL,
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
-    if (mmf == INVALID_HANDLE_VALUE)
-        return 0;
-                              
-    HANDLE mmfv = 
-        CreateFileMapping (mmf, NULL, PAGE_READONLY, 0, 0, NULL);
-    if (mmfv == INVALID_HANDLE_VALUE) {
-        CloseHandle (mmf);
-        return 0;
-    }
-
-    void * data = 
-        MapViewOfFile (mmfv, FILE_MAP_READ, 0, 0, sb.st_size);
-
-    // The handles can be safely closed
-    CloseHandle (mmf);
-    CloseHandle (mmfv);
-
-#endif  // _MSC_VER
-
-    return data;
-}
-
-static inline 
-void __rw_munmap (const void* pcv, _RWSTD_SIZE_T size)
-{
-    _RWSTD_ASSERT (pcv && size);
-
-        // cast first to void*
-    void* pv = _RWSTD_CONST_CAST (void*, pcv);
-
-    // POSIX munmap() takes a void*, but not all platforms conform
-#ifndef _MSC_VER
-    munmap (_RWSTD_STATIC_CAST (_RWSTD_MUNMAP_ARG1_T, pv), size);
-#else
-    UnmapViewOfFile (pv);
-#endif  // _MSC_VER
 }
 
 

Modified: incubator/stdcxx/branches/4.2.0/src/i86/atomic.s
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/i86/atomic.s?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/i86/atomic.s (original)
+++ incubator/stdcxx/branches/4.2.0/src/i86/atomic.s Fri Sep 28 13:55:52 2007
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2003-2006 Rogue Wave Software.
+ * Copyright 2003-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -33,6 +33,14 @@
 #  define TYPE_DIR(ign1, ign2)
 #endif
 
+#if defined (__CYGWIN__)
+   /* on cygwin used COFF object file format
+      C-functions names should prepended by '_' */
+#  define SYMNAME(name)    _##name
+#else
+#  define SYMNAME(name)    name
+#endif
+
     .text
     .align 4
 
@@ -43,13 +51,13 @@
  * the original (before assignment) 8-bit value of *x.
  **************************************************************************/
 
-    .globl __rw_atomic_xchg8
+    .globl SYMNAME (__rw_atomic_xchg8)
     TYPE_DIR (__rw_atomic_xchg8, @function)
 
-__rw_atomic_xchg8:                 /* ; char (char *x, char y)        */
+SYMNAME (__rw_atomic_xchg8):       /* ; char (char *x, char y)        */
     mov           4(%esp), %ecx    /* ; %ecx = x                      */
     movb          8(%esp), %al     /* ; %al = y                       */
-    xchg          %al, (%ecx)      /* ; %al <-> (%ecx)                */
+    xchgb         %al, (%ecx)      /* ; %al <-> (%ecx)                */
     ret
 
 
@@ -60,10 +68,10 @@
  * the original (before assignment) 16-bit value of *x.
  **************************************************************************/
 
-    .globl __rw_atomic_xchg16
+    .globl SYMNAME (__rw_atomic_xchg16)
     TYPE_DIR (__rw_atomic_xchg16, @function)
 
-__rw_atomic_xchg16:                /* ; short (short *x, short y)     */
+SYMNAME (__rw_atomic_xchg16):      /* ; short (short *x, short y)     */
     mov           4(%esp), %ecx    /* ; %ecx = x                      */
     mov           8(%esp), %eax    /* ; %eax = y                      */
     xchgw         %ax, (%ecx)      /* ; %ax <-> (%ecx)                */
@@ -77,10 +85,10 @@
  * the original (before assignment) 32-bit value of *x.
  **************************************************************************/
 
-    .globl __rw_atomic_xchg32
+    .globl SYMNAME (__rw_atomic_xchg32)
     TYPE_DIR (__rw_atomic_xchg32, @function)
 
-__rw_atomic_xchg32:                /* ; int (int *x, int y)           */
+SYMNAME (__rw_atomic_xchg32):      /* ; int (int *x, int y)           */
     movl          4(%esp), %ecx    /* ; %ecx = x                      */
     movl          8(%esp), %eax    /* ; %eax = y                      */
     xchgl         %eax, (%ecx)     /* ; %eax <-> (%ecx)               */
@@ -94,10 +102,10 @@
  * the new (after increment) 8-bit value of *x.
  **************************************************************************/
 
-    .globl __rw_atomic_add8
+    .globl SYMNAME (__rw_atomic_add8)
     TYPE_DIR (__rw_atomic_add8, @function)
 
-__rw_atomic_add8:                  /* ; char (char *dst, int inc)     */
+SYMNAME (__rw_atomic_add8):        /* ; char (char *dst, int inc)     */
     mov            4(%esp), %ecx   /* ; %ecx = dst                    */
     mov            8(%esp), %eax   /* ; %eax = inc                    */
     mov            %eax, %edx      /* ; */
@@ -118,10 +126,10 @@
  * the new (after increment) 16-bit value of *x.
  **************************************************************************/
 
-     .globl __rw_atomic_add16
+     .globl SYMNAME (__rw_atomic_add16)
     TYPE_DIR (__rw_atomic_add16, @function)
 
-__rw_atomic_add16:                 /* ; long (long *dst, long inc)    */
+SYMNAME (__rw_atomic_add16):       /* ; short (short *dst, short inc) */
     mov            4(%esp), %ecx   /* ; %ecx = dst                    */
     mov            8(%esp), %eax   /* ; %eax = inc                    */
     mov            %eax, %edx      /* ; */
@@ -129,7 +137,7 @@
     lock
     xaddw          %ax, (%ecx)     /* ; tmp = *dst;
                                       ; dst += inc;
-                                      ; eax = tmp                     */
+                                      ; %ax = tmp                     */
 
     add            %edx, %eax      /* ; return %eax + inc             */
     ret
@@ -142,10 +150,10 @@
  * the new (after increment) 32-bit value of *x.
  **************************************************************************/
 
-    .globl __rw_atomic_add32
+    .globl SYMNAME (__rw_atomic_add32)
     TYPE_DIR (__rw_atomic_add32, @function)
 
-__rw_atomic_add32:                 /* ; long (long *dst, long inc)    */
+SYMNAME (__rw_atomic_add32):       /* ; int (int *dst, int inc)       */
     movl           4(%esp), %ecx   /* ; %ecx = dst                    */
     movl           8(%esp), %edx   /* ; %edx = inc                    */
     movl           %edx, %eax      /* ; */

Modified: incubator/stdcxx/branches/4.2.0/src/i86_64/atomic.s
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/i86_64/atomic.s?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/i86_64/atomic.s (original)
+++ incubator/stdcxx/branches/4.2.0/src/i86_64/atomic.s Fri Sep 28 13:55:52 2007
@@ -6,22 +6,23 @@
  *
  ***************************************************************************
  *
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
  *
- * Copyright 2005-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2005-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -55,7 +56,7 @@
     .type __rw_atomic_xchg16, @function
 __rw_atomic_xchg16:                /* ; int16_t (int16_t *x, int16_t y) */
     movq          %rdi, %rcx       /* ; %rcx = x                        */
-    movw          %si,  %ax        /* ; %eax = y                        */
+    movw          %si,  %ax        /* ; %ax = y                         */
     xchgw         %ax, (%rcx)      /* ; %ax <-> (%rcx)                  */
     ret
 
@@ -131,7 +132,7 @@
     lock                           /* ; lock the bus                        */
     xaddw          %ax, (%rcx)     /* ; tmp = *dst                          */
                                    /* ; dst += inc                          */
-                                   /* ; eax = tmp                           */
+                                   /* ; %ax = tmp                            */
 
     addw           %dx,  %ax       /* ; return %ax + inc                    */
     ret
@@ -161,7 +162,7 @@
 
 
 /***************************************************************************
- * extern "C" int64_t __rw_atomic_add32 (int64_t *x, int64_t y);
+ * extern "C" int64_t __rw_atomic_add64 (int64_t *x, int64_t y);
  *
  * Atomically increments the 32-bit value *x by y and returns
  * the new (after increment) 32-bit value of *x.
@@ -177,7 +178,7 @@
     lock                           /* ; lock the bus                        */
     xaddq          %rax, (%rcx)    /* ; tmp = *dst                          */
                                    /* ; dst += inc                          */
-                                   /* ; %eax = tmp                          */
+                                   /* ; %rax = tmp                          */
 
-    addq           %rdx, %rax      /* ; return %eax + inc                   */
+    addq           %rdx, %rax      /* ; return %rax + inc                   */
     ret

Modified: incubator/stdcxx/branches/4.2.0/src/ia64/atomic-64.s
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/ia64/atomic-64.s?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/ia64/atomic-64.s (original)
+++ incubator/stdcxx/branches/4.2.0/src/ia64/atomic-64.s Fri Sep 28 13:55:52 2007
@@ -1,27 +1,28 @@
 ////////////////////////////////////////////////////////////////////////////
 //
-// atomic-ia64.s
+// ia64/atomic-ia64.s
 //
 // $Id$
 //
 ////////////////////////////////////////////////////////////////////////////
 //
-// Copyright 2005-2006 The Apache Software Foundation or its licensors,
-// as applicable.
+// Licensed to the Apache Software  Foundation (ASF) under one or more
+// contributor  license agreements.  See  the NOTICE  file distributed
+// with  this  work  for  additional information  regarding  copyright
+// ownership.   The ASF  licenses this  file to  you under  the Apache
+// License, Version  2.0 (the  "License"); you may  not use  this file
+// except in  compliance with the License.   You may obtain  a copy of
+// the License at
 //
-// Copyright 2003-2006 Rogue Wave Software.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// distributed under the  License is distributed on an  "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+// implied.   See  the License  for  the  specific language  governing
+// permissions and limitations under the License.
+//
+// Copyright 2003-2006 Rogue Wave Software.
 //
 ////////////////////////////////////////////////////////////////////////////
 

Modified: incubator/stdcxx/branches/4.2.0/src/ia64/atomic.s
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/ia64/atomic.s?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/ia64/atomic.s (original)
+++ incubator/stdcxx/branches/4.2.0/src/ia64/atomic.s Fri Sep 28 13:55:52 2007
@@ -1,27 +1,28 @@
 ////////////////////////////////////////////////////////////////////////////
 //
-// atomic-ia64-32.s
+// ia64/atomic.s
 //
 // $Id$
 //
 ////////////////////////////////////////////////////////////////////////////
 //
-// Copyright 2005-2006 The Apache Software Foundation or its licensors,
-// as applicable.
+// Licensed to the Apache Software  Foundation (ASF) under one or more
+// contributor  license agreements.  See  the NOTICE  file distributed
+// with  this  work  for  additional information  regarding  copyright
+// ownership.   The ASF  licenses this  file to  you under  the Apache
+// License, Version  2.0 (the  "License"); you may  not use  this file
+// except in  compliance with the License.   You may obtain  a copy of
+// the License at
 //
-// Copyright 2003-2006 Rogue Wave Software.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// distributed under the  License is distributed on an  "AS IS" BASIS,
+// WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+// implied.   See  the License  for  the  specific language  governing
+// permissions and limitations under the License.
+//
+// Copyright 2003-2006 Rogue Wave Software.
 //
 ////////////////////////////////////////////////////////////////////////////
 

Modified: incubator/stdcxx/branches/4.2.0/src/iso2022.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/iso2022.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/iso2022.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/iso2022.cpp Fri Sep 28 13:55:52 2007
@@ -30,8 +30,6 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 #include <string.h>     // for strxxx()
 #include <iosfwd>       // for mbstate_t
 
@@ -123,9 +121,9 @@
 #endif
 
 
-#define CODECVT_ERROR   _V3_LOCALE::codecvt_base::error
-#define CODECVT_OK      _V3_LOCALE::codecvt_base::ok
-#define CODECVT_PARTIAL _V3_LOCALE::codecvt_base::partial
+#define CODECVT_ERROR   _STD::codecvt_base::error
+#define CODECVT_OK      _STD::codecvt_base::ok
+#define CODECVT_PARTIAL _STD::codecvt_base::partial
 
 
 _RWSTD_NAMESPACE (__rw) {
@@ -661,7 +659,7 @@
 // given by the last parameter and is currently one of the following:
 //   - ISO_2022-JP
 //   - ISO_2022-JP2
-static _V3_LOCALE::codecvt_base::result
+static _STD::codecvt_base::result
 __rw_iso2022jp_designate (__rw_iso2022_state_t& state,
                           char*&                to,
                           char*                 to_end,
@@ -779,7 +777,7 @@
 // Upon entry:
 //   - from  - points to the first byte after the ESCAPE_CHAR indicator;
 //   - enc   - encoding type.
-static _V3_LOCALE::codecvt_base::result
+static _STD::codecvt_base::result
 __rw_iso2022_escape (__rw_iso2022_state_t& state,
                      const char*&          from,
                      const char*           from_end,
@@ -861,10 +859,10 @@
 // ISO-2022-JP conversion from ANSI_X3.4-1968
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_ascii_to_iso2022 (__rw_iso2022_state_t& state,
                        const char*&          from,
                        const char*           from_end,
@@ -879,7 +877,7 @@
     _RWSTD_ASSERT (from_end-from >= int(width));
     _RWSTD_UNUSED (from_end);
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // check the designation sequence
     if (state.g_map [0] != reg) {
@@ -916,10 +914,10 @@
 // ISO-2022-JP conversion from KSC5601-1987
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_ksc5601_to_iso2022 (__rw_iso2022_state_t& state,
                          const char*&        from,
                          const char*         from_end,
@@ -934,7 +932,7 @@
     _RWSTD_ASSERT(from_end-from >= int(width));
     _RWSTD_UNUSED(from_end);
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // check the designation sequence
     if (state.g_map [0] != reg) {
@@ -971,10 +969,10 @@
 // ISO-2022-JP conversion from GB2312-1980
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_gb2312_to_iso2022 (__rw_iso2022_state_t& state,
                         const char*&          from,
                         const char*           from_end,
@@ -989,7 +987,7 @@
     _RWSTD_ASSERT(from_end-from >= int(width));
     _RWSTD_UNUSED(from_end);
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // check the designation sequence
     if (state.g_map [0] != reg) {
@@ -1026,10 +1024,10 @@
 // ISO-2022-JP conversion from ISO-8859-7
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_iso88597_to_iso2022 (__rw_iso2022_state_t& state,
                           const char*&          from,
                           const char*           from_end,
@@ -1044,7 +1042,7 @@
     _RWSTD_ASSERT(from_end-from >= int(width2));
     _RWSTD_UNUSED(from_end);
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // always call designate for this one; designation will at least insert a
     // single shift function in the destination buffer
@@ -1073,10 +1071,10 @@
 // ISO-2022-JP conversion from ISO-8859-1
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_iso88591_to_iso2022 (__rw_iso2022_state_t& state,
                           const char*&          from,
                           const char*           from_end,
@@ -1091,7 +1089,7 @@
     _RWSTD_ASSERT(from_end-from >= int(width2));
     _RWSTD_UNUSED(from_end);
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // always call designate for this one; designation will at least insert a
     // single shift function in the destination buffer
@@ -1120,10 +1118,10 @@
 // ISO-2022-JP conversion from packed EUC-JP
 // Convert one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_eucjp_to_iso2022 (__rw_iso2022_state_t& state,
                        const char*&          from,
                        const char*           from_end,
@@ -1134,7 +1132,7 @@
     int width = 0;
     unsigned char reg = 0;
 
-    _V3_LOCALE::codecvt_base::result ret;
+    _STD::codecvt_base::result ret;
 
     // convert and store the encoding
     unsigned char c = *_RWSTD_REINTERPRET_CAST(const unsigned char*, from);
@@ -1204,18 +1202,18 @@
 // ISO-2022-JP conversion to GB2312-1980
 // Converts one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
 static inline
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022_to_gb2312 (const char*& from,
                         const char*  from_end,
                         char*&       to,
                         int          /* reg */,
                         int          /* enc */)
 {
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     if (from_end - from < GB2312_CHAR_LEN)
         return res;
@@ -1231,18 +1229,18 @@
 // ISO-2022-JP conversion to KSC2312
 // Converts one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
 static inline
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022_to_ksc5601 (const char*& from,
                          const char*  from_end,
                          char*&       to,
                          int          /* reg */,
                          int          /* enc */)
 {
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     if (from_end - from < KSC5601_CHAR_LEN)
         return res;
@@ -1258,18 +1256,18 @@
 // ISO-2022-JP conversion to ISO-8859-1
 // Converts one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
 static inline
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022_to_iso88591 (const char*& from,
                           const char*  from_end,
                           char*&       to,
                           int          /* reg */,
                           int          /* enc */)
 {
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     if (from_end - from < ISO_8859_1_CHAR_LEN)
         return res;
@@ -1284,18 +1282,18 @@
 // ISO-2022-JP conversion to ISO-8859-7
 // Converts one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
 static inline
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022_to_iso88597 (const char*& from,
                           const char*  from_end,
                           char*&       to,
                           int          /* reg */,
                           int          /* enc */)
 {
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     if (from_end - from < ISO_8859_7_CHAR_LEN)
         return res;
@@ -1310,10 +1308,10 @@
 // ISO-2022-JP conversion to packed EUC-JP
 // Converts one character.
 // Returns:
-//    _V3_LOCALE::codecvt_base::ok      in case the conversion succeeded
-//    _V3_LOCALE::codecvt_base::partial for partial conversions
-//    _V3_LOCALE::codecvt_base::error   erroneous sequence
-static _V3_LOCALE::codecvt_base::result
+//    std::codecvt_base::ok      in case the conversion succeeded
+//    std::codecvt_base::partial for partial conversions
+//    std::codecvt_base::error   erroneous sequence
+static _STD::codecvt_base::result
 __rw_iso2022_to_eucjp (const char*&          from,
                        const char*           from_end,
                        char*&                to,
@@ -1327,7 +1325,7 @@
     if (from_end - from < width)
         return CODECVT_OK;
 
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     // from either the ANSI_X3.4-1968 or JIS X 0201 Roman or JIS X 0201 Kana
     switch (reg) {
@@ -1382,7 +1380,7 @@
 //  Converts  one  character  from  the  external  representation  to  the
 //  intermediary encoding  that is later  used in retrieving  the internal
 //  representation of that character
-static _V3_LOCALE::codecvt_base::result
+static _STD::codecvt_base::result
 __rw_iso2022_to_interm (__rw_iso2022_state_t& state,
                         const char*&          from,
                         const char*           from_end,
@@ -1390,7 +1388,7 @@
                         unsigned char&        reg,
                         int                   enc)
 {
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     bool first = true;
     for (; *from == ESCAPE_CHAR; first = false) {
@@ -1458,7 +1456,7 @@
 }
 
 
-static _V3_LOCALE::codecvt_base::result
+static _STD::codecvt_base::result
 __rw_ucs4_to_eucjp (const wchar_t*& from,
                     const wchar_t*  from_end,
                     char*&          to,
@@ -1594,7 +1592,7 @@
 
 
 // does the conversion of one character to internal representation
-static _V3_LOCALE::codecvt_base::result
+static _STD::codecvt_base::result
 __rw_iso2022_to_ucs4 (_RWSTD_MBSTATE_T&     state,
                       __rw_iso2022_state_t* iso_state,
                       const char*&          from,
@@ -1603,7 +1601,7 @@
                       wchar_t*              /* to_end */,
                       int                   enc)
 {
-    _V3_LOCALE::codecvt_base::result res;
+    _STD::codecvt_base::result res;
 
     // the registration code of the character set
     unsigned char reg   = iso_state->g_map [0];
@@ -1695,7 +1693,7 @@
 /****************************************************************************/
 
 // Conversion from ISO-2022-JP to UCS-4
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp_do_in (_RWSTD_MBSTATE_T& state,
                       const char*&      from,
                       const char*       from_end,
@@ -1716,7 +1714,7 @@
 
     while (from_end - from && to_end - to) {
         // operation result
-        _V3_LOCALE::codecvt_base::result res;
+        _STD::codecvt_base::result res;
         res = __rw_iso2022_to_ucs4 (state, iso_state, from_next,
                                     from_end, to_next, to_end, iso2022_jp);
 
@@ -1740,7 +1738,7 @@
 
 
 // Conversion from UCS-4 to ISO-2022-JP
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp_do_out (_RWSTD_MBSTATE_T& state,
                        const wchar_t*&   from,
                        const wchar_t*    from_end,
@@ -1771,7 +1769,7 @@
     // Loop until the source buffer is consumed, an error occurs, or
     // the destination buffer reaches capacity
     while (from_end - from && to_end - to) {
-        _V3_LOCALE::codecvt_base::result res;
+        _STD::codecvt_base::result res;
 
         // convert the UCS-4 value to EUC-JP
         const wchar_t* ps   = from;
@@ -1817,11 +1815,11 @@
 }
 
 
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp_do_unshift (_RWSTD_MBSTATE_T& state,
                            char*& to, char* to_end)
 {
-    _V3_LOCALE::codecvt_base::result res =
+    _STD::codecvt_base::result res =
         CODECVT_ERROR;
 
     // the iso2022 state
@@ -1861,7 +1859,7 @@
         return CODECVT_ERROR;
 
     int ret = 0;
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
     while (max && from_end - from) {
         while (*from == ESCAPE_CHAR)
 
@@ -1911,7 +1909,7 @@
 /****************************************************************************/
 
 // Conversion from ISO-2022-JP to UCS-4
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp2_do_in (_RWSTD_MBSTATE_T& state,
                        const char*&      from,
                        const char*       from_end,
@@ -1933,7 +1931,7 @@
         wchar_t*    to_next   = to;
 
         // operation result
-        _V3_LOCALE::codecvt_base::result res;
+        _STD::codecvt_base::result res;
         res = __rw_iso2022_to_ucs4 (state, iso_state, from_next,
                                     from_end, to_next, to_end, iso2022_jp2);
 
@@ -1957,7 +1955,7 @@
 
 
 // Conversion from UCS-4 to ISO-2022-JP-2
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp2_do_out (_RWSTD_MBSTATE_T& state,
                        const wchar_t*&    from,
                        const wchar_t*     from_end,
@@ -1977,7 +1975,7 @@
     // Loop until the source buffer is consumed, an error occurs, or
     // the destination buffer reaches capacity
     while (from_end - from && to_end - to) {
-        _V3_LOCALE::codecvt_base::result res;
+        _STD::codecvt_base::result res;
 
         // convert the UCS-4 value to intermediary encoding
         const wchar_t* ps   = from;
@@ -2058,7 +2056,7 @@
 }
 
 
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp2_do_unshift (_RWSTD_MBSTATE_T& state,
                             char*& to, char* to_end)
 {
@@ -2081,7 +2079,7 @@
         return CODECVT_ERROR;
 
     int ret = 0;
-    _V3_LOCALE::codecvt_base::result res = CODECVT_OK;
+    _STD::codecvt_base::result res = CODECVT_OK;
 
     while (max && from_end - from) {
 
@@ -2153,5 +2151,3 @@
 }
 
 }   // namespace __rw
-
-#endif   // _RWSTD_NO_V3_LOCALE

Modified: incubator/stdcxx/branches/4.2.0/src/iso2022.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/iso2022.h?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/iso2022.h (original)
+++ incubator/stdcxx/branches/4.2.0/src/iso2022.h Fri Sep 28 13:55:52 2007
@@ -54,17 +54,17 @@
 
 
 // Conversions for ISO-2022-JP
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp_do_in (_RWSTD_MBSTATE_T&,
                       const char*&, const char*,
                       wchar_t*&, wchar_t*);
 
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp_do_out (_RWSTD_MBSTATE_T&,
                        const wchar_t*&, const wchar_t*,
                        char*&, char*);
 
-_V3_LOCALE::codecvt_base::result 
+_STD::codecvt_base::result 
 __rw_iso2022jp_do_unshift (_RWSTD_MBSTATE_T&, char*&, char*);
 
 int  __rw_iso2022jp_do_encoding ();
@@ -78,17 +78,17 @@
 
 
 // Conversions for ISO-2022-JP-2
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp2_do_in (_RWSTD_MBSTATE_T&,
                        const char*&, const char*,
                        wchar_t*&, wchar_t*);
 
-_V3_LOCALE::codecvt_base::result
+_STD::codecvt_base::result
 __rw_iso2022jp2_do_out (_RWSTD_MBSTATE_T&,
                        const wchar_t*&, const wchar_t*,
                        char*&, char*);
 
-_V3_LOCALE::codecvt_base::result 
+_STD::codecvt_base::result 
 __rw_iso2022jp2_do_unshift (_RWSTD_MBSTATE_T&, char*&, char*);
 
 int  __rw_iso2022jp2_do_encoding  ();

Modified: incubator/stdcxx/branches/4.2.0/src/limits_bits.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/limits_bits.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/limits_bits.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/limits_bits.cpp Fri Sep 28 13:55:52 2007
@@ -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-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -30,6 +30,11 @@
 
 #include <float.h>    // for INFINITY, NAN
 #include <stdlib.h>   // for atof()
+
+// must not #include <limits> to avoid colliding with symbols
+// declared there with a different type than what they are
+// defined with here
+// #include <limits>
                        
 #include <rw/_defs.h>  
                        
@@ -42,126 +47,106 @@
 #    error one of _RWSTD_NO_INFINITY and _RWSTD_DBL_INF_BITS must be #defined
 #  endif
 
-// infinity computed at config time
-static const union {
-    char _C_bits [sizeof (double)];
-    double _C_val;
-} __rw_dbl_inf_bits = { _RWSTD_DBL_INF_BITS };
 
-_RWSTD_EXPORT extern const double __rw_dbl_infinity = __rw_dbl_inf_bits._C_val;
-
-static const union {
-    char _C_bits [sizeof (float)];
+union _FltBits {
+    char  _C_bits [sizeof (float)];
     float _C_val;
-} __rw_flt_inf_bits = { _RWSTD_FLT_INF_BITS };
+};
 
-_RWSTD_EXPORT extern const float __rw_flt_infinity = __rw_flt_inf_bits._C_val;
+
+union _DblBits {
+    char   _C_bits [sizeof (double)];
+    double _C_val;
+};
 
 
 #  ifndef _RWSTD_NO_LONG_DOUBLE
 
-static const union {
-    char _C_bits [sizeof (long double)];
+union _LDblBits {
+    char        _C_bits [sizeof (long double)];
     long double _C_val;
-} __rw_ldbl_inf_bits = { _RWSTD_LDBL_INF_BITS };
+};
+
+#  endif   // _RWSTD_NO_LONG_DOUBLE
+
+extern "C" {
+
+// The constants below are declared in <limits> but with a different
+// type. C linkage is used to defeat MSVC and other "clever" compilers
+// that mangle the type of objects into their names.
+
+// infinity computed at config time
+_RWSTD_EXPORT extern const _DblBits
+__rw_dbl_infinity = { _RWSTD_DBL_INF_BITS };
+
+
+_RWSTD_EXPORT extern const _FltBits
+__rw_flt_infinity = { _RWSTD_FLT_INF_BITS };
+
+
+#  ifndef _RWSTD_NO_LONG_DOUBLE
 
+_RWSTD_EXPORT extern const _LDblBits
+__rw_ldbl_infinity = { _RWSTD_LDBL_INF_BITS };
 
-_RWSTD_EXPORT extern const long double
-__rw_ldbl_infinity = __rw_ldbl_inf_bits._C_val;
 
 #  endif   // _RWSTD_NO_LONG_DOUBLE
 
 
 // quiet NaN computed at config time
-static const union {
-    char _C_bits [sizeof (double)];
-    double _C_val;
-} __rw_dbl_qNaN_bits = { _RWSTD_DBL_QNAN_BITS };
-
-_RWSTD_EXPORT extern const double __rw_dbl_qNaN  = __rw_dbl_qNaN_bits._C_val;
+_RWSTD_EXPORT extern const _DblBits
+__rw_dbl_qNaN = { _RWSTD_DBL_QNAN_BITS };
 
-static const union {
-    char _C_bits [sizeof (float)];
-    float _C_val;
-} __rw_flt_qNaN_bits = { _RWSTD_FLT_QNAN_BITS };
 
-_RWSTD_EXPORT extern const float __rw_flt_qNaN  = __rw_flt_qNaN_bits._C_val;
+_RWSTD_EXPORT extern const _FltBits
+__rw_flt_qNaN = { _RWSTD_FLT_QNAN_BITS };
 
 
 #  ifndef _RWSTD_NO_LONG_DOUBLE
 
-static const union {
-    char _C_bits [sizeof (long double)];
-    long double _C_val;
-} __rw_ldbl_qNaN_bits = { _RWSTD_LDBL_QNAN_BITS };
-
+_RWSTD_EXPORT extern const _LDblBits
+__rw_ldbl_qNaN = { _RWSTD_LDBL_QNAN_BITS };
 
-_RWSTD_EXPORT extern const long double
-__rw_ldbl_qNaN = __rw_ldbl_qNaN_bits._C_val;
 
 #  endif   // _RWSTD_NO_LONG_DOUBLE
 
 
 // signaling NaN computed at config time
-static const union {
-    char _C_bits [sizeof (double)];
-    double _C_val;
-} __rw_dbl_sNaN_bits = { _RWSTD_DBL_SNAN_BITS };
+_RWSTD_EXPORT extern const _DblBits
+__rw_dbl_sNaN = { _RWSTD_DBL_SNAN_BITS };
 
-_RWSTD_EXPORT extern const double __rw_dbl_sNaN  = __rw_dbl_sNaN_bits._C_val;
-
-static const union {
-    char _C_bits [sizeof (float)];
-    float _C_val;
-} __rw_flt_sNaN_bits = { _RWSTD_FLT_SNAN_BITS };
 
-_RWSTD_EXPORT extern const float __rw_flt_sNaN  = __rw_flt_sNaN_bits._C_val;
+_RWSTD_EXPORT extern const _FltBits
+__rw_flt_sNaN = { _RWSTD_FLT_SNAN_BITS };
 
 
 #  ifndef _RWSTD_NO_LONG_DOUBLE
 
-static const union {
-    char _C_bits [sizeof (long double)];
-    long double _C_val;
-} __rw_ldbl_sNaN_bits = { _RWSTD_LDBL_SNAN_BITS };
-
+_RWSTD_EXPORT extern const _LDblBits
+__rw_ldbl_sNaN = { _RWSTD_LDBL_SNAN_BITS };
 
-_RWSTD_EXPORT extern const long double
-__rw_ldbl_sNaN = __rw_ldbl_sNaN_bits._C_val;
 
 #  endif   // _RWSTD_NO_LONG_DOUBLE
 
 
 // denormalized minima computed at config time
-static const union {
-    char _C_bits [sizeof (double)];
-    double _C_val;
-} __rw_dbl_denorm_min_bits = { _RWSTD_DBL_DENORM_MIN_BITS };
-
-_RWSTD_EXPORT extern const double
-__rw_dbl_denorm_min = __rw_dbl_denorm_min_bits._C_val;
+_RWSTD_EXPORT extern const _DblBits
+__rw_dbl_denorm_min = { _RWSTD_DBL_DENORM_MIN_BITS };
 
-static const union {
-    char _C_bits [sizeof (float)];
-    float _C_val;
-} __rw_flt_denorm_min_bits = { _RWSTD_FLT_DENORM_MIN_BITS };
 
-_RWSTD_EXPORT extern const float
-__rw_flt_denorm_min = __rw_flt_denorm_min_bits._C_val;
+_RWSTD_EXPORT extern const _FltBits
+__rw_flt_denorm_min = { _RWSTD_FLT_DENORM_MIN_BITS };
 
 
 #  ifndef _RWSTD_NO_LONG_DOUBLE
 
-static const union {
-    char _C_bits [sizeof (long double)];
-    long double _C_val;
-} __rw_ldbl_denorm_min_bits = { _RWSTD_LDBL_DENORM_MIN_BITS };
-
+_RWSTD_EXPORT extern const _LDblBits
+__rw_ldbl_denorm_min = { _RWSTD_LDBL_DENORM_MIN_BITS };
 
-_RWSTD_EXPORT extern const long double
-__rw_ldbl_denorm_min = __rw_ldbl_denorm_min_bits._C_val;
 
 #  endif   // _RWSTD_NO_LONG_DOUBLE
+
+}   // extern "C"
 
 #else   // if defined (_RWSTD_NO_INFINITY)
 

Modified: incubator/stdcxx/branches/4.2.0/src/locale_bits.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_bits.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_bits.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_bits.cpp Fri Sep 28 13:55:52 2007
@@ -30,12 +30,10 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 #include <loc/_locale.h>
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) { 
+_RWSTD_NAMESPACE (std) { 
 
 
 _RWSTD_DEFINE_STATIC_CONST (const locale::category locale::none);
@@ -48,7 +46,4 @@
 _RWSTD_DEFINE_STATIC_CONST (const locale::category locale::all);
 
 
-}   // namespace _V3_LOCALE
-
-
-#endif   // _RWSTD_NO_V3_LOCALE
+}   // namespace std

Modified: incubator/stdcxx/branches/4.2.0/src/locale_body.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_body.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_body.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_body.cpp Fri Sep 28 13:55:52 2007
@@ -918,7 +918,11 @@
                             (n_locales - inx) * sizeof (*locales));
 
                     delete[] locales;
-                    locales = locale_buf;
+
+                    // point at the statically allocated buffer and reset
+                    // the current capacity to the original capacity
+                    locales        = locale_buf;
+                    locale_bufsize = bufsize;
                 }
                 else {
                     // move facet pointers back

Modified: incubator/stdcxx/branches/4.2.0/src/locale_body.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_body.h?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_body.h (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_body.h Fri Sep 28 13:55:52 2007
@@ -42,11 +42,11 @@
 #include <rw/_defs.h>
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) { 
+_RWSTD_NAMESPACE (std) { 
 
 struct _RWSTD_CLASS_EXPORT locale;
 
-}   // namespace _V3_LOCALE
+}   // namespace std
 
 
 _RWSTD_NAMESPACE (__rw) { 
@@ -93,7 +93,7 @@
 
     __rw_mutex    _C_mutex;
 
-    friend struct _V3_LOCALE::locale;
+    friend struct _STD::locale;
 
 public:
 

Modified: incubator/stdcxx/branches/4.2.0/src/locale_classic.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_classic.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_classic.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_classic.cpp Fri Sep 28 13:55:52 2007
@@ -22,45 +22,76 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 2001-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #define _RWSTD_LIB_SRC
-
-#include <new>
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
+#include <new>             // for placment new
+
+#include <loc/_locale.h>   // for locale
+#include "once.h"          // for __rw_once()
+
+
+_RWSTD_NAMESPACE (__rw) { 
 
-#include <loc/_locale.h>
+// static buffer for the classic "C" locale object
+static union {
+    void* _C_align;
+    char  _C_buf [sizeof (_STD::locale)];
+} __rw_classic;
 
-#include "locale_body.h"
 
+// init-once flag for the classic "C" locale object
+static __rw_once_t
+__rw_classic_once_init = _RWSTD_ONCE_INIT;
 
-_RWSTD_NAMESPACE (_V3_LOCALE) { 
 
+extern "C" {
 
-/* static */ const locale& locale::classic ()
+// one-time initializer for the classic "C" locale object
+static void
+__rw_init_classic ()
 {
-    // classic locale will not be destroyed during program runtime
-    static _RW::__rw_locale *pbody = _RW::__rw_locale::_C_manage (0, "C");
+#ifdef _RWSTDDEBUG
 
-    static union {
-        void* _C_align;
-        char  _C_buf [sizeof (locale)];
-    } classic_locale;
+    static int init;
 
-    _RWSTD_ASSERT (0 != pbody);
+    // paranoid check: verify that one-time initialization works
+    _RWSTD_ASSERT (0 == init);
 
-    // multiple initialization by multiple threads is benign
-    static locale *pclassic = new (&classic_locale) locale (*pbody);
+    ++init;
 
-    return *pclassic;
+#endif   // _RWSTDDEBUG
+
+    // construct the classic "C" locale in the provided buffer
+    new (&__rw_classic) _STD::locale ("C");
 }
 
+}   // extern "C"
+
+}   // namespace __rw
+
 
-}   // namespace _V3_LOCALE
+_RWSTD_NAMESPACE (std) {
+
+
+/* static */ const locale& locale::
+classic ()
+{
+    // initialize classic locale in the static buffer exactly once
+    _RW::__rw_once (&_RW::__rw_classic_once_init, _RW::__rw_init_classic);
+
+    // cast the address of the buffer to a locale pointer
+    const locale* const pclassic =
+        _RWSTD_REINTERPRET_CAST (locale*, &_RW::__rw_classic);
+
+    _RWSTD_ASSERT (0 != pclassic->_C_body);
+
+    return *pclassic;
+}
 
 
-#endif   // _RWSTD_NO_V3_LOCALE
+}   // namespace std

Modified: incubator/stdcxx/branches/4.2.0/src/locale_combine.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_combine.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_combine.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_combine.cpp Fri Sep 28 13:55:52 2007
@@ -31,8 +31,6 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>   // for memxxx() and strxxx() functions
@@ -626,7 +624,7 @@
 }   // namespace __rw
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) {
+_RWSTD_NAMESPACE (std) {
 
 
 // outlined to hide implementation details
@@ -724,7 +722,4 @@
 }
 
 
-}   // namespace _V3_LOCALE
-
-
-#endif   // _RWSTD_NO_V3_LOCALE
+}   // namespace std

Modified: incubator/stdcxx/branches/4.2.0/src/locale_core.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/locale_core.cpp?rev=580483&r1=580482&r2=580483&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.0/src/locale_core.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/src/locale_core.cpp Fri Sep 28 13:55:52 2007
@@ -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 2001-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -30,8 +30,6 @@
 
 #include <rw/_defs.h>
 
-#ifndef _RWSTD_NO_V3_LOCALE
-
 #ifdef __SUNPRO_CC
    // working around SunPro bug 568
 #  include <time.h>
@@ -47,7 +45,7 @@
 #include <sys/stat.h>   // for stat()
 
 
-_RWSTD_NAMESPACE (_V3_LOCALE) { 
+_RWSTD_NAMESPACE (std) { 
 
 
 // outlined to hide implementation details
@@ -140,7 +138,7 @@
     if (next && *next) {
 
         // compute the facet category from the value of its id
-        const int facet_cat = _RW::__rw_get_cat (inx + 1);
+        const int facet_cat = _RW::__rw_get_cat (int (inx + 1));
 
         // determine the locale name of the given category
         size_t i = 0;
@@ -200,7 +198,4 @@
 }
 
 
-}   // namespace _V3_LOCALE
-
-
-#endif   // _RWSTD_NO_V3_LOCALE
+}   // namespace std