Expose CRC-32 implementation from zlib

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2013-08-14 16:03:29 +00:00
parent 14a5c695a9
commit ef7aefc53b
3 changed files with 15 additions and 0 deletions
+7
View File
@@ -81,6 +81,10 @@ zlib::Status zlib::uncompress(StringRef InputBuffer,
return Res;
}
uint32_t zlib::crc32(StringRef Buffer) {
return ::crc32(0, (const Bytef *)Buffer.data(), Buffer.size());
}
#else
bool zlib::isAvailable() { return false; }
zlib::Status zlib::compress(StringRef InputBuffer,
@@ -93,5 +97,8 @@ zlib::Status zlib::uncompress(StringRef InputBuffer,
size_t UncompressedSize) {
return zlib::StatusUnsupported;
}
uint32_t zlib::crc32(StringRef Buffer) {
llvm_unreachable("zlib::crc32 is unavailable");
}
#endif