summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/bootstrap-dbus/bootstrap-dbus.pro1
-rw-r--r--src/tools/bootstrap/bootstrap.pro9
-rw-r--r--src/tools/moc/moc.cpp8
-rw-r--r--src/tools/moc/moc.pro7
-rw-r--r--src/tools/moc/preprocessor.cpp6
-rw-r--r--src/tools/qdbuscpp2xml/qdbuscpp2xml.pro2
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.pro2
-rw-r--r--src/tools/qlalr/qlalr.pro3
-rw-r--r--src/tools/rcc/rcc.pro2
-rw-r--r--src/tools/uic/uic.pro2
10 files changed, 29 insertions, 13 deletions
diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
index 3b28c23311..c3ed27d979 100644
--- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro
+++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
@@ -5,6 +5,7 @@ TARGET = QtBootstrapDBus
CONFIG += minimal_syncqt internal_module force_bootstrap
DEFINES += \
+ QT_NO_FOREACH \
QT_NO_CAST_FROM_ASCII
MODULE_INCNAME = QtDBus
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 2eb8837b4c..f763d0c8fe 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -23,6 +23,7 @@ MODULE_DEFINES = \
DEFINES += \
$$MODULE_DEFINES \
QT_CRYPTOGRAPHICHASH_ONLY_SHA1 \
+ QT_NO_FOREACH \
QT_NO_CAST_FROM_ASCII
DEFINES -= QT_EVAL
@@ -133,8 +134,12 @@ macx {
../../corelib/io/qstandardpaths_win.cpp
}
-!contains(QT_CONFIG, system-zlib)|cross_compile:include(../../3rdparty/zlib.pri)
-else:include(../../3rdparty/zlib_dependency.pri)
+!contains(QT_CONFIG, system-zlib)|cross_compile {
+ include(../../3rdparty/zlib.pri)
+} else {
+ CONFIG += no_core_dep
+ include(../../3rdparty/zlib_dependency.pri)
+}
win32:LIBS += -luser32 -lole32 -ladvapi32 -lshell32
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index eb365b293c..f2efcadad7 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -373,8 +373,8 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
def->isVirtual = false;
def->isStatic = false;
//skip modifiers and attributes
- while (test(INLINE) || (test(STATIC) && (def->isStatic = true)) ||
- (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual
+ while (test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) ||
+ (test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual
|| testFunctionAttribute(def) || testFunctionRevision(def)) {}
bool templateFunction = (lookup() == TEMPLATE);
def->type = parseType();
@@ -467,8 +467,8 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
def->isVirtual = false;
def->isStatic = false;
//skip modifiers and attributes
- while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true)) ||
- (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual
+ while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) ||
+ (test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual
|| testFunctionAttribute(def) || testFunctionRevision(def)) {}
bool tilde = test(TILDE);
def->type = parseType();
diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro
index d39749a318..ccd29341d0 100644
--- a/src/tools/moc/moc.pro
+++ b/src/tools/moc/moc.pro
@@ -1,7 +1,12 @@
option(host_build)
CONFIG += force_bootstrap
-DEFINES += QT_MOC QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_NO_COMPRESS
+DEFINES += \
+ QT_MOC \
+ QT_NO_CAST_FROM_ASCII \
+ QT_NO_CAST_FROM_BYTEARRAY \
+ QT_NO_COMPRESS \
+ QT_NO_FOREACH
include(moc.pri)
HEADERS += qdatetime_p.h
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 59611ca597..6ae785f417 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
static QByteArray cleaned(const QByteArray &input)
{
QByteArray result;
- result.reserve(input.size());
+ result.resize(input.size());
const char *data = input.constData();
const char *end = input.constData() + input.size();
char *output = result.data();
@@ -73,13 +73,15 @@ static QByteArray cleaned(const QByteArray &input)
if (data != end && (*(data + 1) == '\n' || (*data) == '\r')) {
++newlines;
data += 1;
- if (*data != '\r')
+ if (data != end && *data != '\r')
data += 1;
continue;
}
} else if (*data == '\r' && *(data + 1) == '\n') { // reduce \r\n to \n
++data;
}
+ if (data == end)
+ break;
char ch = *data;
if (ch == '\r') // os9: replace \r with \n
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
index d65b5ce6ef..5ac3159797 100644
--- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
+++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
@@ -2,7 +2,7 @@ option(host_build)
QT = core-private
force_bootstrap: QT += bootstrap_dbus-private
else: QT += dbus-private
-DEFINES += QT_NO_CAST_FROM_ASCII
+DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
QMAKE_CXXFLAGS += $$QT_HOST_CFLAGS_DBUS
include(../moc/moc.pri)
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
index 6efcf323b8..cb14db5fef 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
@@ -2,7 +2,7 @@ option(host_build)
QT = core-private
force_bootstrap: QT += bootstrap_dbus-private
else: QT += dbus-private
-DEFINES += QT_NO_CAST_FROM_ASCII
+DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
QMAKE_CXXFLAGS += $$QT_HOST_CFLAGS_DBUS
SOURCES = qdbusxml2cpp.cpp
diff --git a/src/tools/qlalr/qlalr.pro b/src/tools/qlalr/qlalr.pro
index 08cf6a1591..bd5f337c64 100644
--- a/src/tools/qlalr/qlalr.pro
+++ b/src/tools/qlalr/qlalr.pro
@@ -22,4 +22,7 @@ HEADERS += \
OTHER_FILES += \
lalr.g
+DEFINES += \
+ QT_NO_FOREACH
+
load(qt_tool)
diff --git a/src/tools/rcc/rcc.pro b/src/tools/rcc/rcc.pro
index de3cc90e1b..701f15ff22 100644
--- a/src/tools/rcc/rcc.pro
+++ b/src/tools/rcc/rcc.pro
@@ -1,7 +1,7 @@
option(host_build)
CONFIG += force_bootstrap
-DEFINES += QT_RCC QT_NO_CAST_FROM_ASCII
+DEFINES += QT_RCC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
include(rcc.pri)
SOURCES += main.cpp
diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro
index a625bdef9a..8008dde07a 100644
--- a/src/tools/uic/uic.pro
+++ b/src/tools/uic/uic.pro
@@ -1,6 +1,6 @@
option(host_build)
-DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII
+DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
include(uic.pri)
include(cpp/cpp.pri)