stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r660776 [1/2] - in /stdcxx/trunk: bin/ etc/config/ etc/config/src/ examples/manual/ examples/manual/in/ examples/manual/out/ include/loc/ include/rw/ src/ tests/include/ tests/iostream/ tests/localization/ tests/numerics/ tests/regress/ tes...
Date Wed, 28 May 2008 01:48:21 GMT
Author: vitek
Date: Tue May 27 18:48:19 2008
New Revision: 660776

URL: http://svn.apache.org/viewvc?rev=660776&view=rev
Log:

2008-05-27  Travis Vitek  <vitek@roguewave.com>

	Merged branches/4.3.x@660567 to trunk


Added:
    stdcxx/trunk/etc/config/src/MMAP.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/etc/config/src/MMAP.cpp
    stdcxx/trunk/examples/manual/in/failure.in
      - copied unchanged from r660687, stdcxx/branches/4.3.x/examples/manual/in/failure.in
    stdcxx/trunk/src/fpclass.h
      - copied unchanged from r660687, stdcxx/branches/4.3.x/src/fpclass.h
    stdcxx/trunk/tests/iostream/27.basic.ios.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/iostream/27.basic.ios.cpp
    stdcxx/trunk/tests/iostream/27.filebuf.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/iostream/27.filebuf.cpp
    stdcxx/trunk/tests/iostream/27.ios.members.static.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/iostream/27.ios.members.static.cpp
    stdcxx/trunk/tests/iostream/27.istream.get.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/iostream/27.istream.get.cpp
    stdcxx/trunk/tests/iostream/27.std.manip.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/iostream/27.std.manip.cpp
    stdcxx/trunk/tests/localization/22.locale.codecvt.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.cpp
    stdcxx/trunk/tests/localization/22.locale.collate.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/localization/22.locale.collate.cpp
    stdcxx/trunk/tests/localization/22.locale.ctype.widen.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/localization/22.locale.ctype.widen.cpp
    stdcxx/trunk/tests/regress/18.limits.stdcxx-937.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/regress/18.limits.stdcxx-937.cpp
    stdcxx/trunk/tests/regress/27.ostream.inserters.stdcxx-51.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/regress/27.ostream.inserters.stdcxx-51.cpp
    stdcxx/trunk/tests/self/0.locale.cpp
      - copied unchanged from r660687, stdcxx/branches/4.3.x/tests/self/0.locale.cpp
Modified:
    stdcxx/trunk/bin/genxviews
    stdcxx/trunk/bin/xcomp.awk   (props changed)
    stdcxx/trunk/etc/config/gcc.config
    stdcxx/trunk/etc/config/src/MBSTATE_T.cpp
    stdcxx/trunk/etc/config/src/WCTRANS_T.cpp
    stdcxx/trunk/etc/config/src/WCTYPE_T.cpp
    stdcxx/trunk/etc/config/src/WINT_T.cpp
    stdcxx/trunk/etc/config/vacpp.config
    stdcxx/trunk/examples/manual/failure.cpp
    stdcxx/trunk/examples/manual/out/failure.out
    stdcxx/trunk/include/loc/_ctype.h
    stdcxx/trunk/include/rw/_iosfailure.h
    stdcxx/trunk/src/catalog.cpp
    stdcxx/trunk/src/exception.cpp
    stdcxx/trunk/src/limits.cpp
    stdcxx/trunk/src/messages.cpp
    stdcxx/trunk/src/mman.cpp
    stdcxx/trunk/src/num_put.cpp
    stdcxx/trunk/src/ti_num_get.cpp
    stdcxx/trunk/src/ti_num_put.cpp
    stdcxx/trunk/src/ti_numpunct.cpp
    stdcxx/trunk/src/version.cpp
    stdcxx/trunk/tests/include/rw_thread.h
    stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp
    stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.num.get.cpp
    stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp
    stdcxx/trunk/tests/localization/22.locale.time.put.cpp
    stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp
    stdcxx/trunk/tests/numerics/26.valarray.cassign.cpp
    stdcxx/trunk/tests/src/alarm.cpp
    stdcxx/trunk/tests/src/cmdopt.cpp
    stdcxx/trunk/tests/src/locale.cpp
    stdcxx/trunk/tests/src/opt_diags.cpp
    stdcxx/trunk/tests/src/printf.cpp
    stdcxx/trunk/tests/src/thread.cpp
    stdcxx/trunk/tests/strings/21.cwctype.cpp

Modified: stdcxx/trunk/bin/genxviews
URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/genxviews?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/bin/genxviews (original)
+++ stdcxx/trunk/bin/genxviews Tue May 27 18:48:19 2008
@@ -205,12 +205,14 @@
           <th>Operating System</td>
           <th>Architecture</td>
           <th>Compiler</td>
-          <th>Build Results</td>
-          <th>Logs</td>
-          <th>Time<br>(sec)</td>
+          <th title="Cross-build result page">Build Results</td>
+          <th title="Total number of logs">Logs</td>
+          <th title="Number of logs added since the last run">New</td>
+          <th title="Timestamp of oldest log">Age</td>
+          <th title="Time to process all logs">Time<br>(sec)</td>
         </tr>
-        </thead>
-        <tbody>
+      </thead>
+      <tbody>
 EOF
 
 
@@ -228,10 +230,10 @@
     fi
 
     cat<<EOF | output
-          <tr>
-            <td>$osname</td>
-            <td>$arch</td>
-            <td>$compiler</td>
+        <tr>
+          <td>$osname</td>
+          <td>$arch</td>
+          <td>$compiler</td>
 EOF
 
     # build types:
@@ -247,6 +249,8 @@
     suffixes="a A d D s S"
 
     unset buildlogs
+    unset oldest
+
     count=0
 
     for b in $btypes; do
@@ -261,8 +265,16 @@
         done
     done
 
+    if [ -e $outdir/$xfile ]; then
+        # count the number of logs that are newer than the cross-build file
+        newlogs=`find $logdir/ -name "$alllogs" -newer $outdir/$xfile | wc -l`
+    else
+        # cross-build file doesn't exist yet, all logs are considered new
+        newlogs=$count
+    fi
+
     if [ $verbose -ne 0 ]; then
-        echo "$myname: found $count logs: $buildlogs"
+        echo "$myname: found $count logs ($newlogs new): $buildlogs"
     fi
 
     # create a title for the page
@@ -273,16 +285,26 @@
 
     if [ "$buildlogs" = "" ]; then
         # format missing logs in italics
-        output "            <td><i>$xfile</i></td>"
+        output "          <td><i>$xfile</i></td>"
     else
-        if [ $verbose -ne 0 ]; then
-            echo "$myname: $XBUILDGEN $verarg -s -o$outdir/$xfile -T\"$title\" $buildlogs"
-        fi
+        output "          <td><a href=\"$xfile\">$xfile</a></td>"
+
+        oldest=`  cd $logdir && ls -lrt $buildlogs | head -n 1 \
+                | awk '{ print $6 " " $7 " " $8 }'`
 
-        output "            <td><a href=\"$xfile\">$xfile</a></td>"
+        if [ $newlogs -gt 0 ]; then
 
-        if [ $dryrun -eq 0 ]; then
-            $XBUILDGEN $verarg -s -o$outdir/$xfile -T"$title" $buildlogs
+            # only invoken xbuildgen when there are new logs to proecess
+            # otherwise simply point at the previously generated cross
+            # build file
+
+            if [ $verbose -ne 0 ]; then
+                echo "$myname: $XBUILDGEN $verarg -s -o$outdir/$xfile -T\"$title\" $buildlogs"
+            fi
+
+            if [ $dryrun -eq 0 ]; then
+                $XBUILDGEN $verarg -s -o$outdir/$xfile -T"$title" $buildlogs
+            fi
         fi
     fi
 
@@ -297,9 +319,11 @@
     duration=`expr $end - $duration`
 
     cat<<EOF | output
-        <td>$count</td>
-        <td>$duration</td>
-    </tr>
+          <td>$count</td>
+          <td>$newlogs</td>
+          <td>$oldest</td>
+          <td>$duration</td>
+        </tr>
 EOF
 }
 

Propchange: stdcxx/trunk/bin/xcomp.awk
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: stdcxx/trunk/etc/config/gcc.config
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/gcc.config?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/gcc.config (original)
+++ stdcxx/trunk/etc/config/gcc.config Tue May 27 18:48:19 2008
@@ -273,45 +273,47 @@
 SINGL_CPPFLAGS =
 SINGL_LDFLAGS  =
 
-# (try to) determine the architecture via the (non-standard) -p option
-# the option is recognized on at least HP-UX, IRIX, and Linux (are there
-# any other systems running on IA64?)
-arch=$(shell uname -p 2>/dev/null)
+# gcc can generate 32-bit or 64-bit code by default, depending
+# on how it's configured
+# determine whether the default compiler invocation produces
+# wide (64-bit) or narrow (32-bit) code and set compiler,
+# linker, and other options accordingly
+wide = $(shell    cd /tmp; tmpfile=stdcxx-longsize-$$; export tmpfile;  \
+                  echo "int main() { return 8 == sizeof (long); }"      \
+                       > $$tmpfile.c                                    \
+               && $(CXX) $$tmpfile.c >/dev/null 2>&1 -o $$tmpfile;      \
+               ./$$tmpfile; echo $$?; rm -f $$tmpfile.c $$tmpfile)
+
+ifeq ($(wide),0)
+    # narrow (32-bit) mode is implicit
+    # use wide (64-bit) flags to explicitly enable LP64 mode
+
+    ifeq ($(OSNAME),HP-UX)
+        # -milp32 and -mlp64 are options specific to HP-UX
+        CXXFLAGS.wide    = -mlp64
+        LDFLAGS.wide     = -mlp64
+        LDSOFLAGS.wide   = -mlp64
+        ARFLAGS.wide     =
+    else
+        CXXFLAGS.wide    = -m64
+        LDFLAGS.wide     = -m64
+        LDSOFLAGS.wide   = -m64
+        ARFLAGS.wide     =
+    endif
+
+else
+    # wide (64-bit) mode is implicit
+    # use narrow (32-bit) flags to explicitly enable ILP32 mode
 
