components/stdcxx/patches/037-locale_body.cpp.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 402 94ae4d75524c
permissions -rw-r--r--
Close of build 04.

--- stdcxx-4.2.1/src/locale_body.cpp	2008-04-24 20:25:19.000000000 -0400
+++ stdcxx-4.2.1/src/locale_body.cpp	2009-07-29 14:53:30.000000000 -0400
@@ -126,7 +126,7 @@
 //         and ctype<wchar_t> from "ja_JP", etc.)
 
 char* __rw_locale::
-_C_get_cat_names (char *buf, size_t bufsize) const
+_C_get_cat_names (char *buf, _RWSTD_SIZE_T bufsize) const
 {
     const size_t  savesize = bufsize;
     char         *savebuf  = buf;
@@ -584,7 +584,7 @@
            _C_byname_facet_bits = _C_all;
    }
 
-#if defined (__i386__) || !defined (__GNUG__) || __GNUG__ < 3
+#if defined (__i386__) || !defined (__GNUG__) || (__GNUG__ < 3) || defined(__SUNPRO_CC)
 
    memset (_C_std_facets, 0, sizeof _C_std_facets);
 
@@ -1009,15 +1009,28 @@
 
                     // the classic C locale is statically allocated
                     // and not destroyed during the lifetime of the process
+
+#if defined(_RWSTD_STRICT_SPARCV8_MUTEX_ALIGNMENT)
+#  pragma pack(8)
+#  pragma align 8(classic_body)
+#endif
                     static union {
+#if defined(_RWSTD_STRICT_SPARCV8_MUTEX_ALIGNMENT)
+                        unsigned long long _C_align;
+                        unsigned char  _C_buf [sizeof (__rw_locale)];
+#else
                         void* _C_align;
                         char  _C_buf [sizeof (__rw_locale)];
+#endif
                     } classic_body;
 
                     // construct a locale body in place
                     // with the initial reference count of 1
                     classic = new (&classic_body) __rw_locale (locname);
 
+#if defined(_RWSTD_STRICT_SPARCV8_MUTEX_ALIGNMENT)
+#  pragma pack(0)
+#endif
                     _RWSTD_ASSERT (1 == classic->_C_ref);
                 }
                 else {