-//$$CDS-header$$
-
-#ifndef __CDS_COMPILER_VC_DEFS_H
-#define __CDS_COMPILER_VC_DEFS_H
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSLIB_COMPILER_VC_DEFS_H
+#define CDSLIB_COMPILER_VC_DEFS_H
//@cond
// Compiler version
#define CDS_COMPILER_VERSION _MSC_VER
// Compiler name
-// Supported compilers: MS VC 2013
+// Supported compilers: MS VC 2013 +
// C++ compiler versions:
-#define CDS_COMPILER_MSVC12 1800 // 2013 vc12
+#define CDS_COMPILER_MSVC12 1800 // 2013 vc12
+#define CDS_COMPILER_MSVC14 1900 // 2015 vc14
+#define CDS_COMPILER_MSVC14_1 1910 // 2017 vc14.1
+#define CDS_COMPILER_MSVC14_1_3 1911 // 2017 vc14.1 (VS 15.3)
+#define CDS_COMPILER_MSVC15 2000 // next Visual Studio
#if CDS_COMPILER_VERSION < CDS_COMPILER_MSVC12
-# error "Only MS Visual C++ 12 (2013) and above is supported"
+# error "Only MS Visual C++ 12 (2013) Update 4 and above is supported"
#endif
#if _MSC_VER == 1800
# define CDS_COMPILER__NAME "MS Visual C++ 2013"
# define CDS_COMPILER__NICK "vc12"
+# define CDS_COMPILER_LIBCDS_SUFFIX "vc12"
+#elif _MSC_VER == 1900
+# define CDS_COMPILER__NAME "MS Visual C++ 2015"
+# define CDS_COMPILER__NICK "vc14"
+# define CDS_COMPILER_LIBCDS_SUFFIX "vcv140"
+#elif _MSC_VER < 2000
+# define CDS_COMPILER__NAME "MS Visual C++ 2017"
+# define CDS_COMPILER__NICK "vc141"
+# define CDS_COMPILER_LIBCDS_SUFFIX "vcv141"
#else
# define CDS_COMPILER__NAME "MS Visual C++"
# define CDS_COMPILER__NICK "msvc"
+# define CDS_COMPILER_LIBCDS_SUFFIX "vc"
#endif
// OS interface
#define __attribute__( _x )
-#define CDS_STDCALL __stdcall
-
#ifdef CDS_BUILD_LIB
# define CDS_EXPORT_API __declspec(dllexport)
#else
// constexpr is not yet supported
#define CDS_CONSTEXPR
-#define CDS_CONSTEXPR_CONST const
-
-// noexcept is not yet supported
-//#define CDS_NOEXCEPT_SUPPORT noexcept
-//#define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
-#define CDS_NOEXCEPT_SUPPORT
-#define CDS_NOEXCEPT_SUPPORT_(expr)
-
-// Lambda (VC 10 +)
-//#define CDS_CXX11_LAMBDA_SUPPORT
-
-// RValue (VC 10+)
-#define CDS_RVALUE_SUPPORT
-#define CDS_MOVE_SEMANTICS_SUPPORT
-
-// Default template arguments for function templates (VC12+)
-#define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT
-
-// C++11 delete definition ( function declaration = delete)
-#define CDS_CXX11_DELETE_DEFINITION_SUPPORT
-// C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
-#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-
-// Variadic template support (VC12+)
-#define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1
-
-// C++11 template alias
-#define CDS_CXX11_TEMPLATE_ALIAS_SUPPORT
+// noexcept - vc14 +
+#if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
+# define CDS_NOEXCEPT_SUPPORT noexcept
+# define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
+#else
+# define CDS_NOEXCEPT_SUPPORT
+# define CDS_NOEXCEPT_SUPPORT_(expr)
+#endif
// C++11 inline namespace
-//#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
-
-// Explicit conversion operator (VC12+)
-#define CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT
+#if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
+# define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
+#endif
#if CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12
// VC12: move ctor cannot be defaulted
# define CDS_DISABLE_DEFAULT_MOVE_CTOR
#endif
-// Thread support library (thread, mutex, condition variable)
-#define CDS_CXX11_STDLIB_THREAD
-#define CDS_CXX11_STDLIB_MUTEX
-#define CDS_CXX11_STDLIB_CONDITION_VARIABLE
-#define CDS_CXX11_STDLIB_CHRONO
-
// Full SFINAE support
-//#if CDS_COMPILER_VERSION >= ????
-//# define CDS_CXX11_SFINAE
-//#endif
+#if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
+# define CDS_CXX11_SFINAE
+#endif
+// Inheriting constructors
+#if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
+# define CDS_CXX11_INHERITING_CTOR
+#endif
// *************************************************
// Alignment macro
-#define CDS_TYPE_ALIGNMENT(n) __declspec( align(n) )
-#define CDS_DATA_ALIGNMENT(n) __declspec( align(n) )
-#define CDS_CLASS_ALIGNMENT(n) __declspec( align(n) )
+#define CDS_TYPE_ALIGNMENT(n) __declspec( align(n))
+#define CDS_DATA_ALIGNMENT(n) __declspec( align(n))
+#define CDS_CLASS_ALIGNMENT(n) __declspec( align(n))
+
+// Attributes
+#if CDS_COMPILER_VERSION >= CDS_COMPILER_MSVC14
+# define CDS_DEPRECATED( reason ) [[deprecated( reason )]]
+#else
+# define CDS_DEPRECATED( reason ) __declspec(deprecated( reason ))
+#endif
+
+#define CDS_NORETURN __declspec(noreturn)
+
+// Exceptions
+
+#if defined( _CPPUNWIND )
+# define CDS_EXCEPTION_ENABLED
+#endif
+
+
+// double-width CAS support
+//#define CDS_DCAS_SUPPORT
+
+// Byte order
+// It seems, MSVC works only on little-endian architecture?..
+#if !defined(CDS_ARCH_LITTLE_ENDIAN) && !defined(CDS_ARCH_BIG_ENDIAN)
+# define CDS_ARCH_LITTLE_ENDIAN
+#endif
+
+// Sanitizer attributes (not supported)
+#define CDS_SUPPRESS_SANITIZE( ... )
#include <cds/compiler/vc/compiler_barriers.h>
//@endcond
-#endif // #ifndef __CDS_COMPILER_VC_DEFS_H
+#endif // #ifndef CDSLIB_COMPILER_VC_DEFS_H