-ifeq ($(arch),ia64)
-    # LP64 is the default (implicit) setting on IA64
     ifeq ($(OSNAME),HP-UX)
-        # -milp32, -mlp64, etc. are options specific to HP-UX
         CXXFLAGS.narrow  = -milp32
         LDFLAGS.narrow   = -milp32
         LDSOFLAGS.narrow = -milp32
         ARFLAGS.narrow   =
-    endif
-else
-    # determine whether the default compiler invocation produces
-    # wide (64-bit) or narrow (32-bit) code and set compiler,
-    # linker, and other flags accordingly
-    wide = $(shell tmpfile=/tmp/longsize-$$; export tmpfile;           \
-                   echo "int main() { return 8 == sizeof (long); }"    \
-                        > $$tmpfile.c                                  \
-                   && $(CXX) $$tmpfile.c >/dev/null 2>&1 -o $$tmpfile; \
-                   $$tmpfile; echo $$?; rm -f $$tmpfile.c $$tmpfile)
-
-    ifeq ($(wide),0)
-        # wide (64-bit) flags
-        CXXFLAGS.wide  = -m64
-        LDFLAGS.wide   = -m64
-        LDSOFLAGS.wide = -m64
-        ARFLAGS.wide   =
-
-        # narrow (32-bit) mode is implicit
     else
-        # narrow (32-bit) flags
         CXXFLAGS.narrow  = -m32
         LDFLAGS.narrow   = -m32
         LDSOFLAGS.narrow = -m32
         ARFLAGS.narrow   =
-
-        # wide (64-bit) mode is implicit
     endif
 endif

Modified: stdcxx/trunk/etc/config/src/MBSTATE_T.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/MBSTATE_T.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/src/MBSTATE_T.cpp (original)
+++ stdcxx/trunk/etc/config/src/MBSTATE_T.cpp Tue May 27 18:48:19 2008
@@ -18,12 +18,24 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * Copyright 1999-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #include "config.h"
 
+#if    defined (__EDG__)                \
+    && !defined (__DECCXX)              \
+    && !defined (__HP_aCC)              \
+    && !defined (__INTEL_COMPILER)      \
+    && !defined (_SGI_COMPILER_VERSION)
+   // disable error #450-D: the type "long long" is nonstandard
+   // when using the vanilla EDG eccp in strict mode (i.e., w/o
+   // long long support)
+#  pragma diag_suppress 450
+#endif   // EDG eccp on Linux
+
+
 // defined to get the correct definition of mbstate_t, available on HPUX;
 // once we get the correct size of the struct, _RWSTD_NO_MBSTATE_T is 
 // defined in rw/_config.h and we (and the users of the library) are left 

Modified: stdcxx/trunk/etc/config/src/WCTRANS_T.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/WCTRANS_T.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/src/WCTRANS_T.cpp (original)
+++ stdcxx/trunk/etc/config/src/WCTRANS_T.cpp Tue May 27 18:48:19 2008
@@ -18,12 +18,24 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * Copyright 1999-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #include "config.h"
 
+#if    defined (__EDG__)                \
+    && !defined (__DECCXX)              \
+    && !defined (__HP_aCC)              \
+    && !defined (__INTEL_COMPILER)      \
+    && !defined (_SGI_COMPILER_VERSION)
+   // disable error #450-D: the type "long long" is nonstandard
+   // when using the vanilla EDG eccp in strict mode (i.e., w/o
+   // long long support)
+#  pragma diag_suppress 450
+#endif   // EDG eccp on Linux
+
+
 #ifndef _RWSTD_NO_WCHAR_H
 #  include <wchar.h>
 #endif   // _RWSTD_NO_WCHAR_H

Modified: stdcxx/trunk/etc/config/src/WCTYPE_T.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/WCTYPE_T.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/src/WCTYPE_T.cpp (original)
+++ stdcxx/trunk/etc/config/src/WCTYPE_T.cpp Tue May 27 18:48:19 2008
@@ -18,12 +18,25 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * Copyright 1999-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #include "config.h"
 
+
+#if    defined (__EDG__)                \
+    && !defined (__DECCXX)              \
+    && !defined (__HP_aCC)              \
+    && !defined (__INTEL_COMPILER)      \
+    && !defined (_SGI_COMPILER_VERSION)
+   // disable error #450-D: the type "long long" is nonstandard
+   // when using the vanilla EDG eccp in strict mode (i.e., w/o
+   // long long support)
+#  pragma diag_suppress 450
+#endif   // EDG eccp on Linux
+
+
 #ifndef _RWSTD_NO_WCHAR_H
 #  include <wchar.h>
 #endif   // _RWSTD_NO_WCHAR_H

Modified: stdcxx/trunk/etc/config/src/WINT_T.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/WINT_T.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/src/WINT_T.cpp (original)
+++ stdcxx/trunk/etc/config/src/WINT_T.cpp Tue May 27 18:48:19 2008
@@ -18,12 +18,24 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * Copyright 1999-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #include "config.h"
 
+#if    defined (__EDG__)                \
+    && !defined (__DECCXX)              \
+    && !defined (__HP_aCC)              \
+    && !defined (__INTEL_COMPILER)      \
+    && !defined (_SGI_COMPILER_VERSION)
+   // disable error #450-D: the type "long long" is nonstandard
+   // when using the vanilla EDG eccp in strict mode (i.e., w/o
+   // long long support)
+#  pragma diag_suppress 450
+#endif   // EDG eccp on Linux
+
+
 #ifndef _RWSTD_NO_WCHAR_H
 #  include <wchar.h>
 #endif   // _RWSTD_NO_WCHAR_H

Modified: stdcxx/trunk/etc/config/vacpp.config
URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/vacpp.config?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/etc/config/vacpp.config (original)
+++ stdcxx/trunk/etc/config/vacpp.config Tue May 27 18:48:19 2008
@@ -241,10 +241,11 @@
 
 
 # check if the -qtemplateregistry option is recognized
-use_tempinc=$(shell    echo "int i;" >/tmp/foo.$$$$.c              \
+use_tempinc=$(shell    cd $${TMPDIR:=/tmp}                         \
+                    && echo "int i;" >foo.$$$$.c                   \
                     && $(CXX) -c -qmaxerr=1:w -qtemplateregistry   \
-                              /tmp/foo.$$$$.c >/dev/null 2>&1;     \
-                    echo $$?; rm /tmp/foo.$$$$.c)
+                              foo.$$$$.c >/dev/null 2>&1;          \
+                    echo $$?; rm -f foo.$$$$.c foo.$$$$.o)
 
 # template repository/registry name override
 

Modified: stdcxx/trunk/examples/manual/failure.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/examples/manual/failure.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/examples/manual/failure.cpp (original)
+++ stdcxx/trunk/examples/manual/failure.cpp Tue May 27 18:48:19 2008
@@ -1,6 +1,7 @@
 /**************************************************************************
  *
- * failure.cpp - Example program demonstrating ios::failure.
+ * failure.cpp - Example program demonstrating the use of ios::failure
+ *               and its extendsions provided by this implementation.
  *
  * $Id$
  *
@@ -22,7 +23,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.
  * 
  **************************************************************************/
 
@@ -31,39 +32,78 @@
 
 #include <examples.h>
 
+
 #ifndef _RWSTD_NO_EXCEPTIONS
 
 int main ()
 {
-   try {
-       // Enable exceptions in cin.
-       std::cin.exceptions (std::ios::eofbit);
-
-       // Clear all bits and set eofbit.
-       std::cin.clear (std::ios::eofbit);
-   }
-   catch (const std::ios::failure &e) {
-       std::cout << "Caught an exception: " << e.what () << std::endl;
-   }
-   catch (const std::exception &e) {
-       std::cout << "Caught an exception: " << e.what () << std::endl;
-
-       return 1;   // Indicate failure.
-   }
-   catch (...) {
-       std::cout << "Caught an unknown exception" << std::endl;
-
-       return 1;   // Indicate failure.
-   }
+    const std::ios::iostate allbits =
+        std::ios::badbit | std::ios::eofbit | std::ios::failbit;
+                
+    // Enable all exceptions in cin.
+    std::cin.exceptions (allbits);
+
+    while (!std::cin.eof ()) {
+
+        // Clear state bits.
+        std::cin.clear ();
+
+        try {
+            short i;
+            char  ch;
+
+            // Try to extract a character and an integer.
+            std::cin >> ch >> i;
+
+            std::cout << ch << ' ' << i << '\n';
+        }
+
+#ifndef _RWSTD_NO_EXT_FAILURE
+
+        // Classes badbit_set, eofbit_set, and failbit_set are
+        // derived from failure and are optional extensions of
+        // this implementation.
+
+        catch (const std::ios::badbit_set &e) {
+            std::cout << "Caught std::ios::badbit_set: "
+                      << e.what () << '\n';
+        }
+        catch (const std::ios::eofbit_set &e) {
+            std::cout << "Caught std::ios::eofbit_set: "
+                      << e.what () << '\n';
+        }
+        catch (const std::ios::failbit_set &e) {
+            std::cout << "Caught std::ios::failbit_set: "
+                      << e.what () << '\n';
+        }
+
+#endif   // _RWSTD_NO_EXT_FAILURE
+
+        catch (const std::ios::failure &e) {
+            std::cout << "Caught std::ios::failure: "
+                      << e.what () << '\n';
+        }
+        catch (const std::exception &e) {
+            std::cout << "Caught std::exception: "
+                      << e.what () << '\n';
+
+            return 1;   // Indicate error.
+        }
+        catch (...) {
+            std::cout << "Caught an unknown exception\n";
+
+            return 1;   // Indicate error.
+        }
+    }
 
-   return 0;
+    return 0;
 }
 
