Go to the documentation of this file.
19 #if defined(__cplusplus)
20 # if (GCC_VERSION_CODE >= 407) || defined(__clang__)
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
31 # error ARB code does not support C++17 standard yet
34 # error Unknown C++ standard defined in __cplusplus
41 # error C compilation includes cxxforward.h
44 #ifndef _GLIBCXX_CSTDDEF
51 #ifdef ARB_ENABLE17_FEATURES
52 # define ARB_ENABLE14_FEATURES
59 #ifdef ARB_ENABLE14_FEATURES
60 # define ARB_ENABLE11_FEATURES
67 # define CONSTEXPR_INLINE_Cxx14 constexpr inline
72 # define CONSTEXPR_INLINE_Cxx14 inline
79 #ifdef ARB_ENABLE11_FEATURES
84 # if (GCC_VERSION_CODE >= 408)
89 # define CONSTEXPR constexpr
90 # define CONSTEXPR_INLINE constexpr inline
93 # define OVERRIDE override
97 # define FINAL_TYPE final
98 # define FINAL_OVERRIDE final override
100 # define NULp nullptr
105 # if (GCC_VERSION_CODE >= 406)
106 # define CONSTEXPR constexpr
108 # define CONSTEXPR const
111 # define CONSTEXPR_INLINE inline
114 # define FINAL_OVERRIDE
124 #if defined(__clang__)
125 # define CONSTEXPR_INLINE_NC inline
127 # define CONSTEXPR_INLINE_NC CONSTEXPR_INLINE
132 #if (GCC_VERSION_CODE >= 700)
133 # define FALLTHROUGH [[gnu::fallthrough]]
141 #if (GCC_VERSION_CODE >= 700)
142 # define UNUSED [[gnu::unused]]
145 # define UNUSED __attribute__((unused))
150 #ifdef SUGGESTS_FINAL
152 # if (GCC_VERSION_CODE >= 900)
154 # define EXTENDED_FINAL_WARNING_SUPPRESSION // gcc 9.1 became too smart (for old suppression methods)
157 namespace final_unsuggest {
struct fakedarg { }; };
158 # define NF_JOIN(X,Y) X##Y
160 # ifdef EXTENDED_FINAL_WARNING_SUPPRESSION
163 # define PREPARE_MARK_NONFINAL_CLASS(CLASS) explicit CLASS(final_unsuggest::fakedarg)
165 # define MARK_NONFINAL_CLASS(BASE) \
166 namespace final_unsuggest { \
167 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
168 NF_JOIN(unfinalize,BASE)() : BASE(final_unsuggest::fakedarg()) {} \
174 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
175 namespace final_unsuggest { \
176 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
177 RETYPE METHOD_NAME PARAMS override { \
187 # if (GCC_VERSION_CODE >= 901) && (GCC_VERSION_CODE <= 905) // (please do not activate for all future versions, test each of them)
188 # define GCC_TOO_SMART_FOR_USEFUL_FINAL_TYPE_SUGGESTION
190 # if (GCC_VERSION_CODE >= 1001) && (GCC_VERSION_CODE <= 1005) // (please do not activate for all future versions, test each of them)
191 # define GCC_TOO_SMART_FOR_USEFUL_FINAL_TYPE_SUGGESTION
194 # else // !EXTENDED_FINAL_WARNING_SUPPRESSION
196 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
197 # define MARK_NONFINAL_CLASS(BASE) \
198 namespace final_unsuggest { \
199 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
204 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
205 namespace final_unsuggest { \
206 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
207 inline RETYPE METHOD_NAME PARAMS override; \
215 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
216 # define MARK_NONFINAL_CLASS(BASE)
217 # define MARK_NONFINAL__INTERNAL(BASE,RETURN_TYPE,METHOD_NAME,PARAMS,RETURN)
222 #define MARK_NONFINAL_DTOR(BASE) MARK_NONFINAL_CLASS(BASE)
225 # define MARK_NONFINAL_FUNCTION(BASE,RETYPE,METHOD_NAME,PARAMS,RETVAL) MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,return RETVAL)
226 # define MARK_NONFINAL_METHOD(BASE,METHOD_NAME,PARAMS) MARK_NONFINAL__INTERNAL(BASE,void,METHOD_NAME,PARAMS,)
229 #undef ARB_ENABLE11_FEATURES
230 #undef ARB_ENABLE14_FEATURES
233 #error cxxforward.h included twice
234 #endif // CXXFORWARD_H