diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-11 19:22:58 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-27 17:23:57 +0000 |
commit | 811d8b82b541e94d154697cb854a29b09ae92a0d (patch) | |
tree | b1c5ef43e01ce576d2a3a51d86b37be3af25b46d /qmake/library/qmakeevaluator_p.h | |
parent | 10e5ec25576eea821f2c767e62d00f80e9a01c94 (diff) |
qmake: make argument validation of built-ins data driven
at the time this patch was conceived, it was meant as an exercise in
getting rid of usages of ProString::toQString(m_tmp). however, this was
meanwhile superseded by use of toQStringView().
but the change itself should have been done a long time ago already, and
there is no harm in going through with it.
on the way, this also unifies and fixes some of the error messages.
Change-Id: I337aff994c508df783df4794c3fa0762d83a691b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/library/qmakeevaluator_p.h')
-rw-r--r-- | qmake/library/qmakeevaluator_p.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/qmake/library/qmakeevaluator_p.h b/qmake/library/qmakeevaluator_p.h index f386a49108..f888bc5765 100644 --- a/qmake/library/qmakeevaluator_p.h +++ b/qmake/library/qmakeevaluator_p.h @@ -64,6 +64,22 @@ QT_BEGIN_NAMESPACE namespace QMakeInternal { +struct QMakeBuiltinInit +{ + const char *name; + int func; + enum { VarArgs = 1000 }; + int min_args, max_args; + const char *args; +}; + +struct QMakeBuiltin +{ + QMakeBuiltin(const QMakeBuiltinInit &data); + QString usage; + int index, minArgs, maxArgs; +}; + struct QMakeStatics { QString field_sep; QString strtrue; @@ -83,8 +99,8 @@ struct QMakeStatics { #ifdef PROEVALUATOR_FULL ProKey strREQUIRES; #endif - QHash<ProKey, int> expands; - QHash<ProKey, int> functions; + QHash<ProKey, QMakeBuiltin> expands; + QHash<ProKey, QMakeBuiltin> functions; QHash<ProKey, ProKey> varMap; ProStringList fakeValue; }; @@ -93,6 +109,8 @@ extern QMakeStatics statics; } +Q_DECLARE_TYPEINFO(QMakeInternal::QMakeBuiltin, Q_MOVABLE_TYPE); + QT_END_NAMESPACE #endif // QMAKEEVALUATOR_P_H |