From 5a4787dca01c302dd462a76222dfbf28c8951a8d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 9 Feb 2018 14:29:21 +0100 Subject: Modernize the "regularexpression" feature Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qmetatype.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/corelib/kernel/qmetatype.cpp') diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 5abc2ebd70..518381712a 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -53,12 +53,15 @@ #include "qdatastream.h" #include "qmetatypeswitcher_p.h" +#if QT_CONFIG(regularexpression) +# include "qregularexpression.h" +#endif + #ifndef QT_BOOTSTRAPPED # include "qbitarray.h" # include "qurl.h" # include "qvariant.h" # include "qabstractitemmodel.h" -# include "qregularexpression.h" # include "qjsonvalue.h" # include "qjsonobject.h" # include "qjsonarray.h" @@ -1481,12 +1484,12 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data) stream << *static_cast(data); break; #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) case QMetaType::QRegularExpression: stream << *static_cast(data); break; -#endif // QT_NO_REGULAREXPRESSION +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED case QMetaType::QEasingCurve: stream << *static_cast(data); break; @@ -1711,12 +1714,12 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) stream >> *static_cast< NS(QRegExp)*>(data); break; #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) case QMetaType::QRegularExpression: stream >> *static_cast< NS(QRegularExpression)*>(data); break; -#endif // QT_NO_REGULAREXPRESSION +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED case QMetaType::QEasingCurve: stream >> *static_cast< NS(QEasingCurve)*>(data); break; -- cgit v1.2.3