mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
C++20 support
This commit is contained in:
parent
a93043f064
commit
4a4b76141a
3 changed files with 15 additions and 6 deletions
|
@ -252,8 +252,12 @@ namespace fs {
|
|||
std::error_code ec;
|
||||
auto t = std::filesystem::last_write_time (path, ec);
|
||||
if (ec) return 0;
|
||||
auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
|
||||
#if __cplusplus >= 202002L // C++ 20 or higher
|
||||
const auto sctp = std::chrono::clock_cast<std::chrono::system_clock>(t);
|
||||
#else
|
||||
const auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
|
||||
t - decltype(t)::clock::now() + std::chrono::system_clock::now());
|
||||
#endif
|
||||
return std::chrono::system_clock::to_time_t(sctp);
|
||||
#else
|
||||
boost::system::error_code ec;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue