You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2008/06/09 18:08:36 UTC

svn commit: r665734 - in /stdcxx/branches/4.2.x: include/rw/_config.h include/rw/_mutex.h include/string.cc src/exception.cpp tests/utilities/20.auto.ptr.cpp

Author: faridz
Date: Mon Jun  9 09:08:36 2008
New Revision: 665734

URL: http://svn.apache.org/viewvc?rev=665734&view=rev
Log:
2008-06-09  Farid Zaripov  <fa...@epam.com>

	* include/rw/_config.h: Add new macro _RWSTD_MSVC, defined as _MSC_VER, to
	simplify preprocessor conditions, that intended for MSVC only.
	* include/rw/_mutex.h: Simplify preprocessor condition using _RWSTD_MSVC.
	* include/string.cc: Ditto.
	* tests/utilities/20.auto.ptr.cpp: Ditto.
	* src/exception.cpp: Make exception(const exception&) consistent with exception().

Modified:
    stdcxx/branches/4.2.x/include/rw/_config.h
    stdcxx/branches/4.2.x/include/rw/_mutex.h
    stdcxx/branches/4.2.x/include/string.cc
    stdcxx/branches/4.2.x/src/exception.cpp
    stdcxx/branches/4.2.x/tests/utilities/20.auto.ptr.cpp

Modified: stdcxx/branches/4.2.x/include/rw/_config.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config.h?rev=665734&r1=665733&r2=665734&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_config.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_config.h Mon Jun  9 09:08:36 2008
@@ -237,6 +237,7 @@
 /*** MSVC *****************************************************************/
 
 #if defined (_MSC_VER) && !defined (__INTEL_COMPILER)
+#  define _RWSTD_MSVC _MSC_VER
 #  include "_config-msvc.h"
 #endif   // _MSC_VER && !__INTEL_COMPILER
 

Modified: stdcxx/branches/4.2.x/include/rw/_mutex.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_mutex.h?rev=665734&r1=665733&r2=665734&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_mutex.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_mutex.h Mon Jun  9 09:08:36 2008
@@ -175,29 +175,29 @@
 extern "C" long __cdecl _InterlockedIncrement (volatile long*);
 extern "C" long __cdecl _InterlockedDecrement (volatile long*);
 extern "C" long __cdecl _InterlockedExchange (volatile long*, long);
-#    ifndef __INTEL_COMPILER
+#    ifdef _RWSTD_MSVC
 #      pragma intrinsic (_InterlockedIncrement)
 #      pragma intrinsic (_InterlockedDecrement)
 #      pragma intrinsic (_InterlockedExchange)
-#    endif   // __INTEL_COMPILER
+#    endif   // _RWSTD_MSVC
 
-#    if _MSC_VER >= 1400 && !defined (__INTEL_COMPILER)
+#    if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
 extern "C" short __cdecl _InterlockedIncrement16 (volatile short*);
 extern "C" short __cdecl _InterlockedDecrement16 (volatile short*);
 #      pragma intrinsic (_InterlockedIncrement16)
 #      pragma intrinsic (_InterlockedDecrement16)
-#    endif   // _MSC_VER >= 1400 && !__INTEL_COMPILER
+#    endif   // _RWSTD_MSVC >= 1400
 
 #    ifdef _M_X64
 extern "C" long long __cdecl _InterlockedIncrement64 (volatile long long*);
 extern "C" long long __cdecl _InterlockedDecrement64 (volatile long long*);
 extern "C" long long __cdecl _InterlockedExchange64 (volatile long long*,
                                                      long long);
-#      ifndef __INTEL_COMPILER
+#      ifdef _RWSTD_MSVC
 #        pragma intrinsic (_InterlockedIncrement64)
 #        pragma intrinsic (_InterlockedDecrement64)
 #        pragma intrinsic (_InterlockedExchange64)
-#      endif   // __INTEL_COMPILER
+#      endif   // _RWSTD_MSVC
 #    endif   // _M_X64
 #  endif   // _MSC_VER
 
@@ -1242,7 +1242,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (short));
 
-#if defined (_MSC_VER) && _MSC_VER >= 1400 && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedIncrement16 (&__x);
 #else
     return __rw_atomic_add16 (&__x, +1);
