From 23bce6b169ca14ff72b672965ed5f89424c2d8fe Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Thu, 16 Jun 2016 14:38:22 +0100 Subject: qmake: Fix missing newlines in generated vcxproj files A bug in the Windows C Runtime causes text mode pipes to drop newlines sometimes. This bug was hidden because of another bug in rcc which caused newlines to be redundantly duplicated. When the latter bug was fixed (commit 53d5811b) the former bug was exposed, causing invalid vcxproj files to be generated. The Windows bug is described here: https://connect.microsoft.com/VisualStudio/feedback/details/1902345 The workaround is to avoid text mode, and do the conversion of "\r\n" to "\n" ourselves (which we were already doing anyway). Change-Id: I792599a4cd7822f109fa921f02207fb1b144b1d1 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators/win32/msvc_objectmodel.cpp') diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index f26dbbc40b..7fd748e39c 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2327,7 +2327,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) dep_cmd.prepend(QLatin1String("cd ") + Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) + QLatin1String(" && ")); - if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { + if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) { QString indeps; while(!feof(proc)) { int read_in = (int)fread(buff, 1, 255, proc); -- cgit v1.2.3