mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 00:01:43 +00:00
use std::chrono::clock_cast when available
This commit is contained in:
1 parent
59c6df0866
commit
0410c57dc4
1 file changed
+3
-3
+3
-3
@@ -260,12 +260,12 @@ namespace fs {
|
||||
std::error_code ec;
|
||||
auto t = std::filesystem::last_write_time (path, ec);
|
||||
if (ec) return 0;
|
||||
/*#if __cplusplus >= 202002L // C++ 20 or higher
|
||||
#if __cpp_lib_chrono >= 201907L // std::chrono::clock_cast
|
||||
const auto sctp = std::chrono::clock_cast<std::chrono::system_clock>(t);
|
||||
#else */ // TODO: wait until implemented
|
||||
#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 */
|
||||
#endif
|
||||
return std::chrono::system_clock::to_time_t(sctp);
|
||||
#else
|
||||
boost::system::error_code ec;
|
||||
|
||||
Reference in new issue
Block a user