summaryrefslogtreecommitdiffstats
path: root/src/msvc_helper_main-win32.cc
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2013-05-17 22:39:15 (GMT)
committerNico Weber <thakis@chromium.org>2013-05-17 22:39:15 (GMT)
commit93c995ce87e0733e0afc421b4d7d983c6669bd79 (patch)
tree829526344b7790098d33efe90feb21e5d4f5b604 /src/msvc_helper_main-win32.cc
parent9f347d9fd292f960cf93f4ec54c63e9a0a4d281a (diff)
downloadNinja-93c995ce87e0733e0afc421b4d7d983c6669bd79.zip
Ninja-93c995ce87e0733e0afc421b4d7d983c6669bd79.tar.gz
Ninja-93c995ce87e0733e0afc421b4d7d983c6669bd79.tar.bz2
Set stdout to binary mode in -t msvc.
Fixes issue #575.
Diffstat (limited to 'src/msvc_helper_main-win32.cc')
-rw-r--r--src/msvc_helper_main-win32.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/msvc_helper_main-win32.cc b/src/msvc_helper_main-win32.cc
index 647bb86..8a0479c 100644
--- a/src/msvc_helper_main-win32.cc
+++ b/src/msvc_helper_main-win32.cc
@@ -14,6 +14,8 @@
#include "msvc_helper.h"
+#include <fcntl.h>
+#include <io.h>
#include <stdio.h>
#include <windows.h>
@@ -123,6 +125,10 @@ int MSVCHelperMain(int argc, char** argv) {
output = parser.Parse(output);
WriteDepFileOrDie(output_filename, parser);
}
+
+ // CLWrapper's output already as \r\n line endings, make sure the C runtime
+ // doesn't expand this to \r\r\n.
+ _setmode(_fileno(stdout), _O_BINARY);
printf("%s", output.c_str());
return exit_code;