3 #ifndef CDSLIB_COMPILER_VC_DEFS_H
4 #define CDSLIB_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
14 #define CDS_COMPILER_MSVC14 1900 // 2015 vc14
16 #if CDS_COMPILER_VERSION < CDS_COMPILER_MSVC12
17 # error "Only MS Visual C++ 12 (2013) Update 4 and above is supported"
21 # define CDS_COMPILER__NAME "MS Visual C++ 2013"
22 # define CDS_COMPILER__NICK "vc12"
23 #elif _MSC_VER == 1900
24 # define CDS_COMPILER__NAME "MS Visual C++ 2015"
25 # define CDS_COMPILER__NICK "vc14"
27 # define CDS_COMPILER__NAME "MS Visual C++"
28 # define CDS_COMPILER__NICK "msvc"
32 #define CDS_OS_INTERFACE CDS_OSI_WINDOWS
36 # define CDS_OS_TYPE CDS_OS_WIN64
37 # define CDS_OS__NAME "Win64"
38 # define CDS_OS__NICK "Win64"
40 # define CDS_OS_TYPE CDS_OS_WIN32
41 # define CDS_OS__NAME "Win32"
42 # define CDS_OS__NICK "Win32"
45 // Processor architecture
47 # define CDS_BUILD_BITS 32
48 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_X86
49 # define CDS_PROCESSOR__NAME "Intel x86"
50 # define CDS_PROCESSOR__NICK "x86"
52 # define CDS_BUILD_BITS 64
53 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_AMD64
54 # define CDS_PROCESSOR__NAME "AMD64"
55 # define CDS_PROCESSOR__NICK "amd64"
57 # define CDS_BUILD_BITS -1
58 # define CDS_PROCESSOR_ARCH CDS_PROCESSOR_UNKNOWN
59 # define CDS_PROCESSOR__NAME "<<Undefined>>"
60 # error Microsoft Visual C++ compiler is supported for x86 only
63 #define __attribute__( _x )
65 #define CDS_STDCALL __stdcall
68 # define CDS_EXPORT_API __declspec(dllexport)
70 # define CDS_EXPORT_API __declspec(dllimport)
73 #define alignof __alignof
75 // Memory leaks detection (debug build only)
77 # define _CRTDBG_MAP_ALLOC
78 # define _CRTDBG_MAPALLOC
81 # define CDS_MSVC_MEMORY_LEAKS_DETECTING_ENABLED
84 // constexpr is not yet supported
88 #if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
89 # define CDS_NOEXCEPT_SUPPORT noexcept
90 # define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
92 # define CDS_NOEXCEPT_SUPPORT
93 # define CDS_NOEXCEPT_SUPPORT_(expr)
96 // C++11 inline namespace
97 #if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
98 # define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
101 #if CDS_COMPILER_VERSION == CDS_COMPILER_MSVC12
102 // VC12: move ctor cannot be defaulted
103 // Error: C2610 [move ctor] is not a special member function which can be defaulted
104 # define CDS_DISABLE_DEFAULT_MOVE_CTOR
107 // Full SFINAE support
108 #if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
109 # define CDS_CXX11_SFINAE
112 // Inheriting constructors
113 #if CDS_COMPILER_VERSION > CDS_COMPILER_MSVC12
114 # define CDS_CXX11_INHERITING_CTOR
117 // *************************************************
120 #define CDS_TYPE_ALIGNMENT(n) __declspec( align(n) )
121 #define CDS_DATA_ALIGNMENT(n) __declspec( align(n) )
122 #define CDS_CLASS_ALIGNMENT(n) __declspec( align(n) )
124 #include <cds/compiler/vc/compiler_barriers.h>
127 #endif // #ifndef CDSLIB_COMPILER_VC_DEFS_H