Go to the documentation of this file.
24 #ifndef _QI_MACRO_HPP_
25 # define _QI_MACRO_HPP_
34 #if defined(__GNUC__) && !defined(QI_NO_API_DEPRECATED)
35 # define QI_API_DEPRECATED __attribute__((deprecated))
36 #elif defined(_MSC_VER) && !defined(QI_NO_API_DEPRECATED)
37 # define QI_API_DEPRECATED __declspec(deprecated)
39 # define QI_API_DEPRECATED
48 #if defined(__GNUC__) && !defined(QI_NO_API_DEPRECATED)
49 # define QI_API_DEPRECATED_MSG(msg__) __attribute__((deprecated(#msg__)))
50 #elif defined(_MSC_VER) && !defined(QI_NO_API_DEPRECATED)
51 # define QI_API_DEPRECATED_MSG(msg__) __declspec(deprecated(#msg__))
53 # define QI_API_DEPRECATED_MSG(msg__)
61 # define QI_NORETURN __attribute__((noreturn))
62 #elif defined(_MSC_VER)
63 # define QI_NORETURN __declspec(noreturn)
73 #if defined(__GNUC__) && !defined(__clang__)
74 # define QI_HAS_VARIABLE_LENGTH_ARRAY 1
76 # define QI_HAS_VARIABLE_LENGTH_ARRAY 0
100 #define QI_LIB_API(libname) _QI_LIB_API(BOOST_PP_CAT(libname, _EXPORTS), BOOST_PP_CAT(libname, _STATIC_BUILD))
102 #define _QI_LIB_API(IS_BUILDING_LIB, IS_LIB_STATIC_BUILD) \
103 QI_LIB_API_NORMALIZED(_QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_ , IS_BUILDING_LIB)), _QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_, IS_LIB_STATIC_BUILD)))
119 #if defined _WIN32 || defined __CYGWIN__
120 # define QI_EXPORT_API __declspec(dllexport)
121 # define QI_IMPORT_API __declspec(dllimport)
122 # define QI_LIB_API_NORMALIZED(exporting, isstatic) BOOST_PP_CAT(BOOST_PP_CAT(_QI_LIB_API_NORMALIZED_, exporting), isstatic)
123 # define _QI_LIB_API_NORMALIZED_00 QI_IMPORT_API
124 # define _QI_LIB_API_NORMALIZED_10 QI_EXPORT_API
125 # define _QI_LIB_API_NORMALIZED_11
126 # define _QI_LIB_API_NORMALIZED_01
128 # define QI_EXPORT_API __attribute__ ((visibility("default")))
129 # define QI_IMPORT_API QI_EXPORT_API
130 # define QI_LIB_API_NORMALIZED(a, b) QI_EXPORT_API
132 # define QI_IMPORT_API
133 # define QI_EXPORT_API
134 # define QI_LIB_API_NORMALIZED(a, b)
140 #if defined(_MSC_VER)
141 #define QI_DO_PRAGMA(x) __pragma(x)
142 #define __ALSTR2__(x) #x
143 #define __ALSTR1__(x) __ALSTR2__(x)
144 #define _ALMSVCLOC_ __FILE__ "("__ALSTR1__(__LINE__)") : "
145 #define QI_MSG_PRAGMA(_msg) QI_DO_PRAGMA(message (_ALMSVCLOC_ _msg))
146 #elif defined(__GNUC__)
147 #define QI_DO_PRAGMA(x) _Pragma (#x)
148 #define QI_MSG_PRAGMA(_msg) QI_DO_PRAGMA(message (_msg))
150 #define QI_DO_PRAGMA(x)
151 #define QI_MSG_PRAGMA(_msg)
161 #if defined(QI_NO_COMPILER_WARNING)
162 # define QI_COMPILER_WARNING(x)
164 # define QI_COMPILER_WARNING(x) QI_MSG_PRAGMA("Warning: " #x)
172 #if !defined(WITH_DEPRECATED) || defined(QI_NO_DEPRECATED_HEADER)
173 # define QI_DEPRECATED_HEADER(x)
175 # define QI_DEPRECATED_HEADER(x) QI_MSG_PRAGMA("\
176 This file includes at least one deprecated or antiquated ALDEBARAN header \
177 which may be removed without further notice in the next version. \
178 Please consult the changelog for details. " #x)
184 template <
typename T>
201 #define QI_DEPRECATE_MACRO(name) \
202 QI_COMPILER_WARNING(name macro is deprecated.)
235 #define QI_DISALLOW_COPY_AND_ASSIGN(type) \
236 QI_DEPRECATE_MACRO(QI_DISALLOW_COPY_AND_ASSIGN) \
237 type(type const &); \
238 void operator=(type const &); \
239 using _qi_not_clonable = int; \
240 template<typename U> friend struct ::qi::IsClonable
247 #if defined(__GNUC__)
248 # define QI_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
250 # define QI_WARN_UNUSED_RESULT
257 #if defined(__GNUC__)
258 # define QI_ATTR_UNUSED __attribute__((unused))
260 # define QI_ATTR_UNUSED
284 #define _QI_UNIQ_DEF_LEVEL2(A, B) A ## __uniq__ ## B
285 #define _QI_UNIQ_DEF_LEVEL1(A, B) _QI_UNIQ_DEF_LEVEL2(A, B)
286 #define QI_UNIQ_DEF(A) _QI_UNIQ_DEF_LEVEL1(A, __LINE__)
288 #if (!defined(__GNUC__) || defined(__clang__) || \
289 (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7)) && __cplusplus >= 201103L
295 # define QI_CXX11_ENABLED 1
302 #ifdef QI_CXX11_ENABLED
303 # define QI_NOEXCEPT(cond) noexcept(cond)
305 # define QI_NOEXCEPT(cond)
308 #endif // _QI_MACRO_HPP_