llvm.org GIT mirror llvm / de3bf07
(Rewroking r296581) 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296583 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 2 years ago
1 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1212 #include "llvm/DebugInfo/MSF/BinaryStreamReader.h"
1313 #include "llvm/DebugInfo/MSF/BinaryStreamRef.h"
1414 #include "llvm/DebugInfo/MSF/BinaryStreamWriter.h"
15 #include "llvm/Support/Errc.h"
1516 #include "gtest/gtest.h"
1617
1718 #include
5556 Error readBytes(uint32_t Offset, uint32_t Size,
5657 ArrayRef &Buffer) override {
5758 if (Offset + Size > Data.size())
58 return errorCodeToError(make_error_code(std::errc::no_buffer_space));
59 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
5960 uint32_t S = startIndex(Offset);
6061 auto Ref = Data.drop_front(S);
6162 if (Ref.size() >= Size) {
7475 Error readLongestContiguousChunk(uint32_t Offset,
7576 ArrayRef &Buffer) override {
7677 if (Offset >= Data.size())
77 return errorCodeToError(make_error_code(std::errc::no_buffer_space));
78 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
7879 uint32_t S = startIndex(Offset);
7980 Buffer = Data.drop_front(S);
8081 return Error::success();
8485
8586 Error writeBytes(uint32_t Offset, ArrayRef SrcData) override {
8687 if (Offset + SrcData.size() > Data.size())
87 return errorCodeToError(make_error_code(std::errc::no_buffer_space));
88 return errorCodeToError(make_error_code(llvm::errc::function_not_supported));
8889 if (SrcData.empty())
8990 return Error::success();
9091