mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-02 09:49:09 +00:00
There is no posix_category in std, use generic_category.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3692045d8e
commit
7456ad1240
@ -650,11 +650,6 @@ public:
|
|||||||
const error_category& generic_category();
|
const error_category& generic_category();
|
||||||
const error_category& system_category();
|
const error_category& system_category();
|
||||||
|
|
||||||
/// Get the error_category used for errno values from POSIX functions. This is
|
|
||||||
/// the same as the system_category on POSIX systems, but is the same as the
|
|
||||||
/// generic_category on Windows.
|
|
||||||
const error_category& posix_category();
|
|
||||||
|
|
||||||
class error_condition
|
class error_condition
|
||||||
{
|
{
|
||||||
int _val_;
|
int _val_;
|
||||||
|
@ -222,7 +222,7 @@ static error_code getMemoryBufferForStream(int FD,
|
|||||||
ReadBytes = read(FD, Buffer.end(), ChunkSize);
|
ReadBytes = read(FD, Buffer.end(), ChunkSize);
|
||||||
if (ReadBytes == -1) {
|
if (ReadBytes == -1) {
|
||||||
if (errno == EINTR) continue;
|
if (errno == EINTR) continue;
|
||||||
return error_code(errno, posix_category());
|
return error_code(errno, generic_category());
|
||||||
}
|
}
|
||||||
Buffer.set_size(Buffer.size() + ReadBytes);
|
Buffer.set_size(Buffer.size() + ReadBytes);
|
||||||
} while (ReadBytes != 0);
|
} while (ReadBytes != 0);
|
||||||
@ -370,7 +370,7 @@ static error_code getOpenFileImpl(int FD, const char *Filename,
|
|||||||
size_t BytesLeft = MapSize;
|
size_t BytesLeft = MapSize;
|
||||||
#ifndef HAVE_PREAD
|
#ifndef HAVE_PREAD
|
||||||
if (lseek(FD, Offset, SEEK_SET) == -1)
|
if (lseek(FD, Offset, SEEK_SET) == -1)
|
||||||
return error_code(errno, posix_category());
|
return error_code(errno, generic_category());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (BytesLeft) {
|
while (BytesLeft) {
|
||||||
@ -383,7 +383,7 @@ static error_code getOpenFileImpl(int FD, const char *Filename,
|
|||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
// Error while reading.
|
// Error while reading.
|
||||||
return error_code(errno, posix_category());
|
return error_code(errno, generic_category());
|
||||||
}
|
}
|
||||||
if (NumRead == 0) {
|
if (NumRead == 0) {
|
||||||
memset(BufPtr, 0, BytesLeft); // zero-initialize rest of the buffer.
|
memset(BufPtr, 0, BytesLeft); // zero-initialize rest of the buffer.
|
||||||
|
@ -96,15 +96,6 @@ system_category() {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
const error_category&
|
|
||||||
posix_category() {
|
|
||||||
#ifdef LLVM_ON_WIN32
|
|
||||||
return generic_category();
|
|
||||||
#else
|
|
||||||
return system_category();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// error_condition
|
// error_condition
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
Loading…
Reference in New Issue
Block a user