DxLibEx
clang.hpp
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (C) 2015-2017 DxLibEx project
3  https://github.com/Nagarei/DxLibEx/
4 
5  Distributed under the Boost Software License, Version 1.0.
6  (See http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 #ifndef DXLE_INC_CONFIG_COMPILER_CLANG_HPP_
9 #define DXLE_INC_CONFIG_COMPILER_CLANG_HPP_
10 
11 /*
12 C++11
13 */
14 #if !__has_feature(cxx_constexpr)
15 # define DXLE_NO_CXX11_CONSTEXPR
16 #endif
17 
18 #if !__has_feature(cxx_noexcept)
19 # define DXLE_NO_CXX11_NOEXCEPT
20 # define DXLE_NO_CXX11_NOEXCEPT_EXPRESSION
21 #endif
22 
23 #if !__has_feature(cxx_unicode_literals)
24 # define DXLE_NO_CXX11_UNICODE_LITERALS
25 #endif
26 
27 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
28 # define DXLE_NO_CXX11_ATTRIBUTES
29 #endif
30 
31 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
32 # define DXLE_NO_CXX11_USER_DEFINED_LITERALS
33 #endif
34 
35 #if __clang_major__ < 2 || (__clang_major__ == 2 && __clang_minor__ < 9)
36 # define DXLE_NO_CXX11_REF_QUALIFIERS
37 #endif
38 
39 /*
40 C++14
41 */
42 #if !__has_feature(cxx_relaxed_constexpr)
43 # define DXLE_NO_CXX14_CONSTEXPR
44 #endif
45 
46 #if !__has_feature(cxx_variable_templates)
47 # define DXLE_NO_CXX14_VARIABLE_TEMPLATES
48 #endif
49 
50 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4)
51 # if __clang_major__ == 3 && __clang_minor__ < 7
52 # if __cplusplus < 201103//clang3.6までは-std=c++11でも使える模様
53 # define DXLE_NO_CXX14_ATTRIBUTE_DEPRECATED
54 # endif
55 # else//warning: use of the 'deprecated' attribute is a C++14 extension [-Wc++14-extensions]
56 # if __cplusplus < 201402//clang3.7からは-std=c++14が必要
57 # define DXLE_NO_CXX14_ATTRIBUTE_DEPRECATED
58 # endif
59 # endif
60 # if __cplusplus < 201305//-std=c++1yが必要
61 # define DXLE_NO_CXX14_UDLS_FOR_STRING_AND_CHRONO
62 # endif
63 #endif
64 
65 /*
66 Proprietary extension
67 */
68 #if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0))
69 # define DXLE_HAS_CONSTEXPR_COPYSIGN_FUNCTION
70 #endif
71 #if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 3))//3.2以前はドキュメントが見つからない
72 #define DXLE_HAS_GNU_DEPRECATED_WITH_MESSAGE_SUPPORT
73 #endif
74 
75 
76 /*
77 C++17
78 */
79 #if __clang_major < 3 || (__clang_major__ == 3 && __clang_minor__ < 9) || !defined(__has_cpp_attribute)
80 # define DXLE_NO_CXX17_UNUSED
81 #elif __has_cpp_attribute(maybe_unused) < 201603
82 # define DXLE_NO_CXX17_UNUSED
83 #endif
84 
85 #endif // #ifndef DXLE_INC_CONFIG_COMPILER_CLANG_HPP_