[cfe-commits] r146648 - /cfe/trunk/tools/libclang/CIndex.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Dec 14 22:51:30 PST 2011


Author: akirtzidis
Date: Thu Dec 15 00:51:30 2011
New Revision: 146648

URL: http://llvm.org/viewvc/llvm-project?rev=146648&view=rev
Log:
[libclang] Give up on using write(); hopefully unbreaks mingw build.

Modified:
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=146648&r1=146647&r2=146648&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Dec 15 00:51:30 2011
@@ -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 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();
 }
 





More information about the cfe-commits mailing list