DATAKIT API  V2025.2
dtk_compiler_gcc.h
Go to the documentation of this file.
1 #ifndef DTK_COMPILER_GCC_H
2 #define DTK_COMPILER_GCC_H
3 
4 #ifndef __GNUC__
5 This File shouldn't be used with this compiler !!!'
6 #endif
7 
8 //
9 // Define DTK_GCC so we know this is "real" GCC and not some pretender:
10 //
11 #define DTK_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
12 
13 #if !defined(__CUDACC__)
14 #define DTK_GCC DTK_GCC_VERSION
15 #endif
16 
17 //DTK_TOREMOVE_START
18 #ifdef AF51BDA7E49648f8AB95949F4CA52EF8
19 // Calling conventions
20 #define DTK_CDECL __attribute__((cdecl))
21 #define DTK_STDCALL __attribute__((stdcall))
22 #endif
23 //DTK_TOREMOVE_END
24 
25 
26 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
27 # define DTK_GCC_CXX11
28 #endif
29 
30 // C++0x features in 4.3.n and later
31 //
32 #if (DTK_GCC_VERSION >= 40300) && defined(DTK_GCC_CXX11)
33 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
34 // passed on the command line, which in turn defines
35 // __GXX_EXPERIMENTAL_CXX0X__.
36 # define DTK_HAS_STATIC_ASSERT
37 # define DTK_HAS_DECLTYPE
38 # define DTK_HAS_RVALUE_REFS
39 #else
40 # define DTK_NO_CXX11_STATIC_ASSERT
41 # define DTK_NO_CXX11_DECLTYPE
42 # define DTK_NO_CXX11_RVALUE_REFERENCES
43 #endif
44 
45 // C++0x features in 4.4.n and later
46 //
47 #if (DTK_GCC_VERSION < 40400) || !defined(DTK_GCC_CXX11)
48 # define DTK_NO_CXX11_CHAR16_T
49 # define DTK_NO_CXX11_CHAR32_T
50 # define DTK_NO_CXX11_VARIADIC_TEMPLATES
51 # define DTK_NO_CXX11_DELETED_FUNCTIONS
52 #endif
53 
54 // C++0x features in 4.5.0 and later
55 //
56 #if (DTK_GCC_VERSION < 40500) || !defined(DTK_GCC_CXX11)
57 # define DTK_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
58 #endif
59 
60 // C++0x features in 4.6.n and later
61 //
62 #if (DTK_GCC_VERSION < 40600) || !defined(DTK_GCC_CXX11)
63 #define DTK_NO_CXX11_NULLPTR
64 #define DTK_NO_CXX11_NOEXCEPT
65 #define DTK_NO_CXX11_CONSTEXPR
66 #endif
67 
68 //C++14
69 #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
70 # define DTK_NO_CXX14_CONSTEXPR
71 #endif
72 
73 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(DTK_CLANG)
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 //
80 // gcc has "long long"
81 // Except on Darwin with standard compliance enabled (-pedantic)
82 // Apple gcc helpfully defines this macro we can query
83 //
84 #if !defined(__DARWIN_NO_LONG_LONG)
85 # define DTK_HAS_LONG_LONG
86 #endif
87 
88 #endif