summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-06-16 11:11:18 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-06-16 11:14:27 +1000
commitfaabe90b69551e14317d85f376f040a3dc3ae0bd (patch)
treeaa87184ccab8fa70825928fd3a8ef4d7e7051700 /qmake
parentefb335ea2623c6261810c1594aeda5b655d1f89e (diff)
Fixes crash of qmake on Windows Vista Business x64 (and undefined
behavior on all versions of Windows). setvbuf handles its arguments differently on Unix and Windows. Windows uses the size parameter when the given buffer is NULL, which appears to violate C89/C99. Giving a size parameter of 0 with a NULL buffer caused qmake to crash on Windows Vista Business x64. Windows also can't set line buffering with setvbuf _at all_ according to the MSDN documentation, so don't bother calling it on Windows.
Diffstat (limited to 'qmake')
-rw-r--r--qmake/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 7da66ac6f..f31169926 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -84,12 +84,14 @@ bool qmake_setpwd(const QString &p)
int runQMake(int argc, char **argv)
{
+#ifndef Q_OS_WIN32
// stderr is unbuffered by default, but stdout buffering depends on whether
// there is a terminal attached. Buffering can make output from stderr and stdout
// appear out of sync, so force stdout to be line buffered to minimize this without
// hurting performance too much (if at all). This is particularly important for
// things like QtCreator and scripted builds.
setvbuf(stdout, (char *)NULL, _IOLBF, 0);
+#endif
// parse command line
int ret = Option::init(argc, argv);