diff options
Diffstat (limited to 'cmake/modulecppexports.h.in')
-rw-r--r-- | cmake/modulecppexports.h.in | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/cmake/modulecppexports.h.in b/cmake/modulecppexports.h.in index a2c2155720..4d41a3a2a2 100644 --- a/cmake/modulecppexports.h.in +++ b/cmake/modulecppexports.h.in @@ -4,7 +4,9 @@ #ifndef @header_base_name_upper@_H #define @header_base_name_upper@_H -#include <QtCore/qglobal.h> +#include <QtCore/qcompilerdetection.h> +#include <QtCore/qtconfigmacros.h> // Q_@module_define_infix@_EXPORT +#include <QtCore/qtdeprecationmarkers.h> // QT_IF_DEPRECATED_SINCE #if defined(QT_SHARED) || !defined(QT_STATIC) # if defined(QT_BUILD_@module_define_infix@_LIB) @@ -16,18 +18,27 @@ # define Q_@module_define_infix@_EXPORT #endif -#if !defined(QT_BUILD_@module_define_infix@_LIB) || defined(QT_STATIC) -/* outside library → inline decl + defi */ +#if !defined(QT_BUILD_@module_define_infix@_LIB) && !defined(QT_STATIC) +/* outside library -> inline decl + defi */ +/* static builds treat everything as part of the library, so they never inline */ # define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline # define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1 #elif defined(QT_@module_define_infix@_BUILD_REMOVED_API) -/* inside library, inside removed_api.cpp → non-inline decl, defi */ -# define QT_@module_define_infix@_INLINE_SINCE(major, minor) /* not inline */ +/* inside library, inside removed_api.cpp: + * keep deprecated API -> non-inline decl; + * remove deprecated API -> inline decl; + * definition is always available */ +# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \ + QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) # define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1 #else -/* inside library, outside removed_api.cpp → non-inline decl, no defi */ -# define QT_@module_define_infix@_INLINE_SINCE(major, minor) /* not inline */ -# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 0 +/* inside library, outside removed_api.cpp: + * keep deprecated API -> non-inline decl, no defi; + * remove deprecated API -> inline decl, defi */ +# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \ + QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) +# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) \ + QT_IF_DEPRECATED_SINCE(major, minor, 1, 0) #endif #ifdef QT_@module_define_infix@_BUILD_REMOVED_API |