diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2022-07-19 15:07:06 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-07-22 20:26:56 +0200 |
commit | 5a5bc86028b2967ffccf151a9463459e67b96a8b (patch) | |
tree | 2de5a9655160ad5f5cf92485a2439d00a8b426cc /cmake/modulecppexports.h.in | |
parent | 45501f6ca60c79eb826cc10422d15e98b167814a (diff) |
QT_INLINE_SINCE: take version into account
This patch improves the QT_INLINE_SINCE(maj, min) macro to take
deprecation version into account.
If the specified (maj, min) version is less than or equal to the
version defined by QT_DISABLE_DEPRECATED_BEFORE, the macro will expand
to "inline", and the out-of-line fallback will be removed from the
library.
This is achieved by introducing the helper
QT_IF_DEPRECATED_SINCE(major, minor, whenTrue, whenFalse) macro.
Fixes: QTBUG-104131
Pick-to: 6.4
Change-Id: I285029dad7b71126072b024a3be6d7b11341996d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'cmake/modulecppexports.h.in')
-rw-r--r-- | cmake/modulecppexports.h.in | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cmake/modulecppexports.h.in b/cmake/modulecppexports.h.in index a2c2155720..f4e976b540 100644 --- a/cmake/modulecppexports.h.in +++ b/cmake/modulecppexports.h.in @@ -21,13 +21,21 @@ # 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 |