DATAKIT API  V2025.1
dtk_compiler_msvc.h
Go to the documentation of this file.
1 #ifndef DTK_COMPILER_MSVC_H
2 #define DTK_COMPILER_MSVC_H
3 
4 
5 #define DTK_MSVC _MSC_VER
6 
7 #ifndef _NATIVE_WCHAR_T_DEFINED
8 # define DTK_NO_INTRINSIC_WCHAR_T
9 #endif
10 
11 //DTK_TOREMOVE_START
12 #ifdef AF51BDA7E49648f8AB95949F4CA52EF8
13 // Calling conventions
14 #define DTK_CDECL __cdecl
15 #define DTK_STDCALL __stdcall
16 #endif
17 //DTK_TOREMOVE_END
18 
19 //
20 // C++0x features
21 //
22 
23 // C++ features supported by VC++ 10 (aka 2010)
24 //
25 #if _MSC_VER < 1600
26 # define DTK_NO_CXX11_STATIC_ASSERT
27 # define DTK_NO_CXX11_NULLPTR
28 # define DTK_NO_CXX11_RVALUE_REFERENCES
29 # define DTK_NO_CXX11_DECLTYPE
30 #endif // _MSC_VER < 1600
31 
32 // C++11 features supported by VC++ 12 (aka 2013).
33 //
34 #if _MSC_FULL_VER < 180020827
35 # define DTK_NO_CXX11_VARIADIC_TEMPLATES
36 # define DTK_NO_CXX11_DELETED_FUNCTIONS
37 # define DTK_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
38 #endif
39 
40 // C++11 features supported by VC++ 14 (aka 2015) Preview
41 //
42 #if (_MSC_FULL_VER < 190023026)
43 # define DTK_NO_CXX11_CHAR16_T
44 # define DTK_NO_CXX11_CHAR32_T
45 # define DTK_NO_CXX11_NOEXCEPT
46 #endif
47 
48 // This is somewhat supported in VC14, but we may need to wait for
49 // a service release before enabling:
50 //
51 #define DTK_NO_CXX11_CONSTEXPR
52 
53 //C++14
54 #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
55 # define DTK_NO_CXX14_CONSTEXPR
56 #endif
57 
58 #if defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)
59 # define DTK_HAS_LONG_LONG
60 #else
61 # define DTK_NO_LONG_LONG
62 #endif
63 
64 //
65 // Helper macro DTK_MSVC_FULL_VER for use in code:
66 //
67 #if _MSC_FULL_VER > 100000000
68 # define DTK_MSVC_FULL_VER _MSC_FULL_VER
69 #else
70 # define DTK_MSVC_FULL_VER (_MSC_FULL_VER * 10)
71 #endif
72 
73 #if (defined(DTK_MSVC) && defined(DTK_MSVC_FULL_VER) && (DTK_MSVC_FULL_VER >=140050215))
74 # define DTK_MOVE_IS_EMPTY(T) __is_empty(T)
75 # define DTK_MOVE_IS_UNION(T) __is_union(T)
76 # define DTK_MOVE_IS_ENUM(T) __is_enum(T)
77 #endif
78 
79 #endif