mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-20 04:22:32 +00:00
Use ChangeStd{in,out}ToBinary
This commit is contained in:
parent
559a68a261
commit
207e79ea98
12
src/main.cc
12
src/main.cc
@ -9,6 +9,7 @@ using namespace ccls;
|
|||||||
|
|
||||||
#include <llvm/Support/CommandLine.h>
|
#include <llvm/Support/CommandLine.h>
|
||||||
#include <llvm/Support/Process.h>
|
#include <llvm/Support/Process.h>
|
||||||
|
#include <llvm/Support/Program.h>
|
||||||
#include <llvm/Support/Signals.h>
|
#include <llvm/Support/Signals.h>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::cl;
|
using namespace llvm::cl;
|
||||||
@ -58,15 +59,6 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pipeline::Init();
|
pipeline::Init();
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
// We need to write to stdout in binary mode because in Windows, writing
|
|
||||||
// \n will implicitly write \r\n. Language server API will ignore a
|
|
||||||
// \r\r\n split request.
|
|
||||||
_setmode(_fileno(stdout), O_BINARY);
|
|
||||||
_setmode(_fileno(stdin), O_BINARY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IndexInit();
|
IndexInit();
|
||||||
|
|
||||||
bool language_server = true;
|
bool language_server = true;
|
||||||
@ -129,6 +121,8 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sys::ChangeStdinToBinary();
|
||||||
|
sys::ChangeStdoutToBinary();
|
||||||
// The thread that reads from stdin and dispatchs commands to the main thread.
|
// The thread that reads from stdin and dispatchs commands to the main thread.
|
||||||
pipeline::LaunchStdin();
|
pipeline::LaunchStdin();
|
||||||
// The thread that writes responses from the main thread to stdout.
|
// The thread that writes responses from the main thread to stdout.
|
||||||
|
Loading…
Reference in New Issue
Block a user