aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-15 06:51:30 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-15 06:51:30 +0000
commitdb7a800e0b76036d0faa7123f2e05e45ee3294e5 (patch)
tree2c935038f12e20b751e72ec93139c8b33db49744
parent53ba95612c023ecbcf142b9aaa90e4082fc1b480 (diff)
[libclang] Give up on using write(); hopefully unbreaks mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146648 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/libclang/CIndex.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 386921c49e..f74953fee6 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -46,16 +46,6 @@
#include "llvm/Support/Signals.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/Compiler.h"
-#include <cstdlib>
-
-#if LLVM_ON_WIN32
-#include <windows.h>
-#include <io.h>
-#include <fcntl.h>
-#endif
-#if LLVM_ON_UNIX
-#include <unistd.h>
-#endif
using namespace clang;
using namespace clang::cxcursor;
@@ -2347,13 +2337,9 @@ static llvm::sys::Mutex EnableMultithreadingMutex;
static bool EnabledMultithreading;
static void fatal_error_handler(void *user_data, const std::string& reason) {
- llvm::SmallString<64> Buffer;
- llvm::raw_svector_ostream OS(Buffer);
- OS << "LIBCLANG FATAL ERROR: " << reason << "\n";
- StringRef MessageStr = OS.str();
// Write the result out to stderr avoiding errs() because raw_ostreams can
// call report_fatal_error.
- ::write(2, MessageStr.data(), MessageStr.size());
+ fprintf(stderr, "LIBCLANG FATAL ERROR: %s\n", reason.c_str());
::abort();
}