-#else
+#else   // if defined (_RWSTD_NO_EXCEPTIONS)
 
 int main ()
 {
-    std::cout << "Exceptions not supported." << std::endl;
+    std::cout << "Exceptions not supported\n";
 
     return 0;
 }

Modified: stdcxx/trunk/examples/manual/out/failure.out
URL: http://svn.apache.org/viewvc/stdcxx/trunk/examples/manual/out/failure.out?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/examples/manual/out/failure.out (original)
+++ stdcxx/trunk/examples/manual/out/failure.out Tue May 27 18:48:19 2008
@@ -1 +1,5 @@
-Caught an exception: std::cin: stream object has set ios::eofbit
+a 1234
+Caught std::ios::failbit_set: std::cin: stream object has set ios::failbit
+c 2345
+Caught std::ios::failbit_set: std::cin: stream object has set ios::failbit
+Caught std::ios::failure: std::cin: stream object has set failbit, eofbit

Modified: stdcxx/trunk/include/loc/_ctype.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/loc/_ctype.h?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/include/loc/_ctype.h (original)
+++ stdcxx/trunk/include/loc/_ctype.h Tue May 27 18:48:19 2008
@@ -25,7 +25,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2001-2005 Rogue Wave Software.
+ * Copyright 2001-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -541,7 +541,11 @@
 inline char
 ctype<wchar_t>::narrow (char_type __c, char __dfault) const
 {
-    const _RWSTD_SIZE_T __inx = _RWSTD_STATIC_CAST (_RWSTD_UWCHAR_INT_T, __c);
+    // carefully convert wchar_t to the unsigned form of its
+    // underlying integer type, avoiding sign extension and
+    // similar issues
+    const _RWSTD_UWCHAR_INT_T __inx =
+        _RWSTD_STATIC_CAST (_RWSTD_UWCHAR_INT_T, __c);
 
     // optimize away all but the first call to the virtual do_widen()
     if (   __inx < sizeof _C_narrow_tab / sizeof *_C_narrow_tab

Modified: stdcxx/trunk/include/rw/_iosfailure.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/rw/_iosfailure.h?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/include/rw/_iosfailure.h (original)
+++ stdcxx/trunk/include/rw/_iosfailure.h Tue May 27 18:48:19 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-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -56,11 +56,25 @@
 };
 
 
-struct _RWSTD_EXPORT __rw_badbit_set: __rw_failure { };
+// (optionally) thrown when stream sets badbit
+struct _RWSTD_EXPORT __rw_badbit_set: __rw_failure
+{
+    virtual ~__rw_badbit_set () _THROWS (());
+};
+
+
+// (optionally) thrown when stream sets eofbit
+struct _RWSTD_EXPORT __rw_eofbit_set: __rw_failure
+{
+    virtual ~__rw_eofbit_set () _THROWS (());
+};
 
-struct _RWSTD_EXPORT __rw_eofbit_set: __rw_failure { };
 
-struct _RWSTD_EXPORT __rw_failbit_set: __rw_failure { };
+// (optionally) thrown when stream sets failbit
+struct _RWSTD_EXPORT __rw_failbit_set: __rw_failure
+{
+    virtual ~__rw_failbit_set () _THROWS (());
+};
 
 }   // namespace __rw
 

Modified: stdcxx/trunk/src/catalog.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/catalog.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/catalog.cpp (original)
+++ stdcxx/trunk/src/catalog.cpp Tue May 27 18:48:19 2008
@@ -140,6 +140,8 @@
       __rw_catlist[j-1] = __rw_catlist[j];
     if (j < __rw_catlist.size())
       __rw_catlist[j] = 0;
+    else
+      __rw_catlist[__rw_catlist.size () - 1] = 0;
     return 0;
   }
   return -1;

Modified: stdcxx/trunk/src/exception.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/exception.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/exception.cpp (original)
+++ stdcxx/trunk/src/exception.cpp Tue May 27 18:48:19 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.
  * 
  **************************************************************************/
 
@@ -936,8 +936,10 @@
 }
 
 
-// outline to reduce code bloat caused by compilers that emit the vtbl
-// in every translation unit containing the definition of the class
+// trivial dtors outlined to reduce code bloat caused by compilers that
+// emit the vtbl in every translation unit containing the definition of
+// the class
+
 // virtual dtor
 /* virtual */ __rw_failure::~__rw_failure () _THROWS (())
 {
@@ -945,4 +947,22 @@
 }
 
 
+/* virtual */ __rw_badbit_set::~__rw_badbit_set () _THROWS (())
+{
+    // no-op
+}
+
+
+/* virtual */ __rw_eofbit_set::~__rw_eofbit_set () _THROWS (())
+{
+    // no-op
+}
+
+
+/* virtual */ __rw_failbit_set::~__rw_failbit_set () _THROWS (())
+{
+    // no-op
+}
+
+
 }   // namespace __rw

Modified: stdcxx/trunk/src/limits.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/limits.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/limits.cpp (original)
+++ stdcxx/trunk/src/limits.cpp Tue May 27 18:48:19 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.
  * 
  **************************************************************************/
 
@@ -31,12 +31,17 @@
 #include <rw/_defs.h>  
                        
 // define generic template and specializations
-#include <limits>
+// use the quoted form of the #include directive to fool Sun C++
+// otherwise the compiler fails to #include the header twice,
+// most likely because it makes assumptions about headers with
+// (C++) standard names
+#include "limits"
 
 #if _MSC_VER != 1300   // working around an MSVC 7.0 bug (PR #26562)
 #  undef _RWSTD_LIMITS_INCLUDED
 #  define _RWSTD_DEFINE_EXPORTS
 
    // define static data members of specializations
-#  include <limits>
+   // again, use the quoted form of the #include directive
+#  include "limits"
 #endif   // MSVC != 7.0

Modified: stdcxx/trunk/src/messages.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/messages.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/messages.cpp (original)
+++ stdcxx/trunk/src/messages.cpp Tue May 27 18:48:19 2008
@@ -70,6 +70,14 @@
     } loc;
 };
 
+struct __rw_open_cat_page
+{
+    static const size_t _C_size = 8;
+
+    __rw_open_cat_page* _C_next; // next page
+    __rw_open_cat_data _C_data [_C_size];
+};
+
 
 // manages a global, per-process repository of open catalogs according
 // to the following table:
