Author: faridz
Date: Tue Mar 25 01:49:39 2008
New Revision: 640746

URL: http://svn.apache.org/viewvc?rev=640746&view=rev
Log:
2008-03-25  Farid Zaripov  <[EMAIL PROTECTED]>

        STDCXX-792
        * src/locale_body.cpp (_C_manage): Cast ginit to non-volatile to use 
the non-template 
        version of the __rw_atomic_preincrement() if available.
        Declare static variable ginit as int instead of long because the all 
native atomic
        functions are defined for int type and the overloads for long type just 
calls overload
        for int type on platforms where sizeof (int) == sizeof (long).

Modified:
    stdcxx/trunk/src/locale_body.cpp

Modified: stdcxx/trunk/src/locale_body.cpp
URL: 
http://svn.apache.org/viewvc/stdcxx/trunk/src/locale_body.cpp?rev=640746&r1=640745&r2=640746&view=diff
==============================================================================
--- stdcxx/trunk/src/locale_body.cpp (original)
+++ stdcxx/trunk/src/locale_body.cpp Tue Mar 25 01:49:39 2008
@@ -805,9 +805,11 @@
 
         if (!global) {
 
-            static volatile long ginit /* = 0 */;
+            static volatile int ginit /* = 0 */;
 
-            if (!ginit && 1 == _RWSTD_ATOMIC_PREINCREMENT (ginit, false)) {
+            // cast ginit to int& (STDCXX-792)
+            // casting should be removed after fixing STDCXX-794
+            if (!ginit && 1 == _RWSTD_ATOMIC_PREINCREMENT ((int&)ginit, 
false)) {
                 global  = _C_manage (0, "C");
                 ginit  += 1000;
             }


Reply via email to