MemoryBuffer: Windows doesn't define S_IFIFO.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 6 Nov 2012 17:08:09 +0000 (17:08 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 6 Nov 2012 17:08:09 +0000 (17:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167467 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/MemoryBuffer.cpp

index 52481281ff834936dfdbadebf23879d33de8b385..ec373e7f997cb35f2ffc8e36840bfcd8cdee3e29 100644 (file)
@@ -33,6 +33,9 @@
 #include <unistd.h>
 #else
 #include <io.h>
+#ifndef S_ISFIFO
+#define S_ISFIFO(x) (0)
+#endif
 #endif
 #include <fcntl.h>
 using namespace llvm;
@@ -321,7 +324,7 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
 
       // If this is a named pipe, we can't trust the size. Create the memory
       // buffer by copying off the stream.
-      if (FileInfo.st_mode & S_IFIFO) {
+      if (S_ISFIFO(FileInfo.st_mode)) {
         return getMemoryBufferForStream(FD, Filename, result);
       }