Go to the documentation of this file.
19 #if defined(__cplusplus)
20 # if (GCC_VERSION_CODE >= 407)
21 # if (__cplusplus == 199711L)
23 # if (__cplusplus == 201103L)
24 # define ARB_ENABLE11_FEATURES
26 # if (__cplusplus == 201402L)
27 # define ARB_ENABLE14_FEATURES
29 # if (__cplusplus == 201703L)
30 # define ARB_ENABLE17_FEATURES
32 # error Unknown C++ standard defined in __cplusplus
39 # error C compilation includes cxxforward.h
42 #ifndef _GLIBCXX_CSTDDEF
49 #ifdef ARB_ENABLE17_FEATURES
50 # define ARB_ENABLE14_FEATURES
57 #ifdef ARB_ENABLE14_FEATURES
58 # define ARB_ENABLE11_FEATURES
65 # define CONSTEXPR_INLINE_Cxx14 constexpr inline
70 # define CONSTEXPR_INLINE_Cxx14 inline
77 #ifdef ARB_ENABLE11_FEATURES
82 # if (GCC_VERSION_CODE >= 408)
87 # define CONSTEXPR constexpr
88 # define CONSTEXPR_INLINE constexpr inline
91 # define OVERRIDE override
95 # define FINAL_TYPE final
96 # define FINAL_OVERRIDE final override
103 # if (GCC_VERSION_CODE >= 406)
104 # define CONSTEXPR constexpr
106 # define CONSTEXPR const
109 # define CONSTEXPR_INLINE inline
112 # define FINAL_OVERRIDE
124 #if (GCC_VERSION_CODE >= 700)
125 # define FALLTHROUGH [[gnu::fallthrough]]
133 #if (GCC_VERSION_CODE >= 700)
134 # define UNUSED [[gnu::unused]]
137 # define UNUSED __attribute__((unused))
142 #ifdef SUGGESTS_FINAL
144 # if (GCC_VERSION_CODE >= 900)
146 # define EXTENDED_FINAL_WARNING_SUPPRESSION // gcc 9.1 became too smart (for old suppression methods)
149 namespace final_unsuggest {
struct fakedarg { }; };
150 # define NF_JOIN(X,Y) X##Y
152 # ifdef EXTENDED_FINAL_WARNING_SUPPRESSION
155 # define PREPARE_MARK_NONFINAL_CLASS(CLASS) explicit CLASS(final_unsuggest::fakedarg)
157 # define MARK_NONFINAL_CLASS(BASE) \
158 namespace final_unsuggest { \
159 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
160 NF_JOIN(unfinalize,BASE)() : BASE(final_unsuggest::fakedarg()) {} \
166 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
167 namespace final_unsuggest { \
168 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
169 RETYPE METHOD_NAME PARAMS override { \
175 # if (GCC_VERSION_CODE >= 901) && (GCC_VERSION_CODE <= 903) // (please do not activate for all future versions, test each of them)
178 # define GCC_TOO_SMART_FOR_USEFUL_FINAL_TYPE_SUGGESTION
181 # else // !EXTENDED_FINAL_WARNING_SUPPRESSION
183 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
184 # define MARK_NONFINAL_CLASS(BASE) \
185 namespace final_unsuggest { \
186 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
191 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
192 namespace final_unsuggest { \
193 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
194 inline RETYPE METHOD_NAME PARAMS override; \
202 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
203 # define MARK_NONFINAL_CLASS(BASE)
204 # define MARK_NONFINAL__INTERNAL(BASE,RETURN_TYPE,METHOD_NAME,PARAMS,RETURN)
209 #define MARK_NONFINAL_DTOR(BASE) MARK_NONFINAL_CLASS(BASE)
212 # define MARK_NONFINAL_FUNCTION(BASE,RETYPE,METHOD_NAME,PARAMS,RETVAL) MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,return RETVAL)
213 # define MARK_NONFINAL_METHOD(BASE,METHOD_NAME,PARAMS) MARK_NONFINAL__INTERNAL(BASE,void,METHOD_NAME,PARAMS,)
216 #undef ARB_ENABLE11_FEATURES
217 #undef ARB_ENABLE14_FEATURES
220 #error cxxforward.h included twice
221 #endif // CXXFORWARD_H