improve support for systems that need unistd.h to get STDOUT_FILENO.
authorChris Lattner <sabre@nondot.org>
Fri, 22 Aug 2008 15:45:00 +0000 (15:45 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 22 Aug 2008 15:45:00 +0000 (15:45 +0000)
Patch contributed by Bjorn Reese!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55179 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/raw_ostream.cpp

index a5cf629b0718a553f2b387bcc1c2f107067b603c..d776fa583f1ab803279044ae6b28d4015b35b547 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Config/config.h"
 #include <ostream>
-using namespace llvm;
 
-#include <fcntl.h>
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif
+#if defined(HAVE_FCNTL_H)
+# include <fcntl.h>
+#endif
 
 #if defined(_MSC_VER)
 #include <io.h>
@@ -30,6 +35,9 @@ using namespace llvm;
 #endif
 #endif
 
+using namespace llvm;
+
+
 // An out of line virtual method to provide a home for the class vtable.
 void raw_ostream::handle() {}