Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: src/IceCompileServer.cpp

Issue 1370323005: Remove dependence on header file unistd.h. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompileServer.cpp
diff --git a/src/IceCompileServer.cpp b/src/IceCompileServer.cpp
index 123063104603ad33f6f894070cde038d939b80ac..20be6ee6fe0489ba98ab44cc46bc224232c60c9a 100644
--- a/src/IceCompileServer.cpp
+++ b/src/IceCompileServer.cpp
@@ -29,18 +29,11 @@
#include "llvm/Support/StreamingMemoryObject.h"
#pragma clang diagnostic pop
+#include <cstdio>
#include <fstream>
#include <iostream>
#include <thread>
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
-#endif
-#if defined(_MSC_VER)
-# include <io.h>
-# include <fcntl.h>
-#endif
-
namespace Ice {
namespace {
@@ -116,7 +109,8 @@ void reportFatalErrorThenExitSuccess(void *UserData, const std::string &Reason,
llvm::raw_svector_ostream OS(Buffer);
OS << "LLVM ERROR: " << Reason << "\n";
llvm::StringRef MessageStr = OS.str();
- ssize_t written = ::write(2, MessageStr.data(), MessageStr.size());
+ ssize_t written =
+ ::fwrite(MessageStr.data(), sizeof(char), MessageStr.size(), ::stdout);
(void)written; // If something went wrong, we deliberately just give up.
// If we reached here, we are failing ungracefully. Run the interrupt handlers
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698