@@ -1255,7 +1255,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (unsigned short));
 
-#if defined (_MSC_VER) && _MSC_VER >= 1400 && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedIncrement16 (_RWSTD_REINTERPRET_CAST (short*, &__x));
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (short*, &__x), +1);
@@ -1318,7 +1318,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (short));
 
-#if defined (_MSC_VER) && _MSC_VER >= 1400 && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedDecrement16 (&__x);
 #else
     return __rw_atomic_add16 (&__x, -1);
@@ -1331,7 +1331,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (unsigned short));
 
-#if defined (_MSC_VER) && _MSC_VER >= 1400 && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedDecrement16 (_RWSTD_REINTERPRET_CAST (short*, &__x));
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (short*, &__x), -1);
@@ -1509,7 +1509,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (short));
 
-#if defined (_MSC_VER) && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedIncrement16 (&__x);
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT16_T*, &__x),
@@ -1523,7 +1523,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (unsigned short));
 
-#if defined (_MSC_VER) && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedIncrement16 (_RWSTD_REINTERPRET_CAST (short*, &__x));
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT16_T*, &__x),
@@ -1653,7 +1653,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (short));
 
-#if defined (_MSC_VER) && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedDecrement16 (&__x);
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT16_T*, &__x),
@@ -1667,7 +1667,7 @@
 {
     _RWSTD_COMPILE_ASSERT (2 == sizeof (unsigned short));
 
-#if defined (_MSC_VER) && !defined (__INTEL_COMPILER)
+#if defined (_RWSTD_MSVC) && _RWSTD_MSVC >= 1400
     return _InterlockedDecrement16 (_RWSTD_REINTERPRET_CAST (short*, &__x));
 #else
     return __rw_atomic_add16 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT16_T*, &__x),

Modified: stdcxx/branches/4.2.x/include/string.cc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/string.cc?rev=665734&r1=665733&r2=665734&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/string.cc (original)
+++ stdcxx/branches/4.2.x/include/string.cc Mon Jun  9 09:08:36 2008
@@ -39,7 +39,7 @@
 
 
 #ifndef _RWSTD_NO_STATIC_CONST_MEMBER_INIT
-#  if !defined (_MSC_VER) || _MSC_VER > 1300 || defined (__INTEL_COMPILER)
+#  if !defined (_RWSTD_MSVC) || _RWSTD_MSVC > 1300
    // MSVC 7.0 allows initializers for static const integral members
    // but out-of-line definitions cause multiply defined symbol errors
    // (see PR #26562)

Modified: stdcxx/branches/4.2.x/src/exception.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/exception.cpp?rev=665734&r1=665733&r2=665734&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/exception.cpp (original)
+++ stdcxx/branches/4.2.x/src/exception.cpp Mon Jun  9 09:08:36 2008
@@ -304,15 +304,15 @@
 
 exception::exception (const exception&) _THROWS (())
 {
-#if defined (__INTEL_COMPILER)
-
-    _C_name = "";
-
-#elif defined (_MSC_VER)
+#if defined (_MSC_VER)
 
     _C_name = 0;
     _C_flag = 0;
 
+#elif defined (__INTEL_COMPILER)
+
+    _C_name = "";
+
 #endif   // _MSC_VER
 }
 

Modified: stdcxx/branches/4.2.x/tests/utilities/20.auto.ptr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/utilities/20.auto.ptr.cpp?rev=665734&r1=665733&r2=665734&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/utilities/20.auto.ptr.cpp (original)
+++ stdcxx/branches/4.2.x/tests/utilities/20.auto.ptr.cpp Mon Jun  9 09:08:36 2008
@@ -208,7 +208,7 @@
        // and a conversion operator (see PR #24476)
 #      if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x540
 
-#        if !defined (_MSC_VER) || _MSC_VER > 1310 || defined (__INTEL_COMPILER)
+#        if !defined (_RWSTD_MSVC) || _RWSTD_MSVC > 1310
     FUN (std::auto_ptr_ref<Base>, Derived,
          operator std::auto_ptr_ref<Base>, () _PTR_THROWS (()));