From 3f75fd5a3a22cf41c85ab79d454f5fba448e21d7 Mon Sep 17 00:00:00 2001 From: Gaeel Bradshaw Date: Sun, 15 Aug 2021 13:10:34 +0200 Subject: [PATCH] fix: use st_mtimespec instead of st_mtim on macos --- src/MinedMap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MinedMap.cpp b/src/MinedMap.cpp index 4855b6f..48c9335 100644 --- a/src/MinedMap.cpp +++ b/src/MinedMap.cpp @@ -206,8 +206,10 @@ static int64_t getModTime(const std::string &file) { return INT64_MIN; } -#ifdef _WIN32 +#if defined(_WIN32) return (int64_t)s.st_mtime * 1000000; +#elif defined(__APPLE__) || defined(__NetBSD__) + return (int64_t)s.st_mtimespec.tv_sec * 1000000 + s.st_mtimespec.tv_nsec / 1000; #else return (int64_t)s.st_mtim.tv_sec * 1000000 + s.st_mtim.tv_nsec / 1000; #endif