DATAKIT API  V2025.2
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 #ifndef __clang__
5 This File shouldn't be used with this compiler !!!'
6 #endif
7 
8 // Macro used to identify the Clang compiler.
9 #define DTK_CLANG 1
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 #if !__has_feature(cxx_static_assert)
21 #define DTK_NO_CXX11_STATIC_ASSERT
22 #endif
23 
24 #if !__has_feature(cxx_nullptr)
25 # define DTK_NO_CXX11_NULLPTR
26 #endif
27 
28 #if !__has_feature(cxx_decltype)
29 # define DTK_NO_CXX11_DECLTYPE
30 #endif
31 
32 #if !__has_feature(cxx_variadic_templates)
33 # define DTK_NO_CXX11_VARIADIC_TEMPLATES
34 #endif
35 
36 #if !__has_feature(cxx_rvalue_references)
37 # define DTK_NO_CXX11_RVALUE_REFERENCES
38 #endif
39 
40 #if !__has_feature(cxx_deleted_functions)
41 # define DTK_NO_CXX11_DELETED_FUNCTIONS
42 #endif
43 
44 #if !__has_feature(cxx_noexcept)
45 # define DTK_NO_CXX11_NOEXCEPT
46 #endif
47 
48 #if !__has_feature(cxx_constexpr)
49 # define DTK_NO_CXX11_CONSTEXPR
50 #endif
51 
52 #if !__has_feature(cxx_explicit_conversions)
53 # define DTK_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
54 #endif
55 
56 //C++14 features
57 #if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__)
58 # define DTK_NO_CXX14_CONSTEXPR
59 #endif
60 
61 //
62 // Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t
63 //
64 #if defined(_MSC_VER) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
65 # define DTK_NO_CXX11_CHAR16_T
66 # define DTK_NO_CXX11_CHAR32_T
67 #endif
68 
69 #if defined(DTK_CLANG) && defined(__has_feature)
70 # if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_empty)
71 # define DTK_MOVE_IS_EMPTY(T) __is_empty(T)
72 # endif
73 # if __has_feature(is_union)
74 # define DTK_MOVE_IS_UNION(T) __is_union(T)
75 # endif
76 # if __has_feature(is_enum)
77 # define DTK_MOVE_IS_ENUM(T) __is_enum(T)
78 # endif
79 #endif
80 
81 // Clang supports "long long" in all compilation modes.
82 #define DTK_HAS_LONG_LONG
83 
84 #endif