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

[pzstd] Compile with minGW 64

This commit is contained in:
Nick Terrell
2016-09-06 14:00:20 -07:00
parent 378d12bb0c
commit 4db9fbdec7

View File

@@ -11,6 +11,7 @@
#include "utils/Range.h"
#include <sys/stat.h>
#include <cerrno>
#include <cstdint>
#include <system_error>
@@ -20,12 +21,21 @@
namespace pzstd {
#if defined(_MSC_VER)
using file_status = struct ::_stat64;
#else
using file_status = struct ::stat;
#endif
/// http://en.cppreference.com/w/cpp/filesystem/status
inline file_status status(StringPiece path, std::error_code& ec) noexcept {
file_status status;
if (stat(path.data(), &status)) {
#if defined(_MSC_VER)
const auto error = ::_stat64(path.data(), &status);
#else
const auto error = ::stat(path.data(), &status);
#endif
if (error) {
ec.assign(errno, std::generic_category());
} else {
ec.clear();