diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 52481281ff8..ec373e7f997 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -33,6 +33,9 @@ #include #else #include +#ifndef S_ISFIFO +#define S_ISFIFO(x) (0) +#endif #endif #include 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); }