DATAKIT API  V2025.1
dtk_compiler_clang.h
Go to the documentation of this file.
1 #ifndef DTK_COMPILER_CLANG_H
2 #define DTK_COMPILER_CLANG_H
3 
4 // Macro used to identify the Clang compiler.
5 #define DTK_CLANG 1
6 
7 //DTK_TOREMOVE_START
8 #ifdef AF51BDA7E49648f8AB95949F4CA52EF8
9 // Calling conventions
10 #define DTK_CDECL __cdecl
11 #define DTK_STDCALL __stdcall
12 #endif
13 //DTK_TOREMOVE_END
14 
15 
16 #if !__has_feature(cxx_static_assert)
17 #define DTK_NO_CXX11_STATIC_ASSERT
18 #endif
19 
20 #if !__has_feature(cxx_nullptr)
21 # define DTK_NO_CXX11_NULLPTR
22 #endif
23 
24 #if !__has_feature(cxx_decltype)
25 # define DTK_NO_CXX11_DECLTYPE
26 #endif
27 
28 #if !__has_feature(cxx_variadic_templates)
29 # define DTK_NO_CXX11_VARIADIC_TEMPLATES
30 #endif
31 
32 #if !__has_feature(cxx_rvalue_references)
33 # define DTK_NO_CXX11_RVALUE_REFERENCES
34 #endif
35 
36 #if !__has_feature(cxx_deleted_functions)
37 # define DTK_NO_CXX11_DELETED_FUNCTIONS
38 #endif
39 
40 #if !__has_feature(cxx_noexcept)
41 # define DTK_NO_CXX11_NOEXCEPT
42 #endif
43 
44 #if !__has_feature(cxx_constexpr)
45 # define DTK_NO_CXX11_CONSTEXPR
46 #endif
47 
48 #if !__has_feature(cxx_explicit_conversions)
49 # define DTK_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
50 #endif
51 
52 //C++14 features
53 #if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__)
54 # define DTK_NO_CXX14_CONSTEXPR
55 #endif
56 
57 //
58 // Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t
59 //
60 #if defined(_MSC_VER) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
61 # define DTK_NO_CXX11_CHAR16_T
62 # define DTK_NO_CXX11_CHAR32_T
63 #endif
64 
65 #if defined(DTK_CLANG) && defined(__has_feature)
66 # if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_empty)
67 # define DTK_MOVE_IS_EMPTY(T) __is_empty(T)
68 # endif
69 # if __has_feature(is_union)
70 # define DTK_MOVE_IS_UNION(T) __is_union(T)
71 # endif
72 # if __has_feature(is_enum)
73 # define DTK_MOVE_IS_ENUM(T) __is_enum(T)
74 # endif
75 #endif
76 
77 // Clang supports "long long" in all compilation modes.
78 #define DTK_HAS_LONG_LONG
79 
80 #endif