Add support for Intel C++ compiler for Linux (icc 15)
[libcds.git] / cds / details / defs.h
index 92d9c6aba562b1393192db6e526de23ac77ad866..ff482c1787248ed49b227d28acb756338eb927c1 100644 (file)
@@ -34,7 +34,7 @@
    schema used. However, any implementation supports common interface for the type of data structure.
 
    To implement any lock-free data structure, two things are needed:
-   - atomic operation library conforming with C++11 memory model. The <b>libcds</b> has such feature, see cds::cxx11_atomics namespace for
+   - atomic operation library conforming with C++11 memory model. The <b>libcds</b> has such feature, see cds::cxx11_atomic namespace for
      details and compiler-specific information.
    - safe memory reclamation (SMR) or garbage collecting (GC) algorithm. The <b>libcds</b> has an implementation of several
      well-known SMR algos, see below.
@@ -320,10 +320,10 @@ namespace cds {}
 // CDS_VERIFY: Debug - assert(_expr); Release - _expr
 #ifdef CDS_DEBUG
 #   define CDS_VERIFY( _expr )    assert( _expr )
-#   define CDS_DEBUG_DO( _expr )        _expr
+#   define CDS_DEBUG_ONLY( _expr )        _expr
 #else
 #   define CDS_VERIFY( _expr )    _expr
-#   define CDS_DEBUG_DO( _expr )
+#   define CDS_DEBUG_ONLY( _expr )
 #endif
 
 #ifdef CDS_STRICT
@@ -335,24 +335,9 @@ namespace cds {}
 
 // Compiler-specific defines
 #include <cds/compiler/defs.h>
-// New C++11 features
-#include <cds/details/cxx11_features.h>
 
 #define CDS_NOEXCEPT            CDS_NOEXCEPT_SUPPORT
 #define CDS_NOEXCEPT_( expr )   CDS_NOEXCEPT_SUPPORT_( expr )
-#ifndef CDS_NOEXCEPT_DEFAULTED
-    // Some compilers do not allow noexcept specification in defaulted function
-    // For example, GCC 4.6.x raise following error:
-    //  void foo() noexcept = default
-    //  error: function \91foo\92 defaulted on its first declaration must not have an exception-specification
-    // For such compiler empty CDS_NOEXCEPT_DEFAULTED must be defined
-#   define CDS_NOEXCEPT_DEFAULTED         CDS_NOEXCEPT
-#   define CDS_NOEXCEPT_DEFAULTED_(expr)  CDS_NOEXCEPT_( expr )
-#endif
-
-#if defined(CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT) && defined(CDS_MOVE_SEMANTICS_SUPPORT)
-#   define CDS_EMPLACE_SUPPORT
-#endif
 
 #ifdef CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 #   define CDS_CXX11_INLINE_NAMESPACE   inline
@@ -408,8 +393,6 @@ namespace cds {
  Common things
 **************************************************************************/
 
-#include <cds/numtraits.h>
-
 namespace cds {
 
     /// Base of all exceptions in the library
@@ -464,39 +447,6 @@ namespace cds {
 } // namespace cds
 
 
-/// @defgroup cds_cxx11_stdlib_wrapper New C++11 standard library support
-
-/// C++11 standard library wrapper namespace
-/** @ingroup cds_cxx11_stdlib_wrapper
-    libcds needs support from new features defined in C++11 standard library.
-    In case when an old compiler and corresponding \p std library has no required feature
-    the \p boost library is used if possible. The \p %cds_std namespace is a wrapper for new C++11 stdlib classes:
-    - if the compiler supports new feature, this feature places (with \p using directive) into \p %cds_std namespace "as is"
-    - otherwise the \p boost analog is used and it places into \p %cds_std namespace too
-
-    For example, for class \p std::mutex the \p libcds does the following:
-    - for old compiler: \code
-        #include <boost/thread/mutex.hpp>
-        namespace cds_std {
-            using boost::mutex;
-        }
-        \endcode
-    - for C++11-ready compiler: \code
-        #include <mutex>
-        namespace cds_std {
-            using std::mutex;
-        }
-        \endcode
-
-        Everywhere in \p libcds the class \p %cds_std::mutex is used instead of \p std::mutex.
-
-        Note, not all C++11 features are contained in \p %cds_std but only required by \p libcds.
-
-        In future when all compilers will be C++11-ready we can transform the \p libcds
-        to new C++11 standard library changing \p %cds_std namespace to native \p std.
-*/
-namespace cds_std {}
-
 //@cond
 #ifdef _DEBUG
 #   define cds_assert(X)    assert(X)
@@ -506,7 +456,7 @@ namespace cds_std {}
     {
         if ( !bCond ) {
             char buf[4096];
-#   if CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL
+#   if CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CS_OSI_WINDOWS)
             _snprintf_s( buf, sizeof(buf)/sizeof(buf[0]), _TRUNCATE, pszMsg, pszFile, nLine );
 #   else
             snprintf( buf, sizeof(buf)/sizeof(buf[0]), pszMsg, pszFile, nLine );