[llvm] r296581 - PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 21:06:31 PST 2017
Author: chapuni
Date: Tue Feb 28 23:06:31 2017
New Revision: 296581
URL: http://llvm.org/viewvc/llvm-project?rev=296581&view=rev
Log:
PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.
For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592
Modified:
llvm/trunk/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
Modified: llvm/trunk/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/BinaryStreamTest.cpp?rev=296581&r1=296580&r2=296581&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/BinaryStreamTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/BinaryStreamTest.cpp Tue Feb 28 23:06:31 2017
@@ -56,7 +56,7 @@ public:
Error readBytes(uint32_t Offset, uint32_t Size,
ArrayRef<uint8_t> &Buffer) override {
if (Offset + Size > Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(std::errc::function_not_supported));
uint32_t S = startIndex(Offset);
auto Ref = Data.drop_front(S);
if (Ref.size() >= Size) {
@@ -75,7 +75,7 @@ public:
Error readLongestContiguousChunk(uint32_t Offset,
ArrayRef<uint8_t> &Buffer) override {
if (Offset >= Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(std::errc::function_not_supported));
uint32_t S = startIndex(Offset);
Buffer = Data.drop_front(S);
return Error::success();
@@ -85,7 +85,7 @@ public:
Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> SrcData) override {
if (Offset + SrcData.size() > Data.size())
- return errorCodeToError(make_error_code(std::errc::no_buffer_space));
+ return errorCodeToError(make_error_code(std::errc::function_not_supported));
if (SrcData.empty())
return Error::success();
More information about the llvm-commits
mailing list