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
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
126 #if (GCC_VERSION_CODE >= 700)
127 # define FALLTHROUGH [[gnu::fallthrough]]
135 #if (GCC_VERSION_CODE >= 700)
136 # define UNUSED [[gnu::unused]]
139 # define UNUSED __attribute__((unused))
144 #ifdef SUGGESTS_FINAL
146 # if (GCC_VERSION_CODE >= 900)
148 # define EXTENDED_FINAL_WARNING_SUPPRESSION // gcc 9.1 became too smart (for old suppression methods)
151 namespace final_unsuggest {
struct fakedarg { }; };
152 # define NF_JOIN(X,Y) X##Y
154 # ifdef EXTENDED_FINAL_WARNING_SUPPRESSION
157 # define PREPARE_MARK_NONFINAL_CLASS(CLASS) explicit CLASS(final_unsuggest::fakedarg)
159 # define MARK_NONFINAL_CLASS(BASE) \
160 namespace final_unsuggest { \
161 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
162 NF_JOIN(unfinalize,BASE)() : BASE(final_unsuggest::fakedarg()) {} \
168 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
169 namespace final_unsuggest { \
170 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
171 RETYPE METHOD_NAME PARAMS override { \
181 # if (GCC_VERSION_CODE >= 901) && (GCC_VERSION_CODE <= 905) // (please do not activate for all future versions, test each of them)
182 # define GCC_TOO_SMART_FOR_USEFUL_FINAL_TYPE_SUGGESTION
184 # if (GCC_VERSION_CODE >= 1001) && (GCC_VERSION_CODE <= 1005) // (please do not activate for all future versions, test each of them)
185 # define GCC_TOO_SMART_FOR_USEFUL_FINAL_TYPE_SUGGESTION
188 # else // !EXTENDED_FINAL_WARNING_SUPPRESSION
190 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
191 # define MARK_NONFINAL_CLASS(BASE) \
192 namespace final_unsuggest { \
193 struct UNUSED NF_JOIN(unfinalize,BASE) final : BASE { \
198 # define MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,RETURN) \
199 namespace final_unsuggest { \
200 struct UNUSED NF_JOIN(BASE,METHOD_NAME) final : BASE { \
201 inline RETYPE METHOD_NAME PARAMS override; \
209 # define PREPARE_MARK_NONFINAL_CLASS(CLASS)
210 # define MARK_NONFINAL_CLASS(BASE)
211 # define MARK_NONFINAL__INTERNAL(BASE,RETURN_TYPE,METHOD_NAME,PARAMS,RETURN)
216 #define MARK_NONFINAL_DTOR(BASE) MARK_NONFINAL_CLASS(BASE)
219 # define MARK_NONFINAL_FUNCTION(BASE,RETYPE,METHOD_NAME,PARAMS,RETVAL) MARK_NONFINAL__INTERNAL(BASE,RETYPE,METHOD_NAME,PARAMS,return RETVAL)
220 # define MARK_NONFINAL_METHOD(BASE,METHOD_NAME,PARAMS) MARK_NONFINAL__INTERNAL(BASE,void,METHOD_NAME,PARAMS,)
223 #undef ARB_ENABLE11_FEATURES
224 #undef ARB_ENABLE14_FEATURES
227 #error cxxforward.h included twice
228 #endif // CXXFORWARD_H