diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-12-05 13:05:44 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-05 23:03:16 +0100 |
commit | e2d5c06e1afca1ae7f296fa9293dc7c2c22f90e6 (patch) | |
tree | daaf22240b35d3b0ce160204fb1c36e3e93eff5e | |
parent | 2c9d042476e04c5045d238859c7b4402fcadf354 (diff) |
Fix QT_DEPRECATED_SINCE evaluation
QT_DEPRECATED is defined by default by the logic in qglobal.h, but
QT_DEPRECATED_SINCE is evaluated before that definition, making
QT_DEPRECATED_SINCE evaluate to 0, disabling all deprecated code (even
though it shouldn't be disabled).
Fix this by moving the QT_DEPRECATED_SINCE evaluation to after the
evaluation of QT_NO_DEPRECATED and/or definition of QT_DEPRECATED, to
ensure that QT_DEPRECATED_SINCE works as expected.
Change-Id: I57d9f6a3e1859b0057fd4f37bcf2d2cc3dfba230
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r-- | src/corelib/global/qglobal.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index aa6a1e853c..e22d66628e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -54,29 +54,6 @@ */ #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) -#ifndef QT_DISABLE_DEPRECATED_BEFORE -// ### Qt5: remember to change that to 5 when we reach feature freeze -#define QT_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(4, 9, 0) -#endif - -/* - QT_DEPRECATED_SINCE(major, minor) evaluates as true if the Qt version is greater than - the deprecation point specified. - - Use it to specify from which version of Qt a function or class has been deprecated - - Example: - #if QT_DEPRECATED_SINCE(5,1) - QT_DEPRECATED void deprecatedFunction(); //function deprecated since Qt 5.1 - #endif - -*/ -#ifdef QT_DEPRECATED -#define QT_DEPRECATED_SINCE(major, minor) (QT_VERSION_CHECK(major, minor, 0) > QT_DISABLE_DEPRECATED_BEFORE) -#else -#define QT_DEPRECATED_SINCE(major, minor) 0 -#endif - #define QT_PACKAGEDATE_STR "YYYY-MM-DD" #define QT_PACKAGE_TAG "" @@ -1014,6 +991,29 @@ redefine to built-in booleans to make autotests work properly */ # define QT_DEPRECATED_CONSTRUCTOR #endif +#ifndef QT_DISABLE_DEPRECATED_BEFORE +// ### Qt5: remember to change that to 5 when we reach feature freeze +#define QT_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(4, 9, 0) +#endif + +/* + QT_DEPRECATED_SINCE(major, minor) evaluates as true if the Qt version is greater than + the deprecation point specified. + + Use it to specify from which version of Qt a function or class has been deprecated + + Example: + #if QT_DEPRECATED_SINCE(5,1) + QT_DEPRECATED void deprecatedFunction(); //function deprecated since Qt 5.1 + #endif + +*/ +#ifdef QT_DEPRECATED +#define QT_DEPRECATED_SINCE(major, minor) (QT_VERSION_CHECK(major, minor, 0) > QT_DISABLE_DEPRECATED_BEFORE) +#else +#define QT_DEPRECATED_SINCE(major, minor) 0 +#endif + /* moc compats (signals/slots) */ #ifndef QT_MOC_COMPAT # define QT_MOC_COMPAT |