[clang-tools-extra] r294297 - [clangd] Set stdin to binary to fix tests on windows.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 7 04:41:00 PST 2017


Author: d0k
Date: Tue Feb  7 06:40:59 2017
New Revision: 294297

URL: http://llvm.org/viewvc/llvm-project?rev=294297&view=rev
Log:
[clangd] Set stdin to binary to fix tests on windows.

Modified:
    clang-tools-extra/trunk/clangd/ClangDMain.cpp

Modified: clang-tools-extra/trunk/clangd/ClangDMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangDMain.cpp?rev=294297&r1=294296&r2=294297&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangDMain.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangDMain.cpp Tue Feb  7 06:40:59 2017
@@ -11,6 +11,7 @@
 #include "JSONRPCDispatcher.h"
 #include "ProtocolHandlers.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Program.h"
 #include <iostream>
 #include <string>
 using namespace clang::clangd;
@@ -19,6 +20,9 @@ int main(int argc, char *argv[]) {
   llvm::raw_ostream &Outs = llvm::outs();
   llvm::raw_ostream &Logs = llvm::errs();
 
+  // Change stdin to binary to not lose \r\n on windows.
+  llvm::sys::ChangeStdinToBinary();
+
   // Set up a document store and intialize all the method handlers for JSONRPC
   // dispatching.
   DocumentStore Store;




More information about the cfe-commits mailing list