DxLibEx
suffix.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_SUFFIX_HPP_
9 #define DXLE_INC_CONFIG_SUFFIX_HPP_
10 
13 //
14 // DXLE_CONSTEXPR
15 // DXLE_CONSTEXPR_OR_CONST
16 // DXLE_STATIC_CONSTEXPR
17 // DXLE_STATIC_CONSTEXPR_DATA_MEMBER_INNER
18 // DXLE_STATIC_CONSTEXPR_DATA_MEMBER_OUTER
19 //
20 #ifndef DXLE_NO_CXX11_CONSTEXPR
21 # define DXLE_CONSTEXPR constexpr
22 # define DXLE_CONSTEXPR_OR_CONST constexpr
23 # define DXLE_STATIC_CONSTEXPR static constexpr
24 #
25 # define DXLE_STATIC_CONSTEXPR_DATA_MEMBER_INNER(EXPR) = EXPR
26 # define DXLE_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(EXPR)
27 #else // #ifndef DXLE_NO_CXX11_CONSTEXPR
28 # define DXLE_CONSTEXPR
29 # define DXLE_CONSTEXPR_OR_CONST const
30 # define DXLE_STATIC_CONSTEXPR static const
31 #
32 # define DXLE_STATIC_CONSTEXPR_DATA_MEMBER_INNER(EXPR)
33 # define DXLE_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(EXPR) = EXPR
34 #endif // #ifndef DXLE_NO_CXX11_CONSTEXPR
35 
36 //
37 // DXLE_CXX14_CONSTEXPR
38 // DXLE_CXX14_CONSTEXPR_OR_CONST
39 // DXLE_CXX14_STATIC_CONSTEXPR
40 //
41 #ifndef DXLE_NO_CXX14_CONSTEXPR
42 # define DXLE_CXX14_CONSTEXPR DXLE_CONSTEXPR
43 # define DXLE_CXX14_CONSTEXPR_OR_CONST DXLE_CONSTEXPR_OR_CONST
44 # define DXLE_CXX14_STATIC_CONSTEXPR DXLE_STATIC_CONSTEXPR
45 #else // #ifndef DXLE_NO_CXX14_CONSTEXPR
46 # define DXLE_CXX14_CONSTEXPR
47 # define DXLE_CXX14_CONSTEXPR_OR_CONST const
48 # define DXLE_CXX14_STATIC_CONSTEXPR static const
49 # ifndef DXLE_NO_CXX11_CONSTEXPR
50 # define DXLE_SUPPORT_ONLY_CXX11_CONSTEXPR
51 # endif
52 #endif // #ifndef DXLE_NO_CXX14_CONSTEXPR
53 
54 //
55 // DXLE_INITIALIZER_LIST_CONSTEXPR
56 //
57 #ifndef DXLE_NO_CXX14_INITIALIZER_LIST
58 # define DXLE_INITIALIZER_LIST_CONSTEXPR DXLE_CXX14_CONSTEXPR
59 #else // #ifndef DXLE_NO_CXX14_INITIALIZER_LIST
60 # define DXLE_INITIALIZER_LIST_CONSTEXPR
61 #endif // #ifndef DXLE_NO_CXX14_INITIALIZER_LIST
62 
63 
64 //
65 // DXLE_DEPRECATED
66 // DXLE_DEPRECATED_MESSAGE
67 //
68 #ifdef DXLE_NO_CXX14_ATTRIBUTE_DEPRECATED
69 # if defined(__GNUC__) || defined(__clang__)
70 # define DXLE_DEPRECATED __attribute__((deprecated))
71 # ifdef DXLE_HAS_GNU_DEPRECATED_WITH_MESSAGE_SUPPORT
72 # define DXLE_DEPRECATED_MESSAGE(message) __attribute__((deprecated(message)))
73 # endif
74 # elif defined(_MSC_VER)
75 # define DXLE_DEPRECATED __declspec(deprecated)
76 # define DXLE_DEPRECATED_MESSAGE(message) __declspec(deprecated(message))
77 # else
78 # define DXLE_DEPRECATED
79 # endif
80 # ifndef DXLE_DEPRECATED_MESSAGE
81 # deifne DXLE_DEPRECATED_MESSAGE DXLE_DEPRECATED
82 # endif
83 #else
84 # define DXLE_DEPRECATED [[deprecated]]
85 # define DXLE_DEPRECATED_MESSAGE(message) [[deprecated(message)]]
86 #endif
87 
88 //
89 // DXLE_NOEXCEPT
90 // DXLE_NOEXCEPT_OR_NOTHROW
91 //
92 #ifndef DXLE_NO_CXX11_NOEXCEPT
93 # define DXLE_NOEXCEPT noexcept
94 # define DXLE_NOEXCEPT_OR_NOTHROW noexcept
95 #else // #ifndef DXLE_CONFIG_DISABLE_NOEXCEPT
96 # define DXLE_NOEXCEPT
97 # define DXLE_NOEXCEPT_OR_NOTHROW throw()
98 #endif // #ifndef DXLE_CONFIG_DISABLE_NOEXCEPT
99 
100 //
101 // DXLE_NOEXCEPT_IF
102 // DXLE_NOEXCEPT_EXPR
103 // DXLE_NOEXCEPT_EXPR_OR_DEFAULT
104 // DXLE_NOEXCEPT_IF_EXPR
105 //
106 #ifndef DXLE_NO_CXX11_NOEXCEPT_EXPRESSION
107 # define DXLE_NOEXCEPT_IF(COND) noexcept((COND))
108 # define DXLE_NOEXCEPT_EXPR(EXPR) noexcept((EXPR))
109 # define DXLE_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) noexcept((EXPR))
110 # define DXLE_NOEXCEPT_IF_EXPR(EXPR) noexcept(noexcept((EXPR)))
111 #else //DXLE_NO_CXX11_NOEXCEPT_EXPRESSION
112 # define DXLE_NOEXCEPT_IF(COND)
113 # define DXLE_NOEXCEPT_EXPR(EXPR) false
114 # define DXLE_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) C
115 # define DXLE_NOEXCEPT_IF_EXPR(EXPR)
116 #endif //DXLE_NO_CXX11_NOEXCEPT_EXPRESSION
117 
118 //
119 // DXLE_USE_UNICODE_LITERALS
120 //
121 #ifndef DXLE_NO_CXX11_UNICODE_LITERALS
122 # define DXLE_USE_UNICODE_LITERALS 1
123 #else // #ifndef DXLE_CONFIG_DISABLE_UNICODE_LITERALS
124 # define DXLE_USE_UNICODE_LITERALS 0
125 #endif // #ifndef DXLE_CONFIG_DISABLE_UNICODE_LITERALS
126 
127 //
128 // DXLE_REF_QUALIFIERS_LVALUE
129 // DXLE_REF_QUALIFIERS_RVALUE
130 //
131 #ifndef DXLE_NO_CXX11_REF_QUALIFIERS
132 # define DXLE_REF_QUALIFIERS_LVALUE &
133 # define DXLE_REF_QUALIFIERS_RVALUE &&
134 #else
135 # define DXLE_REF_QUALIFIERS_LVALUE
136 # define DXLE_REF_QUALIFIERS_RVALUE
137 #endif
138 
139 //
140 // DXLE_PREVENT_MACRO_SUBSTITUTION
141 //
142 #define DXLE_PREVENT_MACRO_SUBSTITUTION
143 
144 #ifndef DXLE_NO_CXX17_UNUSED
145 # define DXLE_UNUSED [[maybe_unused]]
146 #elif defined(__GNUC__)
147 # ifndef DXLE_NO_CXX11_ATTRIBUTES
148 # define DXLE_UNUSED [[gnu::unused]]
149 # else
150 # define DXLE_UNUSED __attribute__((unused))
151 # endif
152 #else
153 # define DXLE_UNUSED
154 #endif
155 
156 #endif // #ifndef DXLE_INC_CONFIG_SUFFIX_HPP_