Adapt qmljslexer to Qt base change caa40f57d4d

qstrtod is no longer exported.

This effectively reverts commit 149cc3af6 as it causes an explicit
dependency on private headers, leading to more problems downstream
than the implicit dependency using the declaration.

Change-Id: I93a9cfc6e440b20d6bed51504bb8004fd67f341c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2020-08-10 04:35:02 +02:00
parent 354f628052
commit f41f153882
2 changed files with 10 additions and 6 deletions

View File

@@ -35,7 +35,13 @@
#include <QtCore/qdebug.h> #include <QtCore/qdebug.h>
#include <QtCore/QScopedValueRollback> #include <QtCore/QScopedValueRollback>
#include <QtCore/private/qlocale_tools_p.h> QT_BEGIN_NAMESPACE
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_CORE_EXPORT double qstrntod(const char *s00, int len, char const **se, bool *ok);
#else
Q_CORE_EXPORT double qstrntod(const char *s00, qsizetype len, char const **se, bool *ok);
#endif
QT_END_NAMESPACE
QT_QML_BEGIN_NAMESPACE QT_QML_BEGIN_NAMESPACE
@@ -1175,15 +1181,13 @@ int Lexer::scanNumber(QChar ch)
} }
} }
chars.append('\0');
const char *begin = chars.constData(); const char *begin = chars.constData();
const char *end = nullptr; const char *end = nullptr;
bool ok = false; bool ok = false;
_tokenValue = qstrtod(begin, &end, &ok); _tokenValue = qstrntod(begin, chars.size(), &end, &ok);
if (end - begin != chars.size() - 1) { if (end - begin != chars.size()) {
_errorCode = IllegalExponentIndicator; _errorCode = IllegalExponentIndicator;
_errorMessage = QCoreApplication::translate("QmlParser", "Illegal syntax for exponential number"); _errorMessage = QCoreApplication::translate("QmlParser", "Illegal syntax for exponential number");
return T_ERROR; return T_ERROR;

View File

@@ -84,4 +84,4 @@ contains(QT, gui) {
$$PWD/qmljsreformatter.h $$PWD/qmljsreformatter.h
} }
QT += xml core-private QT += xml