@@ -90,21 +98,25 @@
 static __rw_open_cat_data*
 __rw_manage_cat_data (int &cat,  __rw_open_cat_data *pcat_data)
 {
-    // a per-process array of catalog data structs
-    static __rw_open_cat_data  catalog_buf [8];
-    static __rw_open_cat_data* catalogs = catalog_buf;
+    // a per-process array of pointers to catalog data structs
+    static __rw_open_cat_data* catalog_buf [__rw_open_cat_page::_C_size];
+    static __rw_open_cat_data** catalogs = 0;
+
+    // first page of a per-process list of pages of catalog data structs
+    static __rw_open_cat_page  catalog_page;
 
     static size_t n_catalogs      = 0;
     static size_t catalog_bufsize = sizeof catalog_buf / sizeof *catalog_buf;
     static size_t largest_cat     = 0;
-    static int    init            = 0;
 
- 
-    if (0 == init) {
+    if (!catalogs) {
+        
         for (size_t i = 0; i < catalog_bufsize; ++i) {
-            catalogs [i].catd = _RWSTD_BAD_CATD;
+            catalog_page._C_data [i].catd = _RWSTD_BAD_CATD;
+            catalog_buf [i] = &catalog_page._C_data [i];
         }
-        init = 1;
+
+        catalogs = catalog_buf;
     }
 
     if (-1 == cat) {
@@ -115,27 +127,40 @@
         if (pcat_data) {
              if (n_catalogs == catalog_bufsize) {
 
-                // reallocate buffer of facet pointers
-                __rw_open_cat_data* const tmp =
-                    new __rw_open_cat_data[n_catalogs * 2];
+                // allocate new page of catalog data
+                __rw_open_cat_page* const page =
+                    new __rw_open_cat_page;
+
+                // insert new page into singly-linked page list
+                page->_C_next = catalog_page._C_next;
+                catalog_page._C_next = page;
+
+                // initialize new page
+                for (size_t i = 0; i < __rw_open_cat_page::_C_size; ++i) {
+                    page->_C_data [i].catd = _RWSTD_BAD_CATD;
+                }
+
+                // rwallocate buffer of catalog data pointers
+                __rw_open_cat_data** const data =
+                    new __rw_open_cat_data* [n_catalogs + __rw_open_cat_page::_C_size];
 
-                memcpy (tmp, catalogs, n_catalogs * sizeof *tmp);
+                memcpy (data, catalogs, n_catalogs * sizeof *data);
                  
                 if (catalogs != catalog_buf)
                     delete[] catalogs;
 
-                catalogs         = tmp;
-                catalog_bufsize *= 2;
+                catalogs         = data;
+                catalog_bufsize += __rw_open_cat_page::_C_size;
 
-                for (size_t i = n_catalogs; i < catalog_bufsize; ++i) {
-                    catalogs [i].catd = _RWSTD_BAD_CATD;
+                for (size_t i = 0; i < __rw_open_cat_page::_C_size; ++i) {
+                    catalogs [n_catalogs + i] = &page->_C_data [i];
                 }
 
                 cat = int (n_catalogs);
-                memcpy (&catalogs [cat].loc, &pcat_data->loc,
-                        sizeof (_STD::locale));
 
-                catalogs [cat].catd = pcat_data->catd;
+                catalogs [cat]->catd = pcat_data->catd;
+                memcpy (&catalogs [cat]->loc, &pcat_data->loc,
+                        sizeof (_STD::locale));
 
                 if (size_t (cat) > largest_cat)
                     largest_cat = size_t (cat);
@@ -145,38 +170,42 @@
             else {
                 // find the first open slot and use it.
                 cat = 0;
-                while (catalogs [cat].catd != _RWSTD_BAD_CATD) {
+                while (catalogs [cat]->catd != _RWSTD_BAD_CATD) {
                     ++cat;
                 }
 
+                catalogs [cat]->catd = pcat_data->catd;
+                memcpy (&catalogs [cat]->loc, &pcat_data->loc,
+                        sizeof (_STD::locale));
+
                 if (size_t (cat) > largest_cat)
                     largest_cat = size_t (cat);
 
-                memcpy (&catalogs [cat].loc, &pcat_data->loc,
-                        sizeof (_STD::locale));
-
-                catalogs [cat].catd = pcat_data->catd;
                 ++n_catalogs;
             }
         }
     }
     else {
+
         if (0 == pcat_data) {
             // find struct and return it
             if (size_t (cat) < catalog_bufsize)
-                return catalogs + cat;
+                return catalogs [cat];
 
             return 0;
         }
 
         // initialize the struct to an invalid state
         --n_catalogs;
-        catalogs [cat].catd = _RWSTD_BAD_CATD;
+        catalogs [cat]->catd = _RWSTD_BAD_CATD;
+
         if (size_t (cat) == largest_cat) {
 
             // find the next smallest valid slot
+            largest_cat = 0;
+
             for (int i = cat; i >= 0; --i) {
-                if (catalogs [i].catd != _RWSTD_BAD_CATD) {
+                if (catalogs [i]->catd != _RWSTD_BAD_CATD) {
                     largest_cat = size_t (i);
                     break;
                 }
@@ -186,11 +215,9 @@
                 sizeof catalog_buf / sizeof *catalog_buf;
 
             if ((largest_cat < bufsize / 2) && (catalogs != catalog_buf)) {
-
                 // when there are no more open catalogs indexed beyond
-                // second half of the statically allocated repository, copy
-                // the open catalogs back into the statically allocated
-                // repository.
+                // second half of the static pointer repository, copy
+                // the open catalog pointers back into the repository.
 
                 catalog_bufsize = bufsize;
 
@@ -198,7 +225,19 @@
                         catalog_bufsize * sizeof (*catalogs));
 
                 delete[] catalogs;
+
                 catalogs = catalog_buf;
+
+                // remove all pages, they're not in use
+                while (catalog_page._C_next)
+                {
+                    // remove next page from page list
+                    __rw_open_cat_page* page = catalog_page._C_next;
+                    catalog_page._C_next = page->_C_next;
+
+                    // deallocate that page
+                    delete page;
+                }
             }
         }
     }

Modified: stdcxx/trunk/src/mman.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/mman.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/mman.cpp (original)
+++ stdcxx/trunk/src/mman.cpp Tue May 27 18:48:19 2008
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2001-2006 Rogue Wave Software.
+ * Copyright 2001-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -36,9 +36,9 @@
 
 #include <sys/stat.h>
 
-#ifndef _MSC_VER
+#ifndef _RWSTD_NO_MMAP
 #  include <sys/mman.h>
-#else
+#elif defined (_WIN32)
 #  include <windows.h>
 #  include <io.h>
 #endif   // _MSC_VER
@@ -69,12 +69,17 @@
 
     *size = sb.st_size;
 
-#if !defined(_MSC_VER)
-    const int fd = open (fname, O_RDONLY);
 
+#ifndef _WIN32
+    const int fd = open (fname, O_RDONLY);
+   
     if (-1 == fd)
         return 0;
 
+#endif   // _WIN32
+
+#ifndef _RWSTD_NO_MMAP
+
     // 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.
@@ -92,7 +97,9 @@
 
     if (MAP_FAILED == data)   // failure
         return 0;
-#else
+
+#elif defined (_WIN32)
+
     HANDLE mmf = 
         CreateFile (fname, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -114,6 +121,23 @@
     CloseHandle (mmf);
     CloseHandle (mmfv);
 
+#else   // no mmap() or equivalent
+
+#  ifndef _RWSTD_NO_MUNMAP
+#    define _RWSTD_NO_MUNMAP
+#  endif   // _RWSTD_NO_MUNMAP
+
+    // read() takes a size_t argument, convert off_t to it
+    const size_t mapsize = size_t (sb.st_size);
+
+    void* data = operator new (mapsize);
+    const ssize_t nread = read (fd, data, mapsize);
+
+    if (size_t (nread) != mapsize) {
+        operator delete (data);
+        data = 0;
+    }
+
 #endif  // _MSC_VER
 
     return data;
@@ -128,10 +152,12 @@
     void* pv = _RWSTD_CONST_CAST (void*, pcv);
 
     // POSIX munmap() takes a void*, but not all platforms conform
-#ifndef _MSC_VER
+#ifndef _RWSTD_NO_MUNMAP
     munmap (_RWSTD_STATIC_CAST (_RWSTD_MUNMAP_ARG1_T, pv), size);
-#else
+#elif defined (_WIN32)
     UnmapViewOfFile (pv);
+#else   // no munmap()
+    operator delete (pv);
 #endif  // _MSC_VER
 }
 

Modified: stdcxx/trunk/src/num_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/num_put.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/num_put.cpp (original)
+++ stdcxx/trunk/src/num_put.cpp Tue May 27 18:48:19 2008
@@ -34,15 +34,9 @@
 #include <stdio.h>    // for snprintf()
 #include <string.h>   // for memmove(), memset()
 
-#include <float.h>   // for _finite(), _fpclass(), _isnan(), _copysign()
-#include <math.h>    // for isfinite(), isnan(), isinf(), signbit()
-
-#ifndef _RWSTD_NO_IEEEFP_H
-#  include <ieeefp.h>   // for fpclass(), isnan()
-#endif   // _RWSTD_NO_IEEEFP_H
-
 #include <loc/_num_put.h>
 
+#include "fpclass.h"  // for __rw_isfinite(), ...
 #include "strtol.h"   // for __rw_digit_map
 #include "punct.h"    // for __rw_get_stdio_fmat
 
@@ -80,161 +74,14 @@
     "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
 
-#if defined (_MSC_VER)
-
-inline bool __rw_isfinite (double val) { return !!_finite (val); }
-
-inline bool __rw_signbit (double val) { return 0 > _copysign (1., val); }
-
-inline bool __rw_isinf (double val) {
-    const int fpc = _fpclass (val);
-
-    if (_FPCLASS_NINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of negative infinity
-        _RWSTD_ASSERT (__rw_signbit (val));
-        return true;
-    }
-    else if (_FPCLASS_PINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of positive infinity
-        _RWSTD_ASSERT (!__rw_signbit (val));
-        return true;
-    }
-
-    return false;
-}
-
-inline bool __rw_isnan (double val) { return !!_isnan (val); }
-
-inline bool __rw_isqnan (double val) {
-    return _FPCLASS_QNAN == _fpclass (val);
-}
-
-inline bool __rw_issnan (double val) {
-    return _FPCLASS_SNAN == _fpclass (val);
-}
-
-#elif defined (_RWSTD_OS_SUNOS)
-
-inline bool __rw_isfinite (double val) { return !!finite (val); }
-
-inline bool __rw_signbit (double val)
-{
-    // implement own signbit() to avoid dragging in libm or libsunmath
-    return _RWSTD_REINTERPRET_CAST (const _RWSTD_UINT64_T&, val) >> 63;
-}
-
-inline bool __rw_isinf (double val) {
-    const int fpc = fpclass (val);
-
-    if (FP_NINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of negative infinity
-        _RWSTD_ASSERT (__rw_signbit (val));
-        return true;
-    }
-    else if (FP_PINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of positive infinity
-        _RWSTD_ASSERT (!__rw_signbit (val));
-        return true;
-    }
-
-    return false;
-}
-
-inline bool __rw_isnan (double val) { return 0 != isnan (val); }
-
-inline bool __rw_isqnan (double val) { return FP_QNAN == fpclass (val); }
-
-inline bool __rw_issnan (double val) { return FP_SNAN == fpclass (val); }
-
-#elif defined (fpclassify)
-
-inline bool __rw_isfinite (double val) { return !!isfinite (val); }
-
-inline bool __rw_signbit (double val) { return !!signbit (val); }
-
-inline bool __rw_isinf (double val) { return !!isinf (val); }
-
-inline bool __rw_isnan (double val) { return !!isnan (val); }
-
-inline bool __rw_isqnan (double) { return false; }
-
-inline bool __rw_issnan (double) { return false; }
-
-#else
-
-inline bool __rw_isfinite (double) { return true; }
-
-inline bool __rw_signbit (double) { return false; }
-
-inline bool __rw_isinf (double) { return false; }
-
-inline bool __rw_isnan (double) { return false; }
-
-inline bool __rw_isqnan (double) { return false; }
-
-inline bool __rw_issnan (double) { return false; }
-
-#endif
-
-
-inline bool __rw_isfinite (float) { return true; }
-
-inline bool __rw_signbit (float) { return false; }
-
-inline bool __rw_isinf (float) { return false; }
-
-inline bool __rw_isnan (float) { return false; }
-
-inline bool __rw_isqnan (float) { return false; }
-
-inline bool __rw_issnan (float) { return false; }
-
-
-#ifndef _RWSTD_NO_LONG_DOUBLE
-
-#  if _RWSTD_DBL_SIZE == _RWSTD_LDBL_SIZE
-
-inline bool __rw_isfinite (long double x) { return __rw_isfinite (double (x)); }
-
-inline bool __rw_signbit (long double x) { return __rw_signbit (double (x)); }
-
-inline bool __rw_isinf (long double x) { return __rw_isinf (double (x)); }
-
-inline bool __rw_isnan (long double x) { return __rw_isnan (double (x)); }
-
-inline bool __rw_isqnan (long double x) { return __rw_isqnan (double (x)); }
-
-inline bool __rw_issnan (long double x) { return __rw_issnan (double (x)); }
-
-#  else   // _RWSTD_DBL_SIZE != _RWSTD_LDBL_SIZE
-
-inline bool __rw_isfinite (long double) { return true; }
-
-inline bool __rw_signbit (long double) { return false; }
-
-inline bool __rw_isinf (long double) { return false; }
-
-inline bool __rw_isnan (long double) { return false; }
-
-inline bool __rw_isqnan (long double) { return false; }
-
-inline bool __rw_issnan (long double) { return false; }
-
-#  endif   // _RWSTD_DBL_SIZE == _RWSTD_LDBL_SIZE
-
-#endif   // _RWSTD_NO_LONG_DOUBLE
-
-
 static int
 __rw_fmat_infinite (char *buf, size_t bufsize, double val, unsigned flags)
 {
     _RWSTD_ASSERT (!__rw_isfinite (val));
     _RWSTD_ASSERT (5 <= bufsize);
 
+    _RWSTD_UNUSED (bufsize); 
+
     char* end = buf;
     const bool cap = !!(flags & _RWSTD_IOS_UPPERCASE);
 

Modified: stdcxx/trunk/src/ti_num_get.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/ti_num_get.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/ti_num_get.cpp (original)
+++ stdcxx/trunk/src/ti_num_get.cpp Tue May 27 18:48:19 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.
  * 
  **************************************************************************/
 
@@ -47,6 +47,16 @@
 
 #define TARGS_C   <char, _RWSTD_ISTREAMBUF_ITER (char) >
 
+
+#if 6 == _RWSTD_HP_aCC_MAJOR
+   // silence the useless HP aCC 6 remark 4244: extern storage class
+   // used with a function definition on the "extern _RWSTD_EXPORT"
+   // macro argument below where the redundant "extern" is there to
+   // silence HP aCC 3 Warning (suggestion) 933: Null macro argument #1
+#  pragma diag_suppress 4244
+#endif   // aCC 6
+
+
 _RWSTD_SPECIALIZE_FACET_ID (num_get, TARGS_C);
 _RWSTD_DEFINE_FACET_FACTORY (extern _RWSTD_EXPORT, num_get, TARGS_C, num_get);
 _RWSTD_SPECIALIZE_USE_FACET (num_get);

Modified: stdcxx/trunk/src/ti_num_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/ti_num_put.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/ti_num_put.cpp (original)
+++ stdcxx/trunk/src/ti_num_put.cpp Tue May 27 18:48:19 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.
  * 
  **************************************************************************/
 
@@ -45,6 +45,16 @@
 
 #define TARGS_C   <char, _RWSTD_OSTREAMBUF_ITER (char) >
 
+
+#if 6 == _RWSTD_HP_aCC_MAJOR
+   // silence the useless HP aCC 6 remark 4244: extern storage class
+   // used with a function definition on the "extern _RWSTD_EXPORT"
+   // macro argument below where the redundant "extern" is there to
+   // silence HP aCC 3 Warning (suggestion) 933: Null macro argument #1
+#  pragma diag_suppress 4244
+#endif   // aCC 6
+
+
 _RWSTD_SPECIALIZE_FACET_ID (num_put, TARGS_C);
 _RWSTD_DEFINE_FACET_FACTORY (extern _RWSTD_EXPORT, num_put, TARGS_C, num_put);
 _RWSTD_SPECIALIZE_USE_FACET (num_put);

Modified: stdcxx/trunk/src/ti_numpunct.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/ti_numpunct.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/ti_numpunct.cpp (original)
+++ stdcxx/trunk/src/ti_numpunct.cpp Tue May 27 18:48:19 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.
  * 
  **************************************************************************/
 
@@ -45,6 +45,15 @@
 #include "use_facet.h"
 
 
+#if 6 == _RWSTD_HP_aCC_MAJOR
+   // silence the useless HP aCC 6 remark 4244: extern storage class
+   // used with a function definition on the "extern _RWSTD_EXPORT"
+   // macro argument below where the redundant "extern" is there to
+   // silence HP aCC 3 Warning (suggestion) 933: Null macro argument #1
+#  pragma diag_suppress 4244
+#endif   // aCC 6
+
+
 _RWSTD_SPECIALIZE_FACET_ID (numpunct, <char>);
 _RWSTD_DEFINE_FACET_FACTORY (extern _RWSTD_EXPORT, numpunct, <char>, numpunct);
 _RWSTD_SPECIALIZE_USE_FACET (numpunct);

Modified: stdcxx/trunk/src/version.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/version.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/src/version.cpp (original)
+++ stdcxx/trunk/src/version.cpp Tue May 27 18:48:19 2008
@@ -35,6 +35,7 @@
 #ifdef _RWSTD_VER_STR
 
 extern const char __rw_ident[] = {
+    // %Z% keyword ("@(#)") retrieved by the POSIX what utility
     "@(#) Apache C++ Standard Library version " _RWSTD_VER_STR
 };
 

Modified: stdcxx/trunk/tests/include/rw_thread.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/include/rw_thread.h?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/include/rw_thread.h (original)
+++ stdcxx/trunk/tests/include/rw_thread.h Tue May 27 18:48:19 2008
@@ -33,6 +33,8 @@
 
 
 extern "C" {
+    typedef void* rw_thread_proc (void*);
+}    // extern "C"
 
 struct rw_thread_attr_t;
 
@@ -48,7 +50,7 @@
 _TEST_EXPORT int
 rw_thread_create (rw_thread_t*,
                   rw_thread_attr_t*,
-                  void* (*)(void*),
+                  rw_thread_proc*,
                   void*);
 
 
@@ -62,6 +64,13 @@
 // array with their id's; if (tidarray == 0), waits for all
 // threads to join and fills the aragarray with the result
 // returned from each thread
+// if (timeout != 0), then a timer will be started, and the function
+// rw_thread_pool_timeout_expired() will return true after that number
+// of seconds has passed. there is only one timer, so use timeouts
+// with caution. if you provide tidarray, you should join threads
+// before starting another pool, otherwise threads from the first
+// pool may not exit until the threads from a later second pool are
+// signalled to stop.
 // if (nthreads == SIZE_MAX), sets nthreads to the positive result
 // of rw_get_processors() plus 1, or to 2 otherwise
 // returns 0 on success, or a non-zero value indicating the thread
@@ -70,15 +79,20 @@
 rw_thread_pool (rw_thread_t*      /* tidarray */,
                 _RWSTD_SIZE_T     /* nthreads */,
                 rw_thread_attr_t* /* attr */,
-                void* (*)(void*)  /* thr_proc */,
-                void**            /* argarray */);
+                rw_thread_proc*   /* thr_proc */,
+                void**            /* argarray */,
+                _RWSTD_SIZE_T     /* timeout  */ = 0);
+
+// returns non-zero if the thread timeout flag has been set. should
+// be polled periodically by threads created by rw_thread_pool() so
+// that they know that the soft timeout has expired
+// see notes above for details
+_TEST_EXPORT int
+rw_thread_pool_timeout_expired ();
 
 // returns the number of logical processors/cores on the system,
 // or -1 on error
 _TEST_EXPORT int
 rw_get_cpus ();
 
-
-}   // extern "C"
-
 #endif   // RW_RWTHREAD_H_INCLUDED

Modified: stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp Tue May 27 18:48:19 2008
@@ -45,18 +45,21 @@
 
 // default number of threads (will be adjusted to the number
 // of processors/cores later)
-int rw_opt_nthreads = 1;
+int opt_nthreads = 1;
 
 // the number of times each thread should iterate (unless specified
 // otherwise on the command line)
-int rw_opt_nloops = 5000;
+int opt_nloops = 5000;
 
 // number of locales to use
-int rw_opt_nlocales = MAX_THREADS;
+int opt_nlocales = MAX_THREADS;
 
 // should all threads share the same set of locale objects instead
 // of creating their own?
-int rw_opt_shared_locale;
+int opt_shared_locale;
+
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
 
 /**************************************************************************/
 
@@ -314,7 +317,10 @@
     const int ni = RW_COUNT_OF (nsrc);
     const int wi = RW_COUNT_OF (wsrc);
 
-    for (int i = 0; i != rw_opt_nloops; ++i) {
+    for (int i = 0; i != opt_nloops; ++i) {
+
+        if (rw_thread_pool_timeout_expired ())
+            break;
 
         const int inx = i % nlocales;
         const MyCodecvtData& data = my_codecvt_data [inx];
@@ -322,8 +328,8 @@
         // construct a named locale, get a reference to the codecvt
         // facet from it and use it to format a random money value
         const std::locale loc =
-            rw_opt_shared_locale ? data.locale_
-                                 : std::locale (data.locale_name_);
+            opt_shared_locale ? data.locale_
+                              : std::locale (data.locale_name_);
 
         const MyCodecvtData::CvtId op =
             MyCodecvtData::CvtId (i % MyCodecvtData::cvt_max);
@@ -460,7 +466,7 @@
             run_test_fill<wchar_t>
                 (loc, wsrc [inx % wi], nsrc [inx % ni], data.wchar_data_);
 
-            if (rw_opt_shared_locale)
+            if (opt_shared_locale)
                 data.locale_ = loc;
 
             nlocales += 1;
@@ -471,7 +477,7 @@
                      "failed to create locale(%#s)", name);
         }
 
-        if (nlocales == maxinx || nlocales == std::size_t (rw_opt_nlocales))
+        if (nlocales == maxinx || nlocales == std::size_t (opt_nlocales))
             break;
     }
 
@@ -482,8 +488,8 @@
     rw_info (0, 0, 0,
              "testing std::codecvt<charT> with %d thread%{?}s%{;}, "
              "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
-             rw_opt_nthreads, 1 != rw_opt_nthreads,
-             rw_opt_nloops, 1 != rw_opt_nloops,
+             opt_nthreads, 1 != opt_nthreads,
+             opt_nloops, 1 != opt_nloops,
              nlocales, int (nlocales), "%#s", locales);
 
     ///////////////////////////////////////////////////////////////////////
@@ -495,11 +501,12 @@
 
     // create and start a pool of threads and wait for them to finish
     int result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
     ///////////////////////////////////////////////////////////////////////
 
@@ -509,11 +516,12 @@
     test_wchar  = true;
 
     result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
     ///////////////////////////////////////////////////////////////////////
 
@@ -524,11 +532,12 @@
     test_wchar  = true;
 
     result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
     return result;
 }
@@ -541,24 +550,26 @@
 
     // set nthreads to the greater of the number of processors
     // and 2 (for uniprocessor systems) by default
-    rw_opt_nthreads = rw_get_cpus ();
-    if (rw_opt_nthreads < 2)
-        rw_opt_nthreads = 2;
+    opt_nthreads = rw_get_cpus ();
+    if (opt_nthreads < 2)
+        opt_nthreads = 2;
 
 #endif   // _RWSTD_REENTRANT
 
     return rw_test (argc, argv, __FILE__,
                     "lib.locale.codecvt",
                     "thread safety", run_test,
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // must be non-negative
                     "|-nthreads#0-* "    // must be in [0, MAX_THREADS]
                     "|-nlocales#0 "      // arg must be non-negative
                     "|-locales= "        // must be provided
                     "|-shared-locale# ",
-                    &rw_opt_nloops,
+                    &opt_timeout,
+                    &opt_nloops,
                     int (MAX_THREADS),
-                    &rw_opt_nthreads,
-                    &rw_opt_nlocales,
+                    &opt_nthreads,
+                    &opt_nlocales,
                     &rw_opt_setlocales,
-                    &rw_opt_shared_locale);
+                    &opt_shared_locale);
 }

Modified: stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp Tue May 27 18:48:19 2008
@@ -197,7 +197,7 @@
 struct WideCode
 {
     wchar_t wchar;
-    char    mbchar [MB_LEN_MAX];
+    char    mbchar [MB_LEN_MAX + 1];
 };
 
 typedef WideCode mb_char_array_t [MB_LEN_MAX];

Modified: stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp Tue May 27 18:48:19 2008
@@ -50,6 +50,9 @@
 // command line option
 int opt_combine;
 
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
+
 /**************************************************************************/
 
 // array of locale names to use for testing
@@ -85,6 +88,9 @@
 
     for (int i = 0; i != opt_nloops; ++i) {
 
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         // compute an index into the array of locales
         const std::size_t linx = i % nlocales;
 
@@ -183,7 +189,7 @@
 
     // create and start a pool of threads and wait for them to finish
     result = rw_thread_pool (0, std::size_t (opt_nthreads), 0,
-                                 test_ctors, 0);
+                             test_ctors, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -210,10 +216,12 @@
                     "lib.locale.cons",
                     "thread safety", run_test,
                     "|-combine~ "
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // must be non-negative
                     "|-nthreads#0-* "    // must be in [0, MAX_THREADS]
                     "|-locales=",        // must be provided
                     &opt_combine,
+                    &opt_timeout,
                     &opt_nloops,
                     int (MAX_THREADS),
                     &opt_nthreads,

Modified: stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp Tue May 27 18:48:19 2008
@@ -66,6 +66,9 @@
 // of creating their own?
 int opt_shared_locale;
 
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
+
 /**************************************************************************/
 
 // array of locale names to use for testing
@@ -118,6 +121,9 @@
 
     for (int i = 0; i != opt_nloops; ++i) {
 
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         const std::size_t inx = std::size_t (i) % nlocales;
 
         // save the name of the locale
@@ -260,7 +266,8 @@
 
     // create and start a pool of threads and wait for them to finish
     int result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -276,7 +283,8 @@
     // start a pool of threads to exercise the thread safety
     // of the wchar_t specialization
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -293,7 +301,8 @@
 
     // start a pool of threads to exercise wstring thread safety
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -321,11 +330,13 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.locale.ctype",
                     "thread safety", run_test,
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // arg must be non-negative
                     "|-nthreads#0-* "    // arg must be in [0, MAX_THREADS]
                     "|-nlocales#0 "      // arg must be non-negative
                     "|-locales= "        // arg must be provided
                     "|-shared-locale# ",
+                    &opt_timeout,
                     &opt_nloops,
                     int (MAX_THREADS),
                     &opt_nthreads,

Modified: stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp Tue May 27 18:48:19 2008
@@ -73,6 +73,9 @@
 // disable exceptions?
 int opt_no_exceptions;
 
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
+
 /**************************************************************************/
 
 // array of locale names to use for testing
@@ -149,6 +152,9 @@
 
     for (int i = 0; i != opt_nloops; ++i) {
 
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         // save the name of the locale
         const char* const locale_name = locales [i % nlocales];
 
@@ -395,6 +401,10 @@
     const std::locale classic (std::locale::classic ());
 
     for (int i = 0; i != opt_nloops; ++i) {
+
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         try {
             use_facet_loop (classic, i);
         }
@@ -510,7 +520,7 @@
 
         // create and start a pool of threads and wait for them to finish
         result = rw_thread_pool (0, std::size_t (opt_nthreads), 0,
-                                 test_has_facet, 0);
+                                 test_has_facet, 0, std::size_t (opt_timeout));
 
         rw_error (result == 0, 0, __LINE__,
                   "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -554,7 +564,7 @@
 
         // create and start a pool of threads and wait for them to finish
         result = rw_thread_pool (0, std::size_t (opt_nthreads), 0,
-                                 test_use_facet, 0);
+                                 test_use_facet, 0, std::size_t (opt_timeout));
 
         rw_error (result == 0, 0, __LINE__,
                   "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -586,6 +596,7 @@
                     "thread safety", run_test,
                     "|-has_facet~ "
                     "|-use_facet~ "
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // arg must be non-negative
                     "|-nthreads#0-* "    // arg must be in [0, MAX_THREADS]
                     "|-locales= "        // argument must be provided
@@ -605,6 +616,7 @@
                     "|-time_put~ ",
                     &opt_has_facet,
                     &opt_use_facet,
+                    &opt_timeout,
                     &opt_nloops,
                     int (MAX_THREADS),
                     &opt_nthreads,

Modified: stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp Tue May 27 18:48:19 2008
@@ -30,44 +30,76 @@
 
 #include <driver.h>      // for rw_test()
 #include <rw_locale.h>   // for rw_create_catalog()
-#include <rw_thread.h>
+#include <rw_thread.h>   // for rw_thread_pool()
+#include <rw_process.h>  // for rw_system()
+#include <file.h>        // for SHELL_RM_F
 #include <valcmp.h>      // for rw_strncmp ()
 
 #include <cstring>   // for strlen()
 #include <cstdio>    // for remove()
 
 // maximum number of threads allowed by the command line interface
+#define MAX_CATALOGS     32
 #define MAX_THREADS      32
 #define MAX_LOOPS    100000
 
+// deault number of catalogs
+int opt_ncatalogs = 11;
+
 // default number of threads (will be adjusted to the number
 // of processors/cores later)
-int rw_opt_nthreads = 1;
+int opt_nthreads = 1;
 
 // the number of times each thread should iterate (unless specified
 // otherwise on the command line)
-int rw_opt_nloops = 100000;
+int opt_nloops = 10000;
+
+#if !defined (_RWSTD_OS_HP_UX) || defined (_ILP32)
+
+// number of locales to use
+int opt_nlocales = MAX_THREADS;
+
+#else   // HP-UX in LP64 mode
 
-// locale for threads to share
-static const
-std::locale locale;
-
-// message catalog for threads to share
-static
-std::messages_base::catalog catalog;
+// work around a small cache size on HP-UX in LP64 mode
+// in LP64 mode (see STDCXX-812)
+int opt_nlocales = 9;
 
-static
-std::messages_base::catalog wcatalog;
+#endif   // HP-UX 32/64 bit mode
+
+// should all threads share the same set of locale objects instead
+// of creating their own?
+int opt_shared_locale;
+
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
 
 /**************************************************************************/
 
-#ifndef _WIN32
-#  define CAT_NAME "./rwstdmessages.cat"
-#  define MSG_NAME "rwstdmessages.msg"
-#else
-#  define CAT_NAME "rwstdmessages.dll"
-#  define MSG_NAME "rwstdmessages.rc"
-#endif
+// array of locale names to use for testing
+static const char*
+locales [MAX_THREADS];
+
+// number of locale names in the array
+static std::size_t
+nlocales;
+
+/**************************************************************************/
+
+//
+struct MyMessageData
+{
+    // name of the locale the data corresponds to
+    const char* locale_name_;
+
+    // optionally set to the named locale for threads to share
+    std::locale locale_;
+
+} my_message_data [MAX_THREADS];
+
+char my_catalog_names [64][MAX_CATALOGS];
+
+/**************************************************************************/
 
 #define MAX_SETS 5
 #define MAX_MESSAGES  5
@@ -123,38 +155,6 @@
     }
 };
 
-static std::string str_messages;
-
-/**************************************************************************/
-
-template <class T>
-void test_open_close (const std::locale& loc,
-                      const std::messages<T>& msgs,
-                      const std::string& name)
-{
-    std::messages_base::catalog cat =
-        (msgs.open) (name, loc);
-
-    RW_ASSERT (! (cat < 0));
-
-    (msgs.close) (cat);
-}
-
-template <class T>
-void test_get (const std::messages<T>& msgs,
-               const std::messages_base::catalog cat,
-               int set, int msgid,
-               const std::basic_string<T>& dflt)
-{
-    // the msg_id() thing seems like a bug to me. if anything, the user
-    // should never need to write or call msg_id().
-
-    const typename std::messages<T>::string_type res =
-        msgs.get (cat, set, msg_id (set, msgid), dflt);
-
-    RW_ASSERT (!rw_strncmp (messages [set-1][msgid-1], res.c_str ()));
-}
-
 /**************************************************************************/
 
 extern "C" {
@@ -165,50 +165,146 @@
 static void*
 thread_func (void*)
 {
-    const std::string name (CAT_NAME);
-
-    const std::messages<char>& nmsgs =
-        std::use_facet<std::messages<char> >(locale);
-
     const std::string ndflt ("\1\2\3\4");
 
+    struct {
+        std::messages_base::catalog cat;
+        std::locale loc;
+    } ncatalogs [4];
+
+    const unsigned n_ncatalogs = sizeof (ncatalogs) / sizeof (*ncatalogs);
+
+    // 22.2.7.1.2 says values less than 0 returned if catalog can't
+    // be opened, so we use -1 as a sentinel.
+    for (unsigned c = 0; c < n_ncatalogs; ++c)
+        ncatalogs [c].cat = -1;
+
 #ifndef _RWSTD_NO_WCHAR_T
-    const std::messages<wchar_t>& wmsgs =
-        std::use_facet<std::messages<wchar_t> >(locale);
 
     const std::wstring wdflt (L"\1\2\3\4");
-#endif // _RWSTD_NO_WCHAR_T
 
-    for (int i = 0; i != rw_opt_nloops; ++i) {
+    struct {
+        std::messages_base::catalog cat;
+        std::locale loc;
+    } wcatalogs [5];
+
+    const unsigned n_wcatalogs = sizeof (wcatalogs) / sizeof (*wcatalogs);
 
-        int set   = 1 + i % MAX_SETS;
-        int msgid = 1 + i % MAX_MESSAGES;
+    for (unsigned c = 0; c < n_wcatalogs; ++c)
+        wcatalogs [c].cat = -1;
+
+#endif   // _RWSTD_NO_WCHAR_T
+
+    ///////////////////////////////////////////////////////////////////////
+
+    for (int i = 0; i < opt_nloops; ++i) {
+
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
+        const MyMessageData& data = my_message_data [i % nlocales];
+
+        // construct a named locale, get a reference to the money_get
+        // facet from it and use it to format a random money value
+        const std::locale loc = 
+            opt_shared_locale ? data.locale_
+                              : std::locale (data.locale_name_);
+
+        const int set   = 1 + i % MAX_SETS;
+        const int msgid = 1 + i % MAX_MESSAGES;
 
         if (test_char) {
-            if (i & 1) {
-                test_get<char>(nmsgs, catalog, set, msgid, ndflt);
+            // exercise the narrow char specialization of the facet
+
+            const std::messages<char> &nm =
+                std::use_facet<std::messages<char> >(loc);
+
+            const unsigned cat_idx = i % n_ncatalogs;
+            if (! (ncatalogs [cat_idx].cat < 0)) {
+                (nm.close)(ncatalogs [cat_idx].cat);
             }
-            else {
-                test_open_close<char>(locale, nmsgs, name);
+
+            const unsigned name_idx = i % opt_ncatalogs;
+
+            const std::messages_base::catalog cat = 
+                (nm.open)(my_catalog_names [name_idx], loc);
+
+            ncatalogs [cat_idx].cat = cat;
+            ncatalogs [cat_idx].loc = loc;
+
+            if (i & 1) {
+
+                // get a message from the catalog every odd iteration
+                const std::messages<char>::string_type res =
+                        nm.get (cat, set, msg_id (set, msgid), ndflt);
+
             }
         }
 
+#ifndef _RWSTD_NO_WCHAR_T
+
         if (test_wchar) {
+            // exercise the wide char specialization of the facet
 
-#ifndef _RWSTD_NO_WCHAR_T
+            const std::messages<wchar_t> &wm =
+                std::use_facet<std::messages<wchar_t> >(loc);
 
-            if (i & 1) {
-                test_get<wchar_t>(wmsgs, wcatalog, set, msgid, wdflt);
+            const unsigned cat_idx = i % n_wcatalogs;
+            if (! (wcatalogs [cat_idx].cat < 0)) {
+                (wm.close)(wcatalogs [cat_idx].cat);
             }
-            else {
-                test_open_close<wchar_t>(locale, wmsgs, name);
+
+            const unsigned name_idx = i % opt_ncatalogs;
+
+            const std::messages_base::catalog cat = 
+                (wm.open)(my_catalog_names [name_idx], loc);
+
+            RW_ASSERT (! (cat < 0));
+
+            wcatalogs [cat_idx].cat = cat;
+            wcatalogs [cat_idx].loc = loc;
+
+            if (! (i & 1)) {
+
+                // get a message from the catalog every even iteration
+                const std::messages<wchar_t>::string_type res =
+                        wm.get (cat, set, msg_id (set, msgid), wdflt);
+
             }
+        }
 
-#endif // _RWSTD_NO_WCHAR_T
+#endif   // _RWSTD_NO_WCHAR_T
+
+    }
+
+    ///////////////////////////////////////////////////////////////////////
+
+    // close any catalogs that are still open
+
+    for (unsigned c = 0; c < n_ncatalogs; ++c) {
+        if (! (ncatalogs [c].cat < 0)) {
+
+            const std::messages<char> &nm =
+                std::use_facet<std::messages<char> >(ncatalogs[c].loc);
+
+            (nm.close)(ncatalogs [c].cat);
+        }
+    }
+
+#ifndef _RWSTD_NO_WCHAR_T
 
+    for (unsigned c = 0; c < n_wcatalogs; ++c) {
+        if (! (wcatalogs [c].cat < 0)) {
+
+            const std::messages<wchar_t> &wm =
+                std::use_facet<std::messages<wchar_t> >(wcatalogs[c].loc);
+
+            (wm.close)(wcatalogs [c].cat);
         }
     }
 
+#endif   // _RWSTD_NO_WCHAR_T
+
     return 0;
 }
 
@@ -219,36 +315,96 @@
 static int
 run_test (int, char**)
 {
+    std::string catalog;
+
+    // initialize the catalog data
     for (int i = 0; i < MAX_SETS; ++i) {
-        for (int j = 0; j < MAX_MESSAGES; ++j)
-            str_messages.append (messages [i][j], std::strlen (messages [i][j]) + 1);
 
-        str_messages.append (1, '\0');
+        for (int j = 0; j < MAX_MESSAGES; ++j) {
+            catalog.append (messages [i][j],
+                            std::strlen (messages [i][j]) + 1);
+        }
+
+        catalog.append (1, '\0');
     }
 
-    // generate a message catalog
-    rw_create_catalog (MSG_NAME, str_messages.c_str ());
-    const std::string name (CAT_NAME);
+    ///////////////////////////////////////////////////////////////////////
 
-    const std::messages<char>& nmsgs =
-        std::use_facet<std::messages<char> >(locale);
+    // create the catalogs and initialize array of catalog names
+    for (int i = 0; i < opt_ncatalogs; ++i) {
 
-    catalog = (nmsgs.open) (name, locale);
+        char* msg_name = my_catalog_names [i];
 
-#ifndef _RWSTD_NO_WCHAR_T
-
-    const std::messages<wchar_t>& wmsgs =
-        std::use_facet<std::messages<wchar_t> >(locale);
+#ifndef _WIN32
+        std::sprintf (msg_name, "rwstdmessages_%d.msg", i);
+#else
+        std::sprintf (msg_name, "rwstdmessages_%d.rc", i);
+#endif
 
-    wcatalog = (wmsgs.open) (name, locale);
+        const int failed = rw_create_catalog (msg_name, catalog.c_str ());
+        rw_fatal (!failed, 0, __LINE__,
+                  "failed to create message catalog from %s",
+                  msg_name);
 
+#ifndef _WIN32
+        std::sprintf (msg_name, "./rwstdmessages_%d.cat", i);
+#else
+        std::sprintf (msg_name, "rwstdmessages_%d.dll", i);
 #endif
+    }
+
+    ///////////////////////////////////////////////////////////////////////
+
+    // find all installed locales for which setlocale (LC_ALL) succeeds
+    const char* const locale_list =
+        rw_opt_locales ? rw_opt_locales : rw_locales (_RWSTD_LC_ALL);
+
+    const std::size_t maxinx = RW_COUNT_OF (locales);
+
+    for (const char* name = locale_list;
+         *name;
+         name += std::strlen (name) + 1) {
+
+        const std::size_t inx = nlocales;
+        locales [inx] = name;
+
+        // fill in the money and results for this locale
+        MyMessageData& data = my_message_data [inx];
+        data.locale_name_ = name;
+
+        try {
+            const std::locale loc (data.locale_name_);
+
+            const std::messages<char>& nm =
+                std::use_facet<std::messages<char> >(loc);
+
+#ifdef _RWSTD_NO_WCHAR_T
+
+            const std::messages<wchar_t>& nm =
+                std::use_facet<std::messages<wchar_t> >(loc);
+
+#endif // _RWSTD_NO_WCHAR_T
+
+            if (opt_shared_locale)
+                data.locale_ = loc;
+
+            nlocales += 1;
+
+        }
+        catch (...) {
+            rw_warn (!rw_opt_locales, 0, __LINE__,
+                     "unable to use locale(%#s)", name);
+        }
+
+        if (nlocales == maxinx || nlocales == std::size_t (opt_nlocales))
+            break;
+    }
 
     rw_info (0, 0, 0,
              "testing std::messages<charT> with %d thread%{?}s%{;}, "
              "%d iteration%{?}s%{;} each",
-             rw_opt_nthreads, 1 != rw_opt_nthreads,
-             rw_opt_nloops, 1 != rw_opt_nloops);
+             opt_nthreads, 1 != opt_nthreads,
+             opt_nloops, 1 != opt_nloops);
 
     ///////////////////////////////////////////////////////////////////////
 
@@ -258,12 +414,12 @@
     rw_info (0, 0, 0, "exercising std::messages<char>");
 
     int result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0,
-                        thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
     ///////////////////////////////////////////////////////////////////////
 
@@ -275,12 +431,12 @@
     rw_info (0, 0, 0, "exercising std::messages<wchar_t>");
 
     result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0,
-                        thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
     ///////////////////////////////////////////////////////////////////////
 
@@ -291,26 +447,18 @@
                       "std::messages<wchar_t>");
 
     result = 
-        rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0,
-                        thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
-              rw_opt_nthreads, thread_func);
+              opt_nthreads, thread_func);
 
 #endif // _RWSTD_NO_WCHAR_T
 
     ///////////////////////////////////////////////////////////////////////
 
-    (nmsgs.close) (catalog);
-
-#ifndef _RWSTD_NO_WCHAR_T
-
-    (wmsgs.close) (wcatalog);
-    
-#endif // _RWSTD_NO_WCHAR_T
-
-    std::remove (CAT_NAME);
+    rw_system (SHELL_RM_F "rwstdmessages_*");
 
     return result;
 }
@@ -323,18 +471,23 @@
 
     // set nthreads to the greater of the number of processors
     // and 2 (for uniprocessor systems) by default
-    rw_opt_nthreads = rw_get_cpus ();
-    if (rw_opt_nthreads < 2)
-        rw_opt_nthreads = 2;
+    opt_nthreads = rw_get_cpus ();
+    if (opt_nthreads < 2)
+        opt_nthreads = 2;
 
 #endif   // _RWSTD_REENTRANT
 
     return rw_test (argc, argv, __FILE__,
                     "lib.locale.messages",
                     "thread safety", run_test,
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // must be non-negative
+                    "|-ncatalogs#0-* "   // must be non-negative
                     "|-nthreads#0-* ",    // must be in [0, MAX_THREADS]
-                    &rw_opt_nloops,
+                    &opt_timeout,
+                    &opt_nloops,
+                    int (MAX_CATALOGS),
+                    &opt_ncatalogs,
                     int (MAX_THREADS),
-                    &rw_opt_nthreads);
+                    &opt_nthreads);
 }

Modified: stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp Tue May 27 18:48:19 2008
@@ -67,6 +67,9 @@
 // of creating their own?
 int opt_shared_locale;
 
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
+
 /**************************************************************************/
 
 // array of locale names to use for testing
@@ -176,6 +179,9 @@
 
     for (int i = 0; i != opt_nloops; ++i) {
 
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         // save the name of the locale
         const MyMoneyData& data = my_money_data [i % nlocales];
 
@@ -183,7 +189,7 @@
         // facet from it and use it to format a random money value
         const std::locale loc =
             opt_shared_locale ? data.locale_
-                                 : std::locale (data.locale_name_);
+                              : std::locale (data.locale_name_);
 
         if (test_char) {
             // exercise the narrow char specialization of the facet
@@ -403,7 +409,8 @@
 
     // create and start a pool of threads and wait for them to finish
     int result = 
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -418,7 +425,8 @@
 
     // start a pool of threads to exercise wstring thread safety
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -436,7 +444,8 @@
 
     // start a pool of threads to exercise wstring thread safety
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -464,11 +473,13 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.locale.money.get",
                     "thread safety", run_test,
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // must be non-negative
                     "|-nthreads#0-* "    // must be in [0, MAX_THREADS]
                     "|-nlocales#0 "      // arg must be non-negative
                     "|-locales= "        // must be provided
                     "|-shared-locale# ",
+                    &opt_timeout,
                     &opt_nloops,
                     int (MAX_THREADS),
                     &opt_nthreads,

Modified: stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp?rev=660776&r1=660775&r2=660776&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp Tue May 27 18:48:19 2008
@@ -67,6 +67,9 @@
 // of creating their own?
 int opt_shared_locale;
 
+// default timeout used by each threaded section of this test
+int opt_timeout = 60;
+
 /**************************************************************************/
 
 // array of locale names to use for testing
@@ -184,6 +187,9 @@
 
     for (int i = 0; i != opt_nloops; ++i) {
 
+        if (rw_thread_pool_timeout_expired ())
+            break;
+
         // save the name of the locale
         const MyMoneyData& data = my_money_data [i % nlocales];
 
@@ -191,7 +197,7 @@
         // facet from it and use it to format a random money value
         const std::locale loc =
             opt_shared_locale ? data.locale_
-                                 : std::locale (data.locale_name_);
+                              : std::locale (data.locale_name_);
 
         if (test_char) {
             // exercise the narrow char specialization of the facet
@@ -409,7 +415,8 @@
 
     // create and start a pool of threads and wait for them to finish
     int result = 
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -424,7 +431,8 @@
 
     // start a pool of threads to exercise wstring thread safety
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -442,7 +450,8 @@
 
     // start a pool of threads to exercise wstring thread safety
     result =
-        rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
+        rw_thread_pool (0, std::size_t (opt_nthreads), 0,
+                        thread_func, 0, std::size_t (opt_timeout));
 
     rw_error (result == 0, 0, __LINE__,
               "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
@@ -470,11 +479,13 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.locale.money.put",
                     "thread safety", run_test,
+                    "|-soft-timeout#0 "  // must be non-negative
                     "|-nloops#0 "        // must be non-negative
                     "|-nthreads#0-* "    // must be in [0, MAX_THREADS]
                     "|-nlocales#0 "      // arg must be non-negative
                     "|-locales= "        // must be provided
                     "|-shared-locale# ",
+                    &opt_timeout,
                     &opt_nloops,
                     int (MAX_THREADS),
                     &opt_nthreads,



Mime
View raw message