1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-08 17:22:10 +03:00

[pzstd] Changes to compile on VS2015

This commit is contained in:
Nick Terrell
2016-09-06 12:43:07 -07:00
parent 4c202815c7
commit 378d12bb0c
2 changed files with 10 additions and 4 deletions

View File

@@ -20,7 +20,7 @@
namespace pzstd {
using file_status = struct stat;
using file_status = struct ::stat;
/// http://en.cppreference.com/w/cpp/filesystem/status
inline file_status status(StringPiece path, std::error_code& ec) noexcept {
@@ -35,7 +35,13 @@ inline file_status status(StringPiece path, std::error_code& ec) noexcept {
/// http://en.cppreference.com/w/cpp/filesystem/is_regular_file
inline bool is_regular_file(file_status status) noexcept {
#if defined(S_ISREG)
return S_ISREG(status.st_mode);
#elif !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
return (status.st_mode & S_IFMT) == S_IFREG;
#else
static_assert(false, "No POSIX stat() support.");
#endif
}
/// http://en.cppreference.com/w/cpp/filesystem/is_regular_file