diff options
author | Yuhang Zhao <2546789017@qq.com> | 2022-08-22 09:57:24 +0800 |
---|---|---|
committer | Yuhang Zhao <2546789017@qq.com> | 2022-08-29 19:23:19 +0800 |
commit | 22662d7dba89794075d3bc3355ba128481e68a6d (patch) | |
tree | 43b09c00448cf668ff46ee410840eb736a06585d /src/corelib/global/qtdeprecationmarkers.h | |
parent | 56c4d183ec30c7f40ece09de1c483829eedc299b (diff) |
QLibraryInfo: Add isSharedBuild() function and deprecate qSharedBuild()
Now that there's QLibraryInfo::isDebugBuild(), it's better to also
have QLibraryInfo::isSharedBuild() at the same time. It's also a
very useful information about the current Qt build.
I think debug/release and static/shared are the most important
properties of a library, so it's better to have them both.
Deprecate the global function qSharedBuild() in favor of the newly
introduced QLibraryInfo::isSharedBuild().
As a drive-by, add the nodiscard attribute to both functions.
[ChangeLog][QtCore] Added QLibraryInfo::isSharedBuild() and deprecated
qSharedBuild().
Change-Id: I48fa0dc5eeca97e709d5267733fa70aae244174f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qtdeprecationmarkers.h')
-rw-r--r-- | src/corelib/global/qtdeprecationmarkers.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/global/qtdeprecationmarkers.h b/src/corelib/global/qtdeprecationmarkers.h index cde9da3038..d3fa1d05bd 100644 --- a/src/corelib/global/qtdeprecationmarkers.h +++ b/src/corelib/global/qtdeprecationmarkers.h @@ -187,6 +187,14 @@ QT_BEGIN_NAMESPACE # define QT_DEPRECATED_VERSION_6_8 #endif +#if QT_WARN_DEPRECATED_UP_TO >= QT_VERSION_CHECK(6, 9, 0) +# define QT_DEPRECATED_VERSION_X_6_9(text) QT_DEPRECATED_X(text) +# define QT_DEPRECATED_VERSION_6_9 QT_DEPRECATED +#else +# define QT_DEPRECATED_VERSION_X_6_9(text) +# define QT_DEPRECATED_VERSION_6_9 +#endif + #define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text) #define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text) @@ -277,6 +285,12 @@ QT_BEGIN_NAMESPACE # define QT_IF_DEPRECATED_SINCE_6_8(whenTrue, whenFalse) whenTrue #endif +#if QT_DEPRECATED_SINCE(6, 9) +# define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenFalse +#else +# define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenTrue +#endif + #ifdef __cplusplus // A tag to help mark stuff deprecated (cf. QStringViewLiteral) namespace QtPrivate { |