stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r351522 - /incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp
Date Thu, 01 Dec 2005 23:34:52 GMT
Author: sebor
Date: Thu Dec  1 15:34:42 2005
New Revision: 351522

URL: http://svn.apache.org/viewcvs?rev=351522&view=rev
Log:
2005-12-01  Martin Sebor  <sebor@roguewave.com>

	* NEW_THROWS.cpp: Corrected a printf statement in conditionally
	compiled code.
	Simplified/corrected loop allocating large amounts of memory
	and explicitly #defined the config macro on test failure instead
	of relying on the infrastructure to do it.

Modified:
    incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp?rev=351522&r1=351521&r2=351522&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp Thu Dec  1 15:34:42 2005
@@ -11,8 +11,9 @@
 #endif   // _RWSTD_NO_SETRLIMIT
 
 
-#ifndef _RWSTD_NO_HONOR_STD
-#  ifdef _RWSTD_NO_STD_TERMINATE
+#if 2 == __GNUG__
+#  ifndef _RWSTD_NO_HONOR_STD
+#    ifdef _RWSTD_NO_STD_TERMINATE
 
 namespace std {
 
@@ -32,8 +33,9 @@
 
 }   // namespace std
 
-#  endif   // _RWSTD_NO_STD_TERMINATE
-#endif   // _RWSTD_NO_HONOR_STD
+#    endif   // _RWSTD_NO_STD_TERMINATE
+#  endif   // _RWSTD_NO_HONOR_STD
+#endif   // gcc 2.x
 
 
 #if (defined (_WIN32) || defined (_WIN64)) && !defined (__CYGWIN__)
@@ -63,7 +65,7 @@
 int main ()
 {
 #if !defined (_RWSTD_USE_CONFIG)
-    printf ("#undef _RWSTD_NO_NEW_THROWS\n");
+    printf ("/**/\n#undef _RWSTD_NO_NEW_THROWS\n");
 #endif
 
     nodbg ();
@@ -101,10 +103,11 @@
     p = (void*)1;
 
     try {
-        for (unsigned long n = 1U << sizeof (long) * 8 - 1;
-             p && 0 != n; n = n | (n >> 1)) {
+        const size_t size = (size_t)1 << (sizeof (size_t) * 8 - 1);
+
+        for (int i = 0; i != 256; ++i) {
             // try to allocate a huge amount of memory
-            p = ::operator new (n);
+            p = ::operator new (size);
             // do not delete
         }
     }
@@ -112,5 +115,7 @@
         return 0;
     }
 
-    return 1;
+    printf ("#define _RWSTD_NO_NEW_THROWS\n");
+
+    return 0;
 }



Mime
View raw message