qglobal: add a way to selectively export in Qt 6 XOR Qt 7
Because at least one compiler *cough*MSVC*cough* is unable to dllexport a method that is in a dllexport'ed class. Change-Id: I54f205f6b7314351b078fffd16d06b4e6ef0c086 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
0e84d04b90
commit
ea89d0a36c
@ -208,7 +208,9 @@ Cpp.ignoredirectives += \
|
|||||||
QT_WARNING_DISABLE_INTEL \
|
QT_WARNING_DISABLE_INTEL \
|
||||||
QT_WARNING_DISABLE_MSVC \
|
QT_WARNING_DISABLE_MSVC \
|
||||||
Q_ATTRIBUTE_FORMAT_PRINTF \
|
Q_ATTRIBUTE_FORMAT_PRINTF \
|
||||||
Q_MV_IOS
|
Q_MV_IOS \
|
||||||
|
QT6_ONLY \
|
||||||
|
QT7_ONLY
|
||||||
|
|
||||||
# Qt 6: Remove
|
# Qt 6: Remove
|
||||||
falsehoods += \
|
falsehoods += \
|
||||||
|
@ -107,6 +107,24 @@
|
|||||||
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
|
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
|
||||||
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
||||||
|
|
||||||
|
/*
|
||||||
|
helper macros to make some simple code work active in Qt 6 or Qt 7 only,
|
||||||
|
like:
|
||||||
|
struct QT6_ONLY(Q_CORE_EXPORT) QTrivialClass
|
||||||
|
{
|
||||||
|
void QT7_ONLY(Q_CORE_EXPORT) void operate();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
#if QT_VERSION_MAJOR == 7
|
||||||
|
# define QT7_ONLY(...) __VA_ARGS__
|
||||||
|
# define QT6_ONLY(...)
|
||||||
|
#elif QT_VERSION_MAJOR == 6
|
||||||
|
# define QT7_ONLY(...)
|
||||||
|
# define QT6_ONLY(...) __VA_ARGS__
|
||||||
|
#else
|
||||||
|
# error Qt major version not 6 or 7
|
||||||
|
#endif
|
||||||
|
|
||||||
/* These two macros makes it possible to turn the builtin line expander into a
|
/* These two macros makes it possible to turn the builtin line expander into a
|
||||||
* string literal. */
|
* string literal. */
|
||||||
#define QT_STRINGIFY2(x) #x
|
#define QT_STRINGIFY2(x) #x
|
||||||
|
Loading…
x
Reference in New Issue
Block a user