Solution is to set output stdout to binary mode to prevent newline conversion (\n => \r\n).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134879
91177308-0d34-0410-b5e6-
96231b3b80d8
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#if defined(_WIN32)
+#include <io.h>
+#include <fcntl.h>
+#endif
static int print_remappings(const char *path) {
CMTRemap remap;
#if defined(_WIN32)
if (getenv("LIBCLANG_LOGGING") == NULL)
putenv("LIBCLANG_LOGGING=1");
+ _setmode( _fileno(stdout), _O_BINARY );
#else
setenv("LIBCLANG_LOGGING", "1", /*overwrite=*/0);
#endif