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