From 93f400265b8637301c35a72d7deb03aa13850885 Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 21 Dec 2016 23:23:45 -0500 Subject: [PATCH] revert change to use std::time_t (mingw64 has abi issues) --- include/libtorrent/file.hpp | 7 +++---- include/libtorrent/file_storage.hpp | 2 +- src/file_storage.cpp | 2 +- src/read_resume_data.cpp | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/libtorrent/file.hpp b/include/libtorrent/file.hpp index 48e0d25ff..9a37d4561 100644 --- a/include/libtorrent/file.hpp +++ b/include/libtorrent/file.hpp @@ -36,7 +36,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include #include "libtorrent/config.hpp" #include "libtorrent/string_view.hpp" @@ -95,9 +94,9 @@ namespace libtorrent struct file_status { std::int64_t file_size; - std::time_t atime; - std::time_t mtime; - std::time_t ctime; + std::uint64_t atime; + std::uint64_t mtime; + std::uint64_t ctime; enum { #if defined TORRENT_WINDOWS fifo = 0x1000, // named pipe (fifo) diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index dd6b621dd..ea390acfe 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -283,7 +283,7 @@ namespace libtorrent void add_file_borrow(char const* filename, int filename_len , std::string const& path, std::int64_t file_size , std::uint32_t file_flags = 0, char const* filehash = 0 - , std::time_t mtime = 0, string_view symlink_path = string_view()); + , std::int64_t mtime = 0, string_view symlink_path = string_view()); void add_file(std::string const& path, std::int64_t file_size, int file_flags = 0 , std::time_t mtime = 0, string_view symlink_path = string_view()); diff --git a/src/file_storage.cpp b/src/file_storage.cpp index e1ac2b714..b3151240f 100644 --- a/src/file_storage.cpp +++ b/src/file_storage.cpp @@ -549,7 +549,7 @@ namespace libtorrent void file_storage::add_file_borrow(char const* filename, int const filename_len , std::string const& path, std::int64_t const file_size , std::uint32_t const file_flags, char const* filehash - , std::time_t const mtime, string_view symlink_path) + , std::int64_t const mtime, string_view symlink_path) { TORRENT_ASSERT_PRECOND(file_size >= 0); if (!has_parent_path(path)) diff --git a/src/read_resume_data.cpp b/src/read_resume_data.cpp index 394eb1bea..1f4928352 100644 --- a/src/read_resume_data.cpp +++ b/src/read_resume_data.cpp @@ -117,7 +117,7 @@ namespace libtorrent ret.finished_time = int(rd.dict_find_int_value("finished_time")); ret.seeding_time = int(rd.dict_find_int_value("seeding_time")); - ret.last_seen_complete = std::time_t(rd.dict_find_int_value("last_seen_complete")); + ret.last_seen_complete = rd.dict_find_int_value("last_seen_complete"); // scrape data cache ret.num_complete = int(rd.dict_find_int_value("num_complete", -1)); @@ -156,8 +156,8 @@ namespace libtorrent } } - ret.added_time = std::time_t(rd.dict_find_int_value("added_time", 0)); - ret.completed_time = std::time_t(rd.dict_find_int_value("completed_time", 0)); + ret.added_time = rd.dict_find_int_value("added_time", 0); + ret.completed_time = rd.dict_find_int_value("completed_time", 0); // load file priorities except if the add_torrent_param file was set to // override resume data