Get raw_ostream.cpp to compile on MSVC.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 17 Aug 2008 09:25:21 +0000 (09:25 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 17 Aug 2008 09:25:21 +0000 (09:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54879 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/raw_ostream.cpp

index 96864277170772a24fc8869d3ab92f7b954e4076..144b90f65ee926d69449c8a7c4ac0aefc57b9a72 100644 (file)
 #include <ostream>
 using namespace llvm;
 
-#if !defined(_MSC_VER)
 #include <fcntl.h>
-#else
+
+#if defined(_MSC_VER)
 #include <io.h>
-#define open(x,y,z) _open(x,y)
-#define write(fd, start, size) _write(fd, start, size)
-#define close(fd) _close(fd)
+#ifndef STDIN_FILENO\r
+# define STDIN_FILENO 0\r
+#endif\r
+#ifndef STDOUT_FILENO\r
+# define STDOUT_FILENO 1\r
+#endif\r
+#ifndef STDERR_FILENO\r
+# define STDERR_FILENO 2\r
+#endif\r
 #endif
 
 // An out of line virtual method to provide a home for the class vtable.