402N/A--- stdcxx-4.2.1/tests/regress/21.string.stdcxx-162.cpp 2008-04-24 17:23:26.000000000 -0700
402N/A+++ stdcxx-4.2.1/tests/regress/21.string.stdcxx-162.cpp 2011-03-23 11:45:44.381532276 -0700
402N/A@@ -28,6 +28,7 @@
402N/A
402N/A #include <cassert>
402N/A #include <string>
402N/A+#include <iostream>
402N/A
402N/A #ifdef _RWSTD_POSIX_THREADS
402N/A # include <pthread.h>
402N/A@@ -47,6 +48,14 @@
402N/A int ref_count;
402N/A std::string::size_type capacity;
402N/A std::string::size_type size;
402N/A+#ifndef _RWSTD_NO_STRING_REF_COUNT
402N/A+# if defined (_RWSTD_REENTRANT) \
402N/A+ && !defined (_RWSTD_ONE_STRING_MUTEX) \
402N/A+ && !defined (_RWSTD_NO_STRING_MUTEX)
402N/A+
402N/A+ __rw::__rw_mutex_base mutex;
402N/A+# endif // _REENTRANT && !_ONE_STRING_MUTEX && !_NO_STRING_MUTEX
402N/A+#endif // _RWSTD_NO_STRING_REF_COUNT
402N/A };
402N/A
402N/A // verify that the reference-counted string body isn't bigger
402N/A@@ -56,15 +65,22 @@
402N/A #ifdef MUTEX
402N/A
402N/A struct LargeRef {
402N/A- MUTEX mutex;
402N/A int ref_count;
402N/A std::string::size_type capacity;
402N/A std::string::size_type size;
402N/A+#ifndef _RWSTD_NO_STRING_REF_COUNT
402N/A+# if defined (_RWSTD_REENTRANT) \
402N/A+ && !defined (_RWSTD_ONE_STRING_MUTEX) \
402N/A+ && !defined (_RWSTD_NO_STRING_MUTEX)
402N/A+
402N/A+ __rw::__rw_mutex_base mutex;
402N/A+# endif // _REENTRANT && !_ONE_STRING_MUTEX && !_NO_STRING_MUTEX
402N/A+#endif // _RWSTD_NO_STRING_REF_COUNT
402N/A };
402N/A
402N/A // verify that the reference-counted string body is smaller
402N/A // than the struct containing a full-blown mutex object above
402N/A- assert (sizeof (strref) < sizeof (LargeRef));
402N/A+ assert (sizeof (strref) <= sizeof (LargeRef));
402N/A
402N/A #endif // MUTEX
402N/A