3 #ifndef __CDS_COMPILER_VC_DEFS_H
4 #define __CDS_COMPILER_VC_DEFS_H
8 #define CDS_COMPILER_VERSION _MSC_VER
11 // Supported compilers: MS VC 2013
12 // C++ compiler versions:
13 #define CDS_COMPILER_MSVC12 1800 // 2013 vc12
15 #if CDS_COMPILER_VERSION < CDS_COMPILER_MSVC12
16 # error "Only MS Visual C++ 12 (2013) and above is supported"
20 # define CDS_COMPILER__NAME "MS Visual C++ 2013"
21 # define CDS_COMPILER__NICK "vc12"
23 # define CDS_COMPILER__NAME "MS Visual C++"
24 # define CDS_COMPILER__NICK "msvc"
28 #define CDS_OS_INTERFACE CDS_OSI_WINDOWS
32 # define CDS_OS_TYPE CDS_OS_WIN64
33 # define CDS_OS__NAME "Win64"
34 # define CDS_OS__NICK "Win64"
36 # define CDS_OS_TYPE CDS_OS_WIN32
37 # define CDS_OS__NAME "Win32"
38 # define CDS_OS__NICK "Win32"
41 // Processor architecture
43 # define CDS_BUILD_BITS 32
44 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_X86
45 # define CDS_PROCESSOR__NAME "Intel x86"
46 # define CDS_PROCESSOR__NICK "x86"
48 # define CDS_BUILD_BITS 64
49 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_AMD64
50 # define CDS_PROCESSOR__NAME "AMD64"
51 # define CDS_PROCESSOR__NICK "amd64"
53 # define CDS_BUILD_BITS -1
54 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_UNKNOWN
55 # define CDS_PROCESSOR__NAME "<<Undefined>>"
56 # error Microsoft Visual C++ compiler is supported for x86 only
59 #define __attribute__( _x )
61 #define CDS_STDCALL __stdcall
64 # define CDS_EXPORT_API __declspec(dllexport)
66 # define CDS_EXPORT_API __declspec(dllimport)
69 #define alignof __alignof
71 // Memory leaks detection (debug build only)
73 # define _CRTDBG_MAP_ALLOC
74 # define _CRTDBG_MAPALLOC
77 # define CDS_MSVC_MEMORY_LEAKS_DETECTING_ENABLED
80 // constexpr is not yet supported
82 #define CDS_CONSTEXPR_CONST const
84 // noexcept is not yet supported
85 //#define CDS_NOEXCEPT_SUPPORT noexcept
86 //#define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
87 #define CDS_NOEXCEPT_SUPPORT
88 #define CDS_NOEXCEPT_SUPPORT_(expr)
91 #define CDS_CXX11_LAMBDA_SUPPORT
94 #define CDS_RVALUE_SUPPORT
95 #define CDS_MOVE_SEMANTICS_SUPPORT
97 // Default template arguments for function templates (VC12+)
98 #define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT
100 // C++11 delete definition ( function declaration = delete)
101 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
103 // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
104 #define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
106 // Variadic template support (VC12+)
107 #define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT 1
109 // C++11 inline namespace
110 //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
112 // Explicit conversion operator (VC12+)
113 #define CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT
115 #if CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12
116 // VC12: move ctor cannot be defaulted
117 // Error: C2610 [move ctor] is not a special member function which can be defaulted
118 # define CDS_DISABLE_DEFAULT_MOVE_CTOR
121 // Full SFINAE support
122 //#if CDS_COMPILER_VERSION >= ????
123 //# define CDS_CXX11_SFINAE
127 // *************************************************
130 #define CDS_TYPE_ALIGNMENT(n) __declspec( align(n) )
131 #define CDS_DATA_ALIGNMENT(n) __declspec( align(n) )
132 #define CDS_CLASS_ALIGNMENT(n) __declspec( align(n) )
134 #include <cds/compiler/vc/compiler_barriers.h>
137 #endif // #ifndef __CDS_COMPILER_VC_DEFS_H