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 # define QI_NORETURN __attribute__((noreturn))
49 #elif defined(_MSC_VER)
50 # define QI_NORETURN __declspec(noreturn)
60 #if defined(__GNUC__) && !defined(__clang__)
61 # define QI_HAS_VARIABLE_LENGTH_ARRAY 1
63 # define QI_HAS_VARIABLE_LENGTH_ARRAY 0
87 #define QI_LIB_API(libname) _QI_LIB_API(BOOST_PP_CAT(libname, _EXPORTS), BOOST_PP_CAT(libname, _STATIC_BUILD))
89 #define _QI_LIB_API(IS_BUILDING_LIB, IS_LIB_STATIC_BUILD) \
90 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)))
106 #if defined _WIN32 || defined __CYGWIN__
107 # define QI_EXPORT_API __declspec(dllexport)
108 # define QI_IMPORT_API __declspec(dllimport)
109 # define QI_LIB_API_NORMALIZED(exporting, isstatic) BOOST_PP_CAT(BOOST_PP_CAT(_QI_LIB_API_NORMALIZED_, exporting), isstatic)
110 # define _QI_LIB_API_NORMALIZED_00 QI_IMPORT_API
111 # define _QI_LIB_API_NORMALIZED_10 QI_EXPORT_API
112 # define _QI_LIB_API_NORMALIZED_11
113 # define _QI_LIB_API_NORMALIZED_01
115 # define QI_EXPORT_API __attribute__ ((visibility("default")))
116 # define QI_IMPORT_API QI_EXPORT_API
117 # define QI_LIB_API_NORMALIZED(a, b) QI_EXPORT_API
119 # define QI_IMPORT_API
120 # define QI_EXPORT_API
121 # define QI_LIB_API_NORMALIZED(a, b)
127 #if defined(_MSC_VER)
128 #define QI_DO_PRAGMA(x) __pragma(x)
129 #define __ALSTR2__(x) #x
130 #define __ALSTR1__(x) __ALSTR2__(x)
131 #define _ALMSVCLOC_ __FILE__ "("__ALSTR1__(__LINE__)") : "
132 #define QI_MSG_PRAGMA(_msg) QI_DO_PRAGMA(message (_ALMSVCLOC_ _msg))
133 #elif defined(__GNUC__)
134 #define QI_DO_PRAGMA(x) _Pragma (#x)
135 #define QI_MSG_PRAGMA(_msg) QI_DO_PRAGMA(message (_msg))
137 #define QI_DO_PRAGMA(x)
138 #define QI_MSG_PRAGMA(_msg)
148 #if defined(QI_NO_COMPILER_WARNING)
149 # define QI_COMPILER_WARNING(x)
151 # define QI_COMPILER_WARNING(x) QI_MSG_PRAGMA("Warning: " #x)
159 #if !defined(WITH_DEPRECATED) || defined(QI_NO_DEPRECATED_HEADER)
160 # define QI_DEPRECATED_HEADER(x)
162 # define QI_DEPRECATED_HEADER(x) QI_MSG_PRAGMA("\
163 This file includes at least one deprecated or antiquated ALDEBARAN header \
164 which may be removed without further notice in the next version. \
165 Please consult the changelog for details. " #x)
171 template <
typename T>
188 #define QI_DEPRECATE_MACRO(name) \
189 QI_COMPILER_WARNING(name macro is deprecated.)
222 #define QI_DISALLOW_COPY_AND_ASSIGN(type) \
223 QI_DEPRECATE_MACRO(QI_DISALLOW_COPY_AND_ASSIGN) \
224 type(type const &); \
225 void operator=(type const &); \
226 typedef int _qi_not_clonable; \
227 template<typename U> friend struct ::qi::IsClonable
234 #if defined(__GNUC__)
235 # define QI_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
237 # define QI_WARN_UNUSED_RESULT
244 #if defined(__GNUC__)
245 # define QI_ATTR_UNUSED __attribute__((unused))
247 # define QI_ATTR_UNUSED
271 #define _QI_UNIQ_DEF_LEVEL2(A, B) A ## __uniq__ ## B
272 #define _QI_UNIQ_DEF_LEVEL1(A, B) _QI_UNIQ_DEF_LEVEL2(A, B)
273 #define QI_UNIQ_DEF(A) _QI_UNIQ_DEF_LEVEL1(A, __LINE__)
275 #if (!defined(__GNUC__) || defined(__clang__) || \
276 (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7)) && __cplusplus >= 201103L
282 # define QI_CXX11_ENABLED 1
289 #ifdef QI_CXX11_ENABLED
290 # define QI_NOEXCEPT(cond) noexcept(cond)
292 # define QI_NOEXCEPT(cond)
295 #endif // _QI_MACRO_